Pluto v6.3.0
Loading...
Searching...
No Matches
analyze_eta_dalitz.C
Go to the documentation of this file.
1//TITLE Analyze the eta Dalitz output file
2
3{
4 // This macro uses the output of
5 // * complete_eta.C
6 // * parse_eta.C
7 // * hello_world.C (can have an filter)
8
9 TFile *f = new TFile("eta_dalitz.root");
10 TTree *Reaction = (TTree*)gDirectory->Get("data");
11 TClonesArray *evt=new TClonesArray("PParticle", 100);
12 Reaction->SetBranchAddress("Particles", &evt);
14
15 TH1F *hf1= new TH1F("hf2", "Di-Lepton mass", 100, 0., 0.6);
16 Int_t nentries = Reaction->GetEntries();
17 if (nentries > 1000)
18 nentries = 1000; //limit number of events
19
20 for (Int_t i=0; i<nentries; i++) {
21 ep = NULL;
22 em = NULL;
23 Reaction->GetEntry(i);
24
25 for (int j=0; j<evt->GetEntriesFast(); j++) {
26 PParticle *current = (PParticle*)evt->At(j);
27 //current->Print();
28 if (current->Is("e+")) ep = current;
29 if (current->Is("e-")) em = current;
30 }
31
32 if (ep && em) {
33 //particles found
34
35 //It is very important to parse the PParticle
36 //to a TLorentzVector, because the "+" operator
37 //is reserved for a reaction (i.e. a compound
38 //particle is created
39
40 TLorentzVector dilepton =
41 (*(TLorentzVector *) ep) + (*(TLorentzVector *) em);
42 hf1->Fill(dilepton.M());
43 }
44 }
45
46 hf1->Draw();
47}
TH1F * hf1
PParticle * ep
PParticle * em
Int_t nentries
TTree * Reaction
TFile * f
Definition analyze_g12C.C:8
TClonesArray * evt
Int_t Is(const char *id)
Definition PParticle.h:61
PParticle * dilepton