Pluto v6.3.0
Loading...
Searching...
No Matches
ana_eta_generator.C
Go to the documentation of this file.
1//TITLE Compare eta Dalitz using weights with parse_eta.C
2
3{
4 //First, one has to run parse_eta.C and use_eta_generator.C
5 //If one uses the output of hello_world.C one can
6 //see very nicely the effect of a detector acceptance
7
8 gStyle->SetOptLogy(1);
9
10 TFile *f = new TFile("eta_dalitz.root");
11 TTree *Reaction = (TTree*)gDirectory->Get("data");
12 TClonesArray *evt = new TClonesArray("PParticle", 7);
13 Reaction->SetBranchAddress("Particles", &evt);
15
16 Int_t nentries = Reaction->GetEntries();
17 TH1F *mass = new TH1F("mass", "Dilepton mass", 100, 0, 1.);
18 mass->Sumw2();
19
20 PParticle *dil=NULL, *d=NULL;
21
22 for (Int_t i=0; i<nentries; i++) {
23
24 Reaction->GetEntry(i);
25
26 for (int j=0; j<7; j++) {
27 par[j] = (PParticle*)evt->At(j);
28 if (par[j] && par[j]->is("dilepton")) dil = (PParticle*)evt->At(j);
29 if (par[j] && par[j]->is("D+")) d = (PParticle*)evt->At(j);
30 }
31
32 mass->Fill(dil->M(), (Stat_t) dil->W()*mass->GetNbinsX());
33 }
34
35 mass->SetMinimum(0.000000001);
36 mass->Draw("e1");
37 mass->SetMarkerColor(2);
38 mass->SetLineColor(2);
39
40 TFile *f2 = new TFile("eta_generator.root");
41 Reaction = (TTree*)gDirectory->Get("data");
42
43 Reaction->SetBranchAddress("Particles", &evt);
44
45 nentries = Reaction->GetEntries();
46 TH1F *mass2 = new TH1F("mass2", "Dilepton mass", 100, 0, 1.);
47 mass2->Sumw2();
48
49 for (Int_t i=0; i<nentries; i++) {
50
51 Reaction->GetEntry(i);
52
53 for (int j=0; j<7; j++) {
54 par[j] = (PParticle*)evt->At(j);
55 if (par[j] && par[j]->is("dilepton")) dil = (PParticle*)evt->At(j);
56 if (par[j] && par[j]->is("D+")) d = (PParticle*)evt->At(j);
57 }
58
59 mass2->Fill(dil->M(), (Stat_t) dil->W()*mass2->GetNbinsX());
60 }
61
62 mass2->SetXTitle("M [GeV/c^{2}]");
63 mass2->SetYTitle("counts * BR");
64 mass2->Draw("");
65
66 mass->SetMarkerStyle(4); //open circles
67 mass->Draw("samee1");
68 mass2->SetMarkerColor(4);
69 mass2->SetLineColor(4);
70}
TH1F * mass2
PParticle * dil
PParticle * d
TFile * f2
Int_t nentries
TTree * Reaction
TFile * f
Definition analyze_g12C.C:8
PParticle * par[11]
TClonesArray * evt
Double_t mass