8 void initHist(TH1D* theHist) {
10 theHist->SetDirectory(0);
12 theHist->SetTitleOffset(1.1,
"Y");
13 theHist->SetLineWidth(2);
14 TAxis* xAxis = theHist->GetXaxis();
15 xAxis->SetLabelSize(0.05);
16 xAxis->SetTitleSize(0.05);
17 TAxis* yAxis = theHist->GetYaxis();
18 yAxis->SetLabelSize(0.05);
19 yAxis->SetTitleSize(0.05);
23 void plotBKstarGamma(
string inFileName =
"BKstarGamma.root") {
25 TFile* theFile =
new TFile(inFileName.c_str(),
"read");
26 TTree* theTree =
dynamic_cast<TTree*
>(theFile->Get(
"Data"));
30 TH1D* KstMHist =
new TH1D(
"KstMHist",
"", 100, 0.0, 5.0);
31 KstMHist->SetXTitle(
"K^{*0'} mass (GeV/c^{2})");
32 KstMHist->SetYTitle(
"Frequency/50 (MeV/c^{2})");
35 TH1D* gamPHist =
new TH1D(
"gamPHist",
"", 100, 0.0, 3.0);
36 gamPHist->SetXTitle(
"1st #gamma mtm (GeV/c)");
37 gamPHist->SetYTitle(
"Frequency/30 (MeV/c^{2})");
40 TH1D* FSRPHist =
new TH1D(
"FSRPHist",
"", 100, 0.0, 2.0);
41 FSRPHist->SetXTitle(
"FSR #gamma mtm (GeV/c)");
42 FSRPHist->SetYTitle(
"Frequency/20 (MeV/c)");
45 TH1D* KPHist =
new TH1D(
"KPHist",
"", 100, 0.0, 3.0);
46 KPHist->SetXTitle(
"K^{+} mtm (GeV/c)");
47 KPHist->SetYTitle(
"Frequency/30 (MeV/c)");
50 TH1D* piPHist =
new TH1D(
"piPHist",
"", 100, 0.0, 3.0);
51 piPHist->SetXTitle(
"#pi^{-} mtm (GeV/c)");
52 piPHist->SetYTitle(
"Frequency/30 (MeV/c)");
55 TH1D* gamNHist =
new TH1D(
"gamNHist",
"", 6, 0, 6);
56 gamNHist->SetXTitle(
"Number of photons");
57 gamNHist->SetYTitle(
"Fraction of events");
61 int eventId(0), PDGId(0), pVtx(0), daug(0);
62 double pL(0.0), m(0.0);
63 theTree->SetBranchStatus(
"*", 0);
65 theTree->SetBranchStatus(
"eventId", 1);
66 theTree->SetBranchStatus(
"PDGId", 1);
67 theTree->SetBranchStatus(
"daug", 1);
68 theTree->SetBranchStatus(
"pVtx", 1);
69 theTree->SetBranchStatus(
"pL", 1);
70 theTree->SetBranchStatus(
"m", 1);
71 theTree->SetBranchAddress(
"eventId", &eventId);
72 theTree->SetBranchAddress(
"PDGId", &PDGId);
73 theTree->SetBranchAddress(
"pVtx", &pVtx);
74 theTree->SetBranchAddress(
"daug", &daug);
75 theTree->SetBranchAddress(
"pL", &pL);
76 theTree->SetBranchAddress(
"m", &m);
78 int nEntries = theTree->GetEntries();
83 int nEvents = theTree->GetMaximum(
"eventId") + 1;
85 for (i = 0; i < nEntries; i++) {
89 if (oldEvent != eventId) {
93 gamNHist->Fill(nPhotons*1.0);
103 if (PDGId == 100313) {
110 if (pVtx == 0 && daug == 2) {
135 gROOT->SetStyle(
"Plain");
136 gStyle->SetOptStat(0);
137 TCanvas* theCanvas =
new TCanvas(
"theCanvas",
"", 1200, 1100);
138 theCanvas->UseCurrentStyle();
140 theCanvas->Divide(2,3);
143 double scale = 1.0/(nEvents*1.0);
148 KstMHist->Scale(scale);
149 KstMHist->SetMaximum(0.16);
155 gamPHist->Scale(scale);
156 gamPHist->SetMaximum(0.5);
161 KPHist->Scale(scale);
162 KPHist->SetMaximum(0.025);
171 double FSRIntegral = FSRPHist->Integral();
172 if (FSRIntegral > 0.0) {scale1 = 1.0/FSRIntegral;}
173 FSRPHist->Scale(scale1);
174 FSRPHist->SetMaximum(1.0);
179 piPHist->Scale(scale);
180 piPHist->SetMaximum(0.025);
185 gamNHist->Scale(scale);
186 gamNHist->SetMaximum(1.0);
192 latex.SetTextSize(0.045);
193 latex.DrawLatex(0.1, 0.95,
"B0 #rightarrow K^{*0'} #gamma, K^{*0'} #rightarrow K^{+} #pi^{-} with PHOTOS");
195 theCanvas->Print(
"plotBKstarGamma.eps");