5 TFile *
f_1 =
new TFile(
"/sphenix/user/gregtom3/data/Summer2018/ExclusiveReco_studies/latest_run/10x100_1M_dvmp.root",
"READ");
32 gROOT->LoadMacro(
"/sphenix/user/gregtom3/SBU/research/macros/macros/sPHENIXStyle/sPhenixStyle.C");
37 TH1F * h1_inv_mass_base =
new TH1F(
"",
"",100,0,10);
41 TH1F * h1_inv_mass_10x100_123456 = (TH1F*)h1_inv_mass_base->Clone();
42 TH1F * h1_inv_mass_10x100_1 = (TH1F*)h1_inv_mass_base->Clone();
43 TH1F * h1_inv_mass_10x100_2 = (TH1F*)h1_inv_mass_base->Clone();
44 TH1F * h1_inv_mass_10x100_3 = (TH1F*)h1_inv_mass_base->Clone();
45 TH1F * h1_inv_mass_10x100_4 = (TH1F*)h1_inv_mass_base->Clone();
46 TH1F * h1_inv_mass_10x100_5 = (TH1F*)h1_inv_mass_base->Clone();
47 TH1F * h1_inv_mass_10x100_6 = (TH1F*)h1_inv_mass_base->Clone();
51 h1_inv_mass_10x100_123456->GetXaxis()->SetTitle(
"Invariant Mass [GeV/c^{2}]");
52 h1_inv_mass_10x100_123456->GetYaxis()->SetTitle(
"Counts");
54 h1_inv_mass_10x100_1->GetXaxis()->SetTitle(
"Invariant Mass [GeV/c^{2}]");
55 h1_inv_mass_10x100_1->GetYaxis()->SetTitle(
"Counts");
57 h1_inv_mass_10x100_2->GetXaxis()->SetTitle(
"Invariant Mass [GeV/c^{2}]");
58 h1_inv_mass_10x100_2->GetYaxis()->SetTitle(
"Counts");
60 h1_inv_mass_10x100_3->GetXaxis()->SetTitle(
"Invariant Mass [GeV/c^{2}]");
61 h1_inv_mass_10x100_3->GetYaxis()->SetTitle(
"Counts");
63 h1_inv_mass_10x100_4->GetXaxis()->SetTitle(
"Invariant Mass [GeV/c^{2}]");
64 h1_inv_mass_10x100_4->GetYaxis()->SetTitle(
"Counts");
66 h1_inv_mass_10x100_5->GetXaxis()->SetTitle(
"Invariant Mass [GeV/c^{2}]");
67 h1_inv_mass_10x100_5->GetYaxis()->SetTitle(
"Counts");
69 h1_inv_mass_10x100_6->GetXaxis()->SetTitle(
"Invariant Mass [GeV/c^{2}]");
70 h1_inv_mass_10x100_6->GetYaxis()->SetTitle(
"Counts");
74 std::vector<TString>
types;
75 types.push_back(
"reco_inv");
76 types.push_back(
"true_inv");
77 types.push_back(
"reco_inv_decay");
78 types.push_back(
"reco_inv_scatter");
79 types.push_back(
"true_inv_decay");
80 types.push_back(
"true_inv_scatter");
82 for(
unsigned idx_type = 0 ; idx_type < types.size() ; idx_type++)
100 h1_inv_mass_10x100_2,
101 h1_inv_mass_10x100_3,
102 h1_inv_mass_10x100_4,
103 h1_inv_mass_10x100_5,
104 h1_inv_mass_10x100_6,
"10x100");
111 std::vector<float> reco_inv;
112 std::vector<float> true_inv;
113 std::vector<float> reco_inv_decay;
114 std::vector<float> reco_inv_scatter;
115 std::vector<float> true_inv_decay;
116 std::vector<float> true_inv_scatter;
118 std::vector<float>* reco_inv_pointer = &reco_inv;
119 std::vector<float>* true_inv_pointer = &true_inv;
120 std::vector<float>* reco_inv_decay_pointer = &reco_inv_decay;
121 std::vector<float>* reco_inv_scatter_pointer = &reco_inv_scatter;
122 std::vector<float>* true_inv_decay_pointer = &true_inv_decay;
123 std::vector<float>* true_inv_scatter_pointer = &true_inv_scatter;
125 t->SetBranchAddress(
"reco_inv",&reco_inv_pointer);
126 t->SetBranchAddress(
"true_inv",&true_inv_pointer);
127 t->SetBranchAddress(
"reco_inv_decay",&reco_inv_decay_pointer);
128 t->SetBranchAddress(
"reco_inv_scatter",&reco_inv_scatter_pointer);
129 t->SetBranchAddress(
"true_inv_decay",&true_inv_decay_pointer);
130 t->SetBranchAddress(
"true_inv_scatter",&true_inv_scatter_pointer);
133 Int_t nentries = Int_t(t->GetEntries());
134 char *
type = type_TString.Data();
135 for(Int_t entryInChain=0; entryInChain<nentries; entryInChain++)
137 Int_t entryInTree = t->LoadTree(entryInChain);
138 if (entryInTree < 0)
break;
139 t->GetEntry(entryInChain);
140 if(strcmp(type,
"reco_inv")==0)
142 for(
unsigned i = 0 ;
i<reco_inv.size() ;
i++)
143 h->Fill(reco_inv.at(
i));
145 else if(strcmp(type,
"true_inv")==0)
147 for(
unsigned i = 0 ;
i<true_inv.size() ;
i++)
148 h->Fill(true_inv.at(
i));
150 else if(strcmp(type,
"reco_inv_decay")==0)
152 for(
unsigned i = 0 ;
i<reco_inv_decay.size() ;
i++)
153 h->Fill(reco_inv_decay.at(
i));
155 else if(strcmp(type,
"reco_inv_scatter")==0)
157 for(
unsigned i = 0 ;
i<reco_inv_scatter.size() ;
i++)
158 h->Fill(reco_inv_scatter.at(
i));
160 else if(strcmp(type,
"true_inv_decay")==0)
162 for(
unsigned i = 0 ;
i<true_inv_decay.size() ;
i++)
163 h->Fill(true_inv_decay.at(
i));
165 else if(strcmp(type,
"true_inv_scatter")==0)
167 for(
unsigned i = 0 ;
i<true_inv_scatter.size() ;
i++)
168 h->Fill(true_inv_scatter.at(
i));
177 saveTitle = type +
"_" + saveTitle+
".png";
178 TCanvas *cPNG =
new TCanvas(saveTitle,
"",700,500);
179 TImage *img = TImage::Create();
184 img->WriteImage(saveTitle);
189 TH1F * h4, TH1F * h5, TH1F *h6,
200 TCanvas *cPNG_1 =
new TCanvas(
"plot1",
"",700,500);
201 TImage *img_1 = TImage::Create();
202 auto legend_1 =
new TLegend(0.6,0.75,0.9,0.9);
203 h1->SetLineColor(kRed);
204 h4->SetLineColor(kBlue);
205 legend_1->SetHeader(
"Reco Decay Particles");
206 legend_1->AddEntry(h1,
"All e^{-}e^{+}",
"l");
207 legend_1->AddEntry(h4,
"Background e^{-}e^{+}",
"l");
213 img_1->FromPad(cPNG_1);
214 img_1->WriteImage(
"plot1__"+type+
"_dvmp_reco_inv_full.png");
218 TCanvas *cPNG_2 =
new TCanvas(
"plot2",
"",700,500);
219 TImage *img_2 = TImage::Create();
220 h2->SetLineColor(kRed);
221 h6->SetLineColor(kBlue);
222 auto legend_2 =
new TLegend(0.6,0.75,0.9,0.9);
223 legend_2->SetHeader(
"True Decay Particles");
224 legend_2->AddEntry(h2,
"All e^{-}e^{+}",
"l");
225 legend_2->AddEntry(h6,
"Background e^{-}e^{+}",
"l");
231 img_2->FromPad(cPNG_2);
232 img_2->WriteImage(
"plot2__"+type+
"_dvmp_true_inv_full.png");
236 TCanvas *cPNG_3 =
new TCanvas(
"plot3",
"",1400,500);
237 TImage *img_3 = TImage::Create();
254 img_3->FromPad(cPNG_3);
255 img_3->WriteImage(
"plot3__"+type+
"_dvmp_inv_full.png");