PhaseSpace.C

Go to the documentation of this file.
00001 void PhaseSpace() {
00002 // example of use of TGenPhaseSpace  
00003 //Author: Valerio Filippini
00004 
00005    if (!gROOT->GetClass("TGenPhaseSpace")) gSystem.Load("libPhysics");
00006 
00007    TLorentzVector target(0.0, 0.0, 0.0, 0.938);
00008    TLorentzVector beam(0.0, 0.0, .65, .65);
00009    TLorentzVector W = beam + target;
00010 
00011    //(Momentum, Energy units are Gev/C, GeV)
00012    Double_t masses[3] = { 0.938, 0.139, 0.139} ;
00013 
00014    TGenPhaseSpace event;
00015    event.SetDecay(W, 3, masses);
00016 
00017    TH2F *h2 = new TH2F("h2","h2", 50,1.1,1.8, 50,1.1,1.8);
00018 
00019    for (Int_t n=0;n<100000;n++) {
00020       Double_t weight = event.Generate();
00021 
00022       TLorentzVector *pProton = event.GetDecay(0);
00023 
00024       TLorentzVector *pPip    = event.GetDecay(1);
00025       TLorentzVector *pPim    = event.GetDecay(2);
00026 
00027       TLorentzVector pPPip = *pProton + *pPip;
00028       TLorentzVector pPPim = *pProton + *pPim;
00029 
00030       h2->Fill(pPPip.M2() ,pPPim.M2() ,weight);
00031    }
00032    h2->Draw();
00033 }

Generated on Tue Jul 5 15:44:52 2011 for ROOT_528-00b_version by  doxygen 1.5.1