3 void photosPlots(std::string fileName =
"Upsilon4S_PHOTOS.root") {
5 TFile* theFile =
new TFile(fileName.c_str(),
"read");
6 TTree* theTree =
dynamic_cast<TTree*
>(theFile->Get(
"Data"));
7 TTree* nDaugTree =
dynamic_cast<TTree*
>(theFile->Get(
"nDaugTree"));
9 TH1F* eMtmHist =
new TH1F(
"eMtmHist",
"", 100, 0.0, 5.5);
10 eMtmHist->SetXTitle(
"Electron momentum (GeV/c)");
11 eMtmHist->SetYTitle(
"Frequency/55 (MeV/c)");
12 eMtmHist->SetTitleOffset(1.1,
"Y");
13 TAxis* exAxis = eMtmHist->GetXaxis();
14 exAxis->SetLabelSize(0.045);
15 exAxis->SetTitleSize(0.045);
16 TAxis* eyAxis = eMtmHist->GetYaxis();
17 eyAxis->SetLabelSize(0.045);
18 eyAxis->SetTitleSize(0.045);
20 TH1F* pMtmHist =
new TH1F(
"pMtmHist",
"", 100, 0.0, 5.5);
21 pMtmHist->SetXTitle(
"Positron momentum (GeV/c)");
22 pMtmHist->SetYTitle(
"Frequency/55 (MeV/c)");
23 pMtmHist->SetTitleOffset(1.1,
"Y");
24 TAxis* pxAxis = pMtmHist->GetXaxis();
25 pxAxis->SetLabelSize(0.045);
26 pxAxis->SetTitleSize(0.045);
27 TAxis* pyAxis = pMtmHist->GetYaxis();
28 pyAxis->SetLabelSize(0.045);
29 pyAxis->SetTitleSize(0.045);
31 TH1F* gMtmHist =
new TH1F(
"gMtmHist",
"", 100, 0.0, 5.5);
32 gMtmHist->SetXTitle(
"Photon momentum (GeV/c)");
33 gMtmHist->SetYTitle(
"Frequency/55 (MeV/c)");
34 gMtmHist->SetTitleOffset(1.1,
"Y");
35 TAxis* gxAxis = gMtmHist->GetXaxis();
36 gxAxis->SetLabelSize(0.045);
37 gxAxis->SetTitleSize(0.045);
38 TAxis* gyAxis = gMtmHist->GetYaxis();
39 gyAxis->SetLabelSize(0.045);
40 gyAxis->SetTitleSize(0.045);
42 TH1F* nDaugHist =
new TH1F(
"nDaugHist",
"", 10, 0, 10);
43 nDaugHist->SetXTitle(
"Number of daughters");
44 nDaugHist->SetYTitle(
"Frequency");
45 nDaugHist->SetTitleOffset(1.15,
"Y");
46 TAxis* nxAxis = nDaugHist->GetXaxis();
47 nxAxis->SetLabelSize(0.045);
48 nxAxis->SetTitleSize(0.045);
49 TAxis* nyAxis = nDaugHist->GetYaxis();
50 nyAxis->SetLabelSize(0.045);
51 nyAxis->SetTitleSize(0.045);
53 theTree->Draw(
"p>>eMtmHist",
"id==11");
54 theTree->Draw(
"p>>pMtmHist",
"id==-11");
55 theTree->Draw(
"p>>gMtmHist",
"id==22");
56 nDaugTree->Draw(
"nDaug>>nDaugHist");
58 gROOT->SetStyle(
"Plain");
59 gStyle->SetOptStat(0);
60 TCanvas* theCanvas =
new TCanvas(
"theCanvas",
"", 900, 700);
61 theCanvas->UseCurrentStyle();
63 theCanvas->Divide(2,2);
67 double scale = 1.0/eMtmHist->Integral();
69 eMtmHist->Scale(scale);
70 eMtmHist->SetMaximum(1.0);
75 pMtmHist->Scale(scale);
76 pMtmHist->SetMaximum(1.0);
81 gMtmHist->Scale(scale);
82 gMtmHist->SetMaximum(1.0);
87 nDaugHist->Scale(scale);
88 nDaugHist->SetMaximum(0.5);
94 latex.SetTextSize(0.045);
95 latex.DrawLatex(0.1, 0.95,
"#Upsilon(4S) #rightarrow e^{-} e^{+} decay with PHOTOS");
97 theCanvas->Print(
"photosPlots.png");