Logo ROOT  
Reference Guide
PhaseSpace.C File Reference

Detailed Description

View in nbviewer Open in SWAN Example of use of TGenPhaseSpace

void PhaseSpace() {
TLorentzVector target(0.0, 0.0, 0.0, 0.938);
TLorentzVector beam(0.0, 0.0, .65, .65);
TLorentzVector W = beam + target;
//(Momentum, Energy units are Gev/C, GeV)
Double_t masses[3] = { 0.938, 0.139, 0.139} ;
event.SetDecay(W, 3, masses);
TH2F *h2 = new TH2F("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();
}
Author
Valerio Filippini

Definition in file PhaseSpace.C.

n
const Int_t n
Definition: legend1.C:16
TGenPhaseSpace
Definition: TGenPhaseSpace.h:15
TH2F
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:251
Int_t
int Int_t
Definition: RtypesCore.h:45
TLorentzVector::M2
Double_t M2() const
Definition: TLorentzVector.h:491
TGenPhaseSpace::SetDecay
Bool_t SetDecay(TLorentzVector &P, Int_t nt, const Double_t *mass, Option_t *opt="")
Input:
Definition: TGenPhaseSpace.cxx:192
TLorentzVector
Definition: TLorentzVector.h:32
TH2::Fill
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH2.cxx:294
Double_t
double Double_t
Definition: RtypesCore.h:59
TH1::Draw
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2997