17 #include <boost/assign/list_of.hpp>
36 using boost::assign::list_of;
40 const vector<string>& fileNamesMean,
41 const vector<string>& studyNames,
42 const string& outputDir) {
43 fOutputDir = outputDir;
47 fNofStudies = fileNames.size();
48 fHM.resize(fNofStudies);
49 for (
int i = 0;
i < fNofStudies;
i++) {
51 TFile* file =
new TFile(fileNames[
i].c_str());
52 fHM[
i]->ReadFromFile(file);
53 Int_t fNofEvents = (int) H1(
i,
"fh_event_number")->GetEntries();
54 fHM[
i]->ScaleByPattern(
".*", 1. / fNofEvents);
62 fMeanFiles = fileNamesMean;
63 fStudyNames = studyNames;
70 DrawDistributions(
"lmvm_study_source_mom_",
"fh_source_mom_",
kTtCut,
kPi0);
71 DrawDistributions(
"lmvm_study_source_mom_",
"fh_source_mom_",
kTtCut,
kGamma);
73 DrawDistributions(
"lmvm_study_source_pt_",
"fh_source_pt_",
kTtCut,
kPi0);
74 DrawDistributions(
"lmvm_study_source_pt_",
"fh_source_pt_",
kTtCut,
kGamma);
83 TCanvas* c =
new TCanvas(name.c_str(), title.c_str(), width, height);
93 TLegend* leg =
new TLegend(x1, y1, x2, y2);
94 leg->AddEntry(
new TH2D(), text.c_str(),
"");
95 leg->SetFillColor(kWhite);
97 leg->SetBorderSize(0);
102 return (TH1D*) fHM[studyNum]->H1(name);
106 return (TH2D*) fHM[studyNum]->H1(name);
110 for (
unsigned int i = 0;
i < fCanvas.size();
i++) {
116 h->GetXaxis()->SetLabelSize(0.06);
118 h->GetXaxis()->SetBinLabel(step + 1,
124 vector<TH1*> hPtCut, hTtCut;
125 hPtCut.resize(fMeanFiles.size());
126 hTtCut.resize(fMeanFiles.size());
128 for (
unsigned int i = 0;
i < fMeanFiles.size();
i++) {
129 TFile*
f =
new TFile(fMeanFiles[
i].c_str(),
"READ");
131 hPtCut[
i] = (TH1D*)
f->Get(
"fh_bg_minv_ptcut")->Clone();
132 hPtCut[
i]->Rebin(nRebin);
133 hPtCut[
i]->SetMinimum(1e-6);
134 hTtCut[
i] = (TH1D*)
f->Get(
"fh_bg_minv_ttcut")->Clone();
135 hTtCut[
i]->Rebin(nRebin);
136 hPtCut[
i]->SetMinimum(1e-6);
140 "lmvm_study_minv_bg_ttcut",
"lmvm_study_minv_bg_ttcut", 600, 600);
144 "lmvm_study_minv_bg_ptcut",
"lmvm_study_minv_bg_ptcut", 600, 600);
167 "lmvm_study_nof_bg_tracks",
"lmvm_study_nof_bg_tracks", 600, 600);
169 hbg.resize(fNofStudies);
170 for (
int i = 0;
i < fNofStudies;
i++) {
171 hbg[
i] = (TH1D*) H1(
i,
"fh_nof_bg_tracks")->Clone();
173 hbg[
i]->GetYaxis()->SetTitle(
"Tracks/event x10^{-1}");
175 hbg[
i]->SetMinimum(0.0);
177 SetAnalysisStepLabels(hbg[0]);
179 for (
int i = 0;
i < fNofStudies;
i++) {
180 hbg[
i]->SetLineWidth(3.);
185 TCanvas* c = CreateCanvas(
186 "lmvm_study_source_tracks_abs",
"lmvm_study_source_tracks_abs", 1200, 400);
188 for (
int iP = 0; iP < 3; iP++) {
191 habsPx.resize(fNofStudies);
192 for (
int i = 0;
i < fNofStudies;
i++) {
193 TH2D* habs = (TH2D*) H2(
i,
"fh_source_tracks")->Clone();
196 if (iP == 2)
max = 9;
198 ss <<
"fh_source_tracks_" <<
i <<
"_" <<
min <<
"_" <<
max;
199 habsPx[
i] = habs->ProjectionX(ss.str().c_str(),
min,
max);
201 habsPx[
i]->GetYaxis()->SetTitle(
"Tracks per event x10^{-2}");
202 habsPx[
i]->Scale(100);
205 habsPx, fStudyNames,
kLinear,
kLinear,
true, 0.70, 0.75, 0.99, 0.99,
"");
206 SetAnalysisStepLabels(habsPx[0]);
207 for (
int i = 0;
i < fNofStudies;
i++) {
208 habsPx[
i]->SetMinimum(0.);
209 habsPx[
i]->SetLineWidth(3.);
211 string txt =
"#gamma";
212 if (iP == 1) txt =
"#pi^{0}";
213 if (iP == 2) txt =
"oth.";
214 DrawTextOnHist(txt, 0.5, 0.9, 0.6, 0.99);
219 TCanvas* c = CreateCanvas(
220 "lmvm_study_source_pairs_abs",
"lmvm_study_source_pairs_abs", 1200, 800);
222 for (
int iP = 0; iP < 6; iP++) {
225 habsPx.resize(fNofStudies);
226 for (
int i = 0;
i < fNofStudies;
i++) {
227 TH2D* habs = (TH2D*) H2(
i,
"fh_source_pairs")->Clone();
231 ss <<
"fh_source_pairs_" <<
i <<
"_" <<
min <<
"_" <<
max;
232 habsPx[
i] = habs->ProjectionX(ss.str().c_str(),
min,
max);
234 habsPx[
i]->GetYaxis()->SetTitle(
"Pairs per event x10^{-3}");
235 habsPx[
i]->Scale(1000);
238 habsPx, fStudyNames,
kLinear,
kLinear,
true, 0.70, 0.75, 0.99, 0.99,
"");
239 SetAnalysisStepLabels(habsPx[0]);
240 for (
int i = 0;
i < fNofStudies;
i++) {
241 habsPx[
i]->SetMinimum(0.);
242 habsPx[
i]->SetLineWidth(3.);
247 DrawBgSourcePairsStep(
kPtCut);
248 DrawBgSourcePairsStep(
kTtCut);
254 CreateCanvas(ssC.str().c_str(), ssC.str().c_str(), 600, 600);
256 habsPx.resize(fNofStudies);
257 for (
int i = 0;
i < fNofStudies;
i++) {
258 TH2D* habs = (TH2D*) H2(
i,
"fh_source_pairs")->Clone();
261 habsPx[
i] = habs->ProjectionY(ss.str().c_str(), step + 1, step + 1);
262 habsPx[
i]->GetYaxis()->SetTitle(
"Pairs per event x10^{-3}");
263 habsPx[
i]->Scale(1000);
266 habsPx, fStudyNames,
kLinear,
kLinear,
true, 0.70, 0.75, 0.99, 0.99,
"");
267 for (
int i = 0;
i < fNofStudies;
i++) {
268 habsPx[
i]->SetMinimum(0.);
269 habsPx[
i]->SetLineWidth(3.);
271 habsPx[
i]->GetXaxis()->SetBinLabel(
278 const string& histName,
284 CreateCanvas(ssC.str().c_str(), ssC.str().c_str(), 900, 900);
289 h.resize(fNofStudies);
290 for (
int i = 0;
i < fNofStudies;
i++) {
291 h[
i] = (TH1D*) H1(
i, s)->Clone();
292 h[
i]->GetXaxis()->SetRangeUser(0., 3.);
298 TCanvas* c = CreateCanvas(
299 "lmvm_study_source_minv_ptcut",
"lmvm_study_source_minv_ptcut", 1200, 800);
306 habs.resize(fNofStudies);
307 for (
int i = 0;
i < fNofStudies;
i++) {
308 habs[
i] = (TH1D*) H1(
i, ss.str())->Clone();
312 habs, fStudyNames,
kLinear,
kLinear,
true, 0.70, 0.75, 0.99, 0.99,
"");
313 for (
int i = 0;
i < fNofStudies;
i++) {
314 habs[
i]->SetMinimum(0.);
315 habs[
i]->SetLineWidth(3.);