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
PhaseSpace.C
{
// example of use of TGenPhaseSpace by Valerio Filippini
gROOT.Reset();
if (!gROOT->GetClass("TGenPhaseSpace")) gSystem.Load("libPhysics");
TLorentzVector target(0.0, 0.0, 0.0, 0.938);
TLorentzVector beam(0.0, 0.0, .65, .65);
TLorentzVector W = beam + target;
Double_t masses[3] = { 0.938, 0.139, 0.139} ;
TGenPhaseSpace event;
event.SetDecay(W, 3, masses);
TH2F h2("h2","h2", 50,1.1,1.8, 50,1.1,1.8);
for (Int_t n=0;n<100000;n++) {
Double_t weight = event.Generate();
TLorentzVector *pProton = event.GetDecay(0);
TLorentzVector *pPip = event.GetDecay(1);
TLorentzVector *pPim = event.GetDecay(2);
TLorentzVector pPPip = *pProton + *pPip;
TLorentzVector pPPim = *pProton + *pPim;
h2.Fill(pPPip.M2() ,pPPim.M2() ,weight);
}
h2.Draw();
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...