Revision 8e8882847d428a8f6e4080507e95b42acc6674ad authored by Rene Brun on 26 September 2006, 13:44:50 UTC, committed by Rene Brun on 26 September 2006, 13:44:50 UTC
When loading the geometry from a file, the element table is recreated (never streamed) so the attribute flags (defined/used) of elements are lost. The patch loops over all defined materials/mixtures in this case and restores the flags. Affected: TFluka when geometry was loaded from the file. git-svn-id: http://root.cern.ch/svn/root/trunk@16348 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 0900218
hist2image.C
void hist2image()
{
TCanvas *canv = new TCanvas("image", "xygaus + xygaus(5) + xylandau(10)");
canv->ToggleEventStatus();
canv->SetRightMargin(0.2);
canv->SetLeftMargin(0.01);
canv->SetTopMargin(0.01);
canv->SetBottomMargin(0.01);
// histogram as image (hist taken from draw2dopt.C)
TImage *img = TImage::Create();
TF2 *f2 = new TF2("f2","(xygaus + xygaus(5) + xylandau(10))",-4,4,-4,4);
Double_t params[] = {130,-1.4,1.8,1.5,1, 150,2,0.5,-2,0.5, 3600,-2,0.7,-3,0.3};
f2->SetParameters(params);
TH2D *h2 = new TH2D("h2","xygaus + xygaus(5) + xylandau(10)",100,-4,4,100,-4,4);
h2->FillRandom("f2",40000);
img->SetImage((const Double_t *)h2->GetArray(), h2->GetNbinsX() + 2,
h2->GetNbinsY() + 2, gHistImagePalette);
img->Draw();
img->StartPaletteEditor();
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...