25 #include "RooRealVar.h"
26 #include "RooDataHist.h"
27 #include "RooArgList.h"
29 #include "RooBreitWigner.h"
30 #include "RooCBShape.h"
31 #include "RooFFTConvPdf.h"
32 #include "RooGlobalFunc.h"
33 #include "RooFitResult.h"
43 TFile*
f = TFile::Open(inFilename.c_str(),
"UPDATE");
45 if (
f == 0 || !
f->IsOpen()) {
51 if (
f->GetSize() < 1000.) {
58 TIter next_run(
f->GetListOfKeys());
60 while ((key_run =
dynamic_cast<TKey*
>(next_run())) != 0) {
61 TObject* obj_run = key_run->ReadObj();
62 TDirectory* tdir_run =
dynamic_cast<TDirectory*
>(obj_run);
64 std::string tdir_run_name(tdir_run->GetName());
65 if (tdir_run_name.find(
"run") != std::string::npos) {
66 run_dir = tdir_run_name;
68 TIter next_perf(tdir_run->GetListOfKeys());
70 while ((key_perf =
dynamic_cast<TKey*
>(next_perf())) != 0) {
71 std::string perf_name(key_perf->GetName());
73 if (perf_name.find(
"IDPerfMon") != std::string::npos) {
74 TObject* obj_perf = key_perf->ReadObj();
75 TDirectory* tdir_perf =
dynamic_cast<TDirectory*
>(obj_perf);
77 run_dir = run_dir +
'/';
78 TIter next_module(tdir_perf->GetListOfKeys());
80 while ((key_module =
dynamic_cast<TKey*
>(next_module())) != 0) {
81 std::string module_name(key_module->GetName());
82 if (module_name.find(
"Kshort") != std::string::npos) {
83 TObject* obj_Kshort = key_module->ReadObj();
84 TDirectory* tdir_Kshort =
dynamic_cast<TDirectory*
>(obj_Kshort);
85 if (tdir_Kshort != 0) {
86 TIter next_trigger(tdir_Kshort->GetListOfKeys());
88 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
89 std::string TriggerName = key_trigger->GetName();
98 if (module_name.find(
"Jpsi") != std::string::npos) {
99 TObject* obj_Jpsi = key_module->ReadObj();
100 TDirectory* tdir_Jpsi =
dynamic_cast<TDirectory*
>(obj_Jpsi);
101 if (tdir_Jpsi != 0) {
102 TIter next_trigger(tdir_Jpsi->GetListOfKeys());
103 TKey* key_trigger(0);
104 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
105 std::string TriggerName = key_trigger->GetName();
113 if (module_name.find(
"Upsilon") != std::string::npos) {
114 TObject* obj_Upsilon = key_module->ReadObj();
115 TDirectory* tdir_Upsilon =
dynamic_cast<TDirectory*
>(obj_Upsilon);
116 if (tdir_Upsilon != 0) {
117 TIter next_trigger(tdir_Upsilon->GetListOfKeys());
118 TKey* key_trigger(0);
119 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
120 std::string TriggerName = key_trigger->GetName();
128 if (module_name.find(
"Zee") != std::string::npos) {
129 TObject* obj_Zee = key_module->ReadObj();
130 TDirectory* tdir_Zee =
dynamic_cast<TDirectory*
>(obj_Zee);
132 TIter next_trigger(tdir_Zee->GetListOfKeys());
133 TKey* key_trigger(0);
134 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
135 std::string TriggerName = key_trigger->GetName();
143 if (module_name.find(
"Wenu") != std::string::npos) {
144 TObject* obj_Wenu = key_module->ReadObj();
145 TDirectory* tdir_Wenu =
dynamic_cast<TDirectory*
>(obj_Wenu);
146 if (tdir_Wenu != 0) {
147 TIter next_trigger(tdir_Wenu->GetListOfKeys());
148 TKey* key_trigger(0);
149 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
150 std::string TriggerName = key_trigger->GetName();
158 if (module_name.find(
"ZMM") != std::string::npos) {
159 TObject* obj_ZMM = key_module->ReadObj();
160 TDirectory* tdir_ZMM =
dynamic_cast<TDirectory*
>(obj_ZMM);
162 TIter next_trigger(tdir_ZMM->GetListOfKeys());
163 TKey* key_trigger(0);
164 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
165 std::string TriggerName = key_trigger->GetName();
181 else if (tdir_run_name.find(
"IDPerfMon") != std::string::npos) {
183 TObject* obj_perf = key_run->ReadObj();
184 TDirectory* tdir_perf =
dynamic_cast<TDirectory*
>(obj_perf);
185 if (tdir_perf != 0) {
187 TIter next_module(tdir_perf->GetListOfKeys());
189 while ((key_module =
dynamic_cast<TKey*
>(next_module())) != 0) {
190 std::string module_name(key_module->GetName());
191 if (module_name.find(
"Kshort") != std::string::npos) {
192 TObject* obj_Kshort = key_module->ReadObj();
193 TDirectory* tdir_Kshort =
dynamic_cast<TDirectory*
>(obj_Kshort);
194 if (tdir_Kshort != 0) {
195 TIter next_trigger(tdir_Kshort->GetListOfKeys());
196 TKey* key_trigger(0);
197 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
198 std::string TriggerName = key_trigger->GetName();
206 if (module_name.find(
"Jpsi") != std::string::npos) {
207 TObject* obj_Jpsi = key_module->ReadObj();
208 TDirectory* tdir_Jpsi =
dynamic_cast<TDirectory*
>(obj_Jpsi);
209 if (tdir_Jpsi != 0) {
210 TIter next_trigger(tdir_Jpsi->GetListOfKeys());
211 TKey* key_trigger(0);
212 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
213 std::string TriggerName = key_trigger->GetName();
221 if (module_name.find(
"Upsilon") != std::string::npos) {
222 TObject* obj_Upsilon = key_module->ReadObj();
223 TDirectory* tdir_Upsilon =
dynamic_cast<TDirectory*
>(obj_Upsilon);
224 if (tdir_Upsilon != 0) {
225 TIter next_trigger(tdir_Upsilon->GetListOfKeys());
226 TKey* key_trigger(0);
227 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
228 std::string TriggerName = key_trigger->GetName();
236 if (module_name.find(
"Zee") != std::string::npos) {
237 TObject* obj_Zee = key_module->ReadObj();
238 TDirectory* tdir_Zee =
dynamic_cast<TDirectory*
>(obj_Zee);
240 TIter next_trigger(tdir_Zee->GetListOfKeys());
241 TKey* key_trigger(0);
242 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
243 std::string TriggerName = key_trigger->GetName();
251 if (module_name.find(
"Wenu") != std::string::npos) {
252 TObject* obj_Wenu = key_module->ReadObj();
253 TDirectory* tdir_Wenu =
dynamic_cast<TDirectory*
>(obj_Wenu);
254 if (tdir_Wenu != 0) {
255 TIter next_trigger(tdir_Wenu->GetListOfKeys());
256 TKey* key_trigger(0);
257 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
258 std::string TriggerName = key_trigger->GetName();
266 if (module_name.find(
"ZMM") != std::string::npos) {
267 TObject* obj_ZMM = key_module->ReadObj();
268 TDirectory* tdir_ZMM =
dynamic_cast<TDirectory*
>(obj_ZMM);
270 TIter next_trigger(tdir_ZMM->GetListOfKeys());
271 TKey* key_trigger(0);
272 while ((key_trigger =
dynamic_cast<TKey*
>(next_trigger())) != 0) {
273 std::string TriggerName = key_trigger->GetName();
303 path = run_dir +
"IDPerfMon/Kshort/" + TriggerName;
304 if (
f->cd(
path.c_str()) == 0) {
310 Double_t myPi = TMath::Pi();
312 TH1F* h_massVPtBinFittedHistos[5];
313 TH1F* h_massVRadiusBinFittedHistos[7];
314 TH1F* h_massVEtaBinHistos[10];
315 TH1F* h_massVPhiBinHistos[10];
316 TH1F* h_massVCurvatureDiffBinHistos[6];
396 TH1F* h_mass = (
TH1F*) (
f->Get((
path +
"/ks_mass").c_str())->Clone());
398 TH1F* h_Nevents = (
TH1F*)
f->Get((
path +
"/Nevents").c_str());
399 TH1F* h_rate =
new TH1F(
"rate",
"production rate", 1, 0, 1);
400 double Ntot = h_Nevents->GetEntries();
401 double yield = h_mass->Integral(h_mass->FindBin(0.487), h_mass->FindBin(0.507));
402 double rate = yield / Ntot;
403 double rate_error = sqrt(1 / yield + 1 / Ntot) * yield / Ntot;
404 h_rate->SetBinContent(1, rate);
405 h_rate->SetBinError(1, rate_error);
406 h_rate->Write(
"", TObject::kOverwrite);
421 h_massVPtBinFittedHistos[0] = (
TH1F*) (
f->Get((
path +
"/MassVptBinFitted0").c_str())->Clone());
422 h_massVPtBinFittedHistos[1] = (
TH1F*) (
f->Get((
path +
"/MassVptBinFitted1").c_str())->Clone());
423 h_massVPtBinFittedHistos[2] = (
TH1F*) (
f->Get((
path +
"/MassVptBinFitted2").c_str())->Clone());
424 h_massVPtBinFittedHistos[3] = (
TH1F*) (
f->Get((
path +
"/MassVptBinFitted3").c_str())->Clone());
425 h_massVPtBinFittedHistos[4] = (
TH1F*) (
f->Get((
path +
"/MassVptBinFitted4").c_str())->Clone());
426 h_massVRadiusBinFittedHistos[0] = (
TH1F*) (
f->Get((
path +
"/MassVradiusBinFitted0").c_str())->Clone());
427 h_massVRadiusBinFittedHistos[1] = (
TH1F*) (
f->Get((
path +
"/MassVradiusBinFitted1").c_str())->Clone());
428 h_massVRadiusBinFittedHistos[2] = (
TH1F*) (
f->Get((
path +
"/MassVradiusBinFitted2").c_str())->Clone());
429 h_massVRadiusBinFittedHistos[3] = (
TH1F*) (
f->Get((
path +
"/MassVradiusBinFitted3").c_str())->Clone());
430 h_massVRadiusBinFittedHistos[4] = (
TH1F*) (
f->Get((
path +
"/MassVradiusBinFitted4").c_str())->Clone());
431 h_massVRadiusBinFittedHistos[5] = (
TH1F*) (
f->Get((
path +
"/MassVradiusBinFitted5").c_str())->Clone());
432 h_massVRadiusBinFittedHistos[6] = (
TH1F*) (
f->Get((
path +
"/MassVradiusBinFitted6").c_str())->Clone());
433 h_massVEtaBinHistos[0] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin0").c_str())->Clone());
434 h_massVEtaBinHistos[1] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin1").c_str())->Clone());
435 h_massVEtaBinHistos[2] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin2").c_str())->Clone());
436 h_massVEtaBinHistos[3] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin3").c_str())->Clone());
437 h_massVEtaBinHistos[4] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin4").c_str())->Clone());
438 h_massVEtaBinHistos[5] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin5").c_str())->Clone());
439 h_massVEtaBinHistos[6] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin6").c_str())->Clone());
440 h_massVEtaBinHistos[7] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin7").c_str())->Clone());
441 h_massVEtaBinHistos[8] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin8").c_str())->Clone());
442 h_massVEtaBinHistos[9] = (
TH1F*) (
f->Get((
path +
"/MassVEtaBin9").c_str())->Clone());
443 h_massVPhiBinHistos[0] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin0").c_str())->Clone());
444 h_massVPhiBinHistos[1] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin1").c_str())->Clone());
445 h_massVPhiBinHistos[2] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin2").c_str())->Clone());
446 h_massVPhiBinHistos[3] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin3").c_str())->Clone());
447 h_massVPhiBinHistos[4] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin4").c_str())->Clone());
448 h_massVPhiBinHistos[5] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin5").c_str())->Clone());
449 h_massVPhiBinHistos[6] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin6").c_str())->Clone());
450 h_massVPhiBinHistos[7] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin7").c_str())->Clone());
451 h_massVPhiBinHistos[8] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin8").c_str())->Clone());
452 h_massVPhiBinHistos[9] = (
TH1F*) (
f->Get((
path +
"/MassVPhiBin9").c_str())->Clone());
453 h_massVCurvatureDiffBinHistos[0] = (
TH1F*) (
f->Get((
path +
"/MassVCurvatureDiffBin0").c_str())->Clone());
454 h_massVCurvatureDiffBinHistos[1] = (
TH1F*) (
f->Get((
path +
"/MassVCurvatureDiffBin1").c_str())->Clone());
455 h_massVCurvatureDiffBinHistos[2] = (
TH1F*) (
f->Get((
path +
"/MassVCurvatureDiffBin2").c_str())->Clone());
456 h_massVCurvatureDiffBinHistos[3] = (
TH1F*) (
f->Get((
path +
"/MassVCurvatureDiffBin3").c_str())->Clone());
457 h_massVCurvatureDiffBinHistos[4] = (
TH1F*) (
f->Get((
path +
"/MassVCurvatureDiffBin4").c_str())->Clone());
458 h_massVCurvatureDiffBinHistos[5] = (
TH1F*) (
f->Get((
path +
"/MassVCurvatureDiffBin5").c_str())->Clone());
460 TF1* func1 =
new TF1(
"func1",
"gaus", 0.460, 0.540);
461 TF1* func2 =
new TF1(
"func2",
"expo", 0.460, 0.540);
462 TF1* func =
new TF1(
"func",
"func1+func2", 0.460, 0.540);
464 func->SetLineColor(4);
465 func->SetParameters(10., 0.500, 0.010, 2., -.001);
467 func->SetParLimits(1, 0.460, 0.540);
468 func->SetParLimits(2, 0., 0.100);
469 func->SetParLimits(3, 0., 10000.);
470 func->SetParLimits(4, -1000., 0.);
471 func->SetParNames(
"Constant",
"Mean",
"Sigma",
"Constant",
"Slope");
473 TCanvas* myCanvas =
new TCanvas(
"MyCanvas");
476 h_mass->Fit(func,
"lmhqnr");
478 Double_t massBins[5], massErrorBins[5], widthBins[5], widthErrorBins[5];
479 const Int_t nPtBinsHisto = 5 + 1;
480 Double_t ptBins[nPtBinsHisto] = {
481 0.5, 1.6, 2.1, 2.8, 3.9, 5.1
483 for (
int binFill = 0; binFill < 5; binFill++) {
484 double max = h_massVPtBinFittedHistos[binFill]->GetBinContent(h_massVPtBinFittedHistos[binFill]->GetMaximumBin());
485 func->SetParLimits(0, 0, 2 *
max);
486 h_massVPtBinFittedHistos[binFill]->Fit(func,
"lmhqr");
487 massBins[binFill] = func->GetParameter(1);
488 massErrorBins[binFill] = func->GetParError(1);
489 widthBins[binFill] = func->GetParameter(2);
490 widthErrorBins[binFill] = func->GetParError(2);
493 const Double_t* ptBinsFinal = ptBins;
494 const Double_t* massBinsFinal = massBins;
495 const Double_t* massErrorBinsFinal = massErrorBins;
496 const Double_t* widthBinsFinal = widthBins;
497 const Double_t* widthErrorBinsFinal = widthErrorBins;
499 TH1F* h_massVersusPt =
new TH1F(
"KsMassVersusPt_Merged",
"", 5, ptBinsFinal);
500 h_massVersusPt->SetXTitle(
"p_{T} (Gev / c)");
501 h_massVersusPt->SetYTitle(
"Mass (Gev / c^{2})");
502 h_massVersusPt->SetMarkerStyle(20);
503 for (
int binFill = 0; binFill < 5; binFill++) {
504 Double_t binContent = massBinsFinal[binFill];
505 Double_t binError = massErrorBinsFinal[binFill];
506 h_massVersusPt->SetBinContent(binFill + 1, binContent);
507 h_massVersusPt->SetBinError(binFill + 1, binError);
510 TH1F* h_widthVersusPt =
new TH1F(
"KsWidthVersusPt_Merged",
"", 5, ptBinsFinal);
511 h_widthVersusPt->SetXTitle(
"p_{T} (Gev / c)");
512 h_widthVersusPt->SetYTitle(
"Width (Gev / c^{2})");
513 h_widthVersusPt->SetMarkerStyle(20);
514 for (
int binFill = 0; binFill < 5; binFill++) {
515 Double_t binContent = widthBinsFinal[binFill];
516 Double_t binError = widthErrorBinsFinal[binFill];
517 h_widthVersusPt->SetBinContent(binFill + 1, binContent);
518 h_widthVersusPt->SetBinError(binFill + 1, binError);
521 Double_t massVradiusBins[7], massVradiusErrorBins[7], widthVradiusBins[7], widthVradiusErrorBins[7];
522 const Int_t nRadiusBinsHisto = 7 + 1;
523 Double_t radiusBins[nRadiusBinsHisto] = {
524 0., 30., 40., 60., 80., 100., 140., 230
526 for (
int binFill = 0; binFill < 7; binFill++) {
527 double max = h_massVRadiusBinFittedHistos[binFill]->GetBinContent(
528 h_massVRadiusBinFittedHistos[binFill]->GetMaximumBin());
529 func->SetParLimits(0, 0, 2 *
max);
530 h_massVRadiusBinFittedHistos[binFill]->Fit(func,
"lmhqr");
531 massVradiusBins[binFill] = func->GetParameter(1);
532 massVradiusErrorBins[binFill] = func->GetParError(1);
533 widthVradiusBins[binFill] = func->GetParameter(2);
534 widthVradiusErrorBins[binFill] = func->GetParError(2);
537 const Double_t* radiusBinsFinal = radiusBins;
538 const Double_t* massVradiusBinsFinal = massVradiusBins;
539 const Double_t* massVradiusErrorBinsFinal = massVradiusErrorBins;
540 const Double_t* widthVradiusBinsFinal = widthVradiusBins;
541 const Double_t* widthVradiusErrorBinsFinal = widthVradiusErrorBins;
543 TH1F* h_massVersusRadius =
new TH1F(
"KsMassVersusRadius_Merged",
"", 7, radiusBinsFinal);
544 h_massVersusRadius->SetXTitle(
"Decay Radius (mm)");
545 h_massVersusRadius->SetYTitle(
"Mass (Gev / c^{2})");
546 h_massVersusRadius->SetMarkerStyle(20);
547 for (
int binFill = 0; binFill < 7; binFill++) {
548 Double_t binContent = massVradiusBinsFinal[binFill];
549 Double_t binError = massVradiusErrorBinsFinal[binFill];
550 h_massVersusRadius->SetBinContent(binFill + 1, binContent);
551 h_massVersusRadius->SetBinError(binFill + 1, binError);
553 TH1F* h_widthVersusRadius =
new TH1F(
"KsWidthVersusRadius_Merged",
"", 7, radiusBinsFinal);
554 h_widthVersusRadius->SetXTitle(
"Decay Radius (mm)");
555 h_widthVersusRadius->SetYTitle(
"Width (Gev / c^{2})");
556 h_widthVersusRadius->SetMarkerStyle(20);
557 for (
int binFill = 0; binFill < 7; binFill++) {
558 Double_t binContent = widthVradiusBinsFinal[binFill];
559 Double_t binError = widthVradiusErrorBinsFinal[binFill];
560 h_widthVersusRadius->SetBinContent(binFill + 1, binContent);
561 h_widthVersusRadius->SetBinError(binFill + 1, binError);
565 -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5
567 Double_t massVetaBins[10], massVetaErrorBins[10], widthVetaBins[10], widthVetaErrorBins[10];
568 for (
int binFill = 0; binFill < 10; binFill++) {
569 double max = h_massVEtaBinHistos[binFill]->GetBinContent(h_massVEtaBinHistos[binFill]->GetMaximumBin());
570 func->SetParLimits(0, 0, 2 *
max);
571 h_massVEtaBinHistos[binFill]->Fit(func,
"lmhqr");
572 massVetaBins[binFill] = func->GetParameter(1);
573 massVetaErrorBins[binFill] = func->GetParError(1);
574 widthVetaBins[binFill] = func->GetParameter(2);
575 widthVetaErrorBins[binFill] = func->GetParError(2);
577 TH1F* h_massVersusEta =
new TH1F(
"KsMassVersusEta_Merged",
"", 10,
etaBins);
578 h_massVersusEta->SetXTitle(
"#eta");
579 h_massVersusEta->SetYTitle(
"Mass (Gev / c^{2})");
580 h_massVersusEta->SetMarkerStyle(20);
581 for (
int binFill = 0; binFill < 10; binFill++) {
582 Double_t binContent = massVetaBins[binFill];
583 Double_t binError = massVetaErrorBins[binFill];
584 h_massVersusEta->SetBinContent(binFill + 1, binContent);
585 h_massVersusEta->SetBinError(binFill + 1, binError);
587 TH1F* h_widthVersusEta =
new TH1F(
"KsWidthVersusEta_Merged",
"", 10,
etaBins);
588 h_widthVersusEta->SetXTitle(
"#eta");
589 h_widthVersusEta->SetYTitle(
"Width (Gev / c^{2})");
590 h_widthVersusEta->SetMarkerStyle(20);
591 for (
int binFill = 0; binFill < 10; binFill++) {
592 Double_t binContent = widthVetaBins[binFill];
593 Double_t binError = widthVetaErrorBins[binFill];
594 h_widthVersusEta->SetBinContent(binFill + 1, binContent);
595 h_widthVersusEta->SetBinError(binFill + 1, binError);
598 Double_t phiBins[11] = {
611 Double_t massVphiBins[10], massVphiErrorBins[10], widthVphiBins[10], widthVphiErrorBins[10];
612 for (
int binFill = 0; binFill < 10; binFill++) {
613 double max = h_massVPhiBinHistos[binFill]->GetBinContent(h_massVPhiBinHistos[binFill]->GetMaximumBin());
614 func->SetParLimits(0, 0, 2 *
max);
615 h_massVPhiBinHistos[binFill]->Fit(func,
"lmhqr");
616 massVphiBins[binFill] = func->GetParameter(1);
617 massVphiErrorBins[binFill] = func->GetParError(1);
618 widthVphiBins[binFill] = func->GetParameter(2);
619 widthVphiErrorBins[binFill] = func->GetParError(2);
621 TH1F* h_massVersusPhi =
new TH1F(
"KsMassVersusPhi_Merged",
"", 10, phiBins);
622 h_massVersusPhi->SetXTitle(
"#phi");
623 h_massVersusPhi->SetYTitle(
"Mass (Gev / c^{2})");
624 h_massVersusPhi->SetMarkerStyle(20);
625 for (
int binFill = 0; binFill < 10; binFill++) {
626 Double_t binContent = massVphiBins[binFill];
627 Double_t binError = massVphiErrorBins[binFill];
628 h_massVersusPhi->SetBinContent(binFill + 1, binContent);
629 h_massVersusPhi->SetBinError(binFill + 1, binError);
631 TH1F* h_widthVersusPhi =
new TH1F(
"KsWidthVersusPhi_Merged",
"", 10, phiBins);
632 h_widthVersusPhi->SetXTitle(
"#phi");
633 h_widthVersusPhi->SetYTitle(
"Width (Gev / c^{2})");
634 h_widthVersusPhi->SetMarkerStyle(20);
635 for (
int binFill = 0; binFill < 10; binFill++) {
636 Double_t binContent = widthVphiBins[binFill];
637 Double_t binError = widthVphiErrorBins[binFill];
638 h_widthVersusPhi->SetBinContent(binFill + 1, binContent);
639 h_widthVersusPhi->SetBinError(binFill + 1, binError);
642 Double_t curvatureDiffBins[7] = {
643 -0.0012, -0.0008, -0.0004, 0.0000, 0.0004, 0.0008, 0.0012
645 Double_t massVcurvatureDiffBins[6], massVcurvatureDiffErrorBins[6], widthVcurvatureDiffBins[6],
646 widthVcurvatureDiffErrorBins[6];
647 for (
int binFill = 0; binFill < 6; binFill++) {
648 double max = h_massVCurvatureDiffBinHistos[binFill]->GetBinContent(
649 h_massVCurvatureDiffBinHistos[binFill]->GetMaximumBin());
650 func->SetParLimits(0, 0, 2 *
max);
651 h_massVCurvatureDiffBinHistos[binFill]->Fit(func,
"lmhqr");
652 massVcurvatureDiffBins[binFill] = func->GetParameter(1);
653 massVcurvatureDiffErrorBins[binFill] = func->GetParError(1);
654 widthVcurvatureDiffBins[binFill] = func->GetParameter(2);
655 widthVcurvatureDiffErrorBins[binFill] = func->GetParError(2);
657 TH1F* h_massVersusCurvatureDiff =
new TH1F(
"KsMassVersusCurvatureDiff_Merged",
"", 6, curvatureDiffBins);
658 h_massVersusCurvatureDiff->SetXTitle(
"1/p_{T}(#pi^{+}) - 1/p_{T}(#pi^{-}) [GeV^{-1}]");
659 h_massVersusCurvatureDiff->SetYTitle(
"Mass (Gev / c^{2})");
660 h_massVersusCurvatureDiff->SetMarkerStyle(20);
661 for (
int binFill = 0; binFill < 6; binFill++) {
662 Double_t binContent = massVcurvatureDiffBins[binFill];
663 Double_t binError = massVcurvatureDiffErrorBins[binFill];
664 h_massVersusCurvatureDiff->SetBinContent(binFill + 1, binContent);
665 h_massVersusCurvatureDiff->SetBinError(binFill + 1, binError);
667 TH1F* h_widthVersusCurvatureDiff =
new TH1F(
"KsWidthVersusCurvatureDiff_Merged",
"", 6, curvatureDiffBins);
668 h_widthVersusCurvatureDiff->SetXTitle(
"1/p_{T}(#pi^{+}) - 1/p_{T}(#pi^{-}) [GeV^{-1}]");
669 h_widthVersusCurvatureDiff->SetYTitle(
"Width (Gev / c^{2})");
670 h_widthVersusCurvatureDiff->SetMarkerStyle(20);
671 for (
int binFill = 0; binFill < 6; binFill++) {
672 Double_t binContent = widthVcurvatureDiffBins[binFill];
673 Double_t binError = widthVcurvatureDiffErrorBins[binFill];
674 h_widthVersusCurvatureDiff->SetBinContent(binFill + 1, binContent);
675 h_widthVersusCurvatureDiff->SetBinError(binFill + 1, binError);
678 if (
f->cd(
path.c_str()) == 0) {
686 h_mass->Write(
"", TObject::kOverwrite);
688 h_massVPtBinFittedHistos[0]->Write(
"", TObject::kOverwrite);
689 h_massVPtBinFittedHistos[1]->Write(
"", TObject::kOverwrite);
690 h_massVPtBinFittedHistos[2]->Write(
"", TObject::kOverwrite);
691 h_massVPtBinFittedHistos[3]->Write(
"", TObject::kOverwrite);
692 h_massVPtBinFittedHistos[4]->Write(
"", TObject::kOverwrite);
693 h_massVRadiusBinFittedHistos[0]->Write(
"", TObject::kOverwrite);
694 h_massVRadiusBinFittedHistos[1]->Write(
"", TObject::kOverwrite);
695 h_massVRadiusBinFittedHistos[2]->Write(
"", TObject::kOverwrite);
696 h_massVRadiusBinFittedHistos[3]->Write(
"", TObject::kOverwrite);
697 h_massVRadiusBinFittedHistos[4]->Write(
"", TObject::kOverwrite);
698 h_massVRadiusBinFittedHistos[5]->Write(
"", TObject::kOverwrite);
699 h_massVRadiusBinFittedHistos[6]->Write(
"", TObject::kOverwrite);
700 h_massVEtaBinHistos[0]->Write(
"", TObject::kOverwrite);
701 h_massVEtaBinHistos[1]->Write(
"", TObject::kOverwrite);
702 h_massVEtaBinHistos[2]->Write(
"", TObject::kOverwrite);
703 h_massVEtaBinHistos[3]->Write(
"", TObject::kOverwrite);
704 h_massVEtaBinHistos[4]->Write(
"", TObject::kOverwrite);
705 h_massVEtaBinHistos[5]->Write(
"", TObject::kOverwrite);
706 h_massVEtaBinHistos[6]->Write(
"", TObject::kOverwrite);
707 h_massVEtaBinHistos[7]->Write(
"", TObject::kOverwrite);
708 h_massVEtaBinHistos[8]->Write(
"", TObject::kOverwrite);
709 h_massVEtaBinHistos[9]->Write(
"", TObject::kOverwrite);
710 h_massVPhiBinHistos[0]->Write(
"", TObject::kOverwrite);
711 h_massVPhiBinHistos[1]->Write(
"", TObject::kOverwrite);
712 h_massVPhiBinHistos[2]->Write(
"", TObject::kOverwrite);
713 h_massVPhiBinHistos[3]->Write(
"", TObject::kOverwrite);
714 h_massVPhiBinHistos[4]->Write(
"", TObject::kOverwrite);
715 h_massVPhiBinHistos[5]->Write(
"", TObject::kOverwrite);
716 h_massVPhiBinHistos[6]->Write(
"", TObject::kOverwrite);
717 h_massVPhiBinHistos[7]->Write(
"", TObject::kOverwrite);
718 h_massVPhiBinHistos[8]->Write(
"", TObject::kOverwrite);
719 h_massVPhiBinHistos[9]->Write(
"", TObject::kOverwrite);
720 h_massVCurvatureDiffBinHistos[0]->Write(
"", TObject::kOverwrite);
721 h_massVCurvatureDiffBinHistos[1]->Write(
"", TObject::kOverwrite);
722 h_massVCurvatureDiffBinHistos[2]->Write(
"", TObject::kOverwrite);
723 h_massVCurvatureDiffBinHistos[3]->Write(
"", TObject::kOverwrite);
724 h_massVCurvatureDiffBinHistos[4]->Write(
"", TObject::kOverwrite);
725 h_massVCurvatureDiffBinHistos[5]->Write(
"", TObject::kOverwrite);
727 h_massVersusPt->Write(
"", TObject::kOverwrite);
728 h_widthVersusPt->Write(
"", TObject::kOverwrite);
729 h_massVersusRadius->Write(
"", TObject::kOverwrite);
730 h_widthVersusRadius->Write(
"", TObject::kOverwrite);
731 h_massVersusEta->Write(
"", TObject::kOverwrite);
732 h_widthVersusEta->Write(
"", TObject::kOverwrite);
733 h_massVersusPhi->Write(
"", TObject::kOverwrite);
734 h_widthVersusPhi->Write(
"", TObject::kOverwrite);
735 h_massVersusCurvatureDiff->Write(
"", TObject::kOverwrite);
736 h_widthVersusCurvatureDiff->Write(
"", TObject::kOverwrite);
753 path = run_dir +
"IDPerfMon/Jpsi/" + TriggerName;
755 if (
f->cd(
path.c_str()) == 0) {
761 TH1F* h_jpsi_invmass_vs_pt =
new TH1F(
"Jpsi_invmass_vs_pt",
762 "Jpsi invmass-PDGmass vs. Jpsi Pt; p_{T}(J/#psi) [GeV/c]; Mass Shift [GeV/c^{2}]", 6, 10.,
764 TH1F* h_jpsi_invmass_vs_z0 =
new TH1F(
"Jpsi_invmass_vs_z0",
765 "Jpsi invmass-PDGmass vs. muon z0; z0(#mu) [mm]; Mass Shift [GeV/c^{2}]", 6,
767 TH1F* h_jpsi_invmass_vs_phi =
new TH1F(
"Jpsi_invmass_vs_phi",
768 "Jpsi invmass-PDGmass vs. Jpsi phi; #phi(J/#psi) [rad]; Mass Shift [GeV/c^{2}]", 6, -3.15,
770 TH1F* h_jpsi_invmass_vs_phiplus =
new TH1F(
"Jpsi_invmass_vs_phiplus",
771 "Jpsi invmass-PDGmass vs. Muon+ phi; #phi(#mu^{+}) [rad]; Mass Shift [GeV/c^{2}]", 6, -3.15,
773 TH1F* h_jpsi_invmass_vs_phiminus =
new TH1F(
"Jpsi_invmass_vs_phiminus",
774 "Jpsi invmass-PDGmass vs. Muon- phi; #phi(#mu^{-}) [rad]; Mass Shift [GeV/c^{2}]", 6, -3.15,
776 TH1F* h_jpsi_invmass_vs_phidiff =
new TH1F(
"Jpsi_invmass_vs_phidiff",
777 "Jpsi invmass-PDGmass vs. |phi(+)-phi(-)|; |#phi(#mu^{+})-#phi(#mu^{-})| [rad]; Mass Shift [GeV/c^{2}]", 6, 0.,
779 TH1F* h_jpsi_invmass_vs_phisum =
new TH1F(
"Jpsi_invmass_vs_phisum",
780 "Jpsi invmass-PDGmass vs. phi(+)+phi(-);#phi(#mu^{+})+#phi(#mu^{-}) [rad];Mass Shift [GeV/c^{2}]", 6, -3.15,
782 TH1F* h_jpsi_invmass_vs_eta =
new TH1F(
"Jpsi_invmass_vs_eta",
783 "Jpsi invmass-PDGmass vs. Jpsi eta; #eta(J/#psi); Mass Shift [GeV/c^{2}]", 6,
785 TH1F* h_jpsi_invmass_vs_eta_barrel =
new TH1F(
"Jpsi_invmass_vs_eta_barrel",
786 "Jpsi invmass-PDGmass vs. Jpsi eta (barrel); #eta(J/#psi); Mass Shift [GeV/c^{2}]", 2, -0.8,
788 TH1F* h_jpsi_invmass_vs_eta_ecc =
new TH1F(
"Jpsi_invmass_vs_eta_ecc",
789 "Jpsi invmass-PDGmass vs. Jpsi eta (endcap C); #eta(J/#psi); Mass Shift [GeV/c^{2}]", 2, -2.4,
791 TH1F* h_jpsi_invmass_vs_eta_eca =
new TH1F(
"Jpsi_invmass_vs_eta_eca",
792 "Jpsi invmass-PDGmass vs. Jpsi eta (endcap A); #eta(J/#psi); Mass Shift [GeV/c^{2}]", 2, 0.8,
794 TH1F* h_jpsi_invmass_vs_etaplus =
new TH1F(
"Jpsi_invmass_vs_etaplus",
795 "Jpsi invmass-PDGmass vs. Muon+ eta; #eta(#mu^{+}); Mass Shift [GeV/c^{2}]", 6, -2.4,
797 TH1F* h_jpsi_invmass_vs_etaminus =
new TH1F(
"Jpsi_invmass_vs_etaminus",
798 "Jpsi invmass-PDGmass vs. Muon- eta; #eta(#mu^{-}); Mass Shift [GeV/c^{2}]", 6, -2.4,
800 TH1F* h_jpsi_invmass_vs_maxeta =
new TH1F(
"Jpsi_invmass_vs_maxeta",
801 "Jpsi invmass-PDGmass vs. max Muon |eta|; max|#eta(#mu)|; Mass Shift [GeV/c^{2}]", 6, -2.4,
803 TH1F* h_jpsi_invmass_vs_etadiff =
new TH1F(
"Jpsi_invmass_vs_etadiff",
804 "Jpsi invmass-PDGmass vs. eta(+)-eta(-); #eta(#mu^{+})-#eta(#mu^{-}); Mass Shift [GeV/c^{2}]", 6, -0.5,
806 TH1F* h_jpsi_invmass_vs_sumeta =
new TH1F(
"Jpsi_invmass_vs_sumeta",
807 "Jpsi invmass-PDGmass vs. eta(+)+eta(-); #eta(#mu^{+})+#eta(#mu^{-});Mass Shift [GeV/c^{2}]", 6, -4.8,
809 TH1F* h_jpsi_invmass_vs_sumabseta =
new TH1F(
"Jpsi_invmass_vs_sumabseta",
810 "Jpsi invmass-PDGmass vs. |eta(+)|+|eta(-)|;|#eta(#mu^{+})|+|#eta(#mu^{-})|;Mass Shift [GeV/c^{2}]", 6, 0.,
812 TH1F* h_jpsi_invmass_vs_crt =
new TH1F(
"Jpsi_invmass_vs_curvature",
813 "Jpsi invmass-PDGmass vs. crt(+)-|crt(-)|; 1/p_{T}(#mu^{+})-1/p_{T}(#mu^{-}) [GeV^{-1}]; Mass Shift [GeV/c^{2}]", 6, -0.15,
815 TH1F* h_jpsi_invmass_vs_invpt =
new TH1F(
"Jpsi_invmass_vs_invpt",
816 "Jpsi invmass-PDGmass vs. muon 1/Pt; 1/p_{T}(#mu) [(GeV/c)^{-1}]; Mass Shift [GeV/c^{2}]", 6, 0.05,
818 TH1F* h_jpsi_invmass_vs_angle_eta =
new TH1F(
"Jpsi_invmass_vs_angle_eta",
819 "Jpsi invmass-PDGmass vs. arccos(#Delta#eta/#DeltaR);arccos(#Delta#eta/#DeltaR); Mass Shift [GeV/c^{2}]", 6, 0.,
822 TH1F* h_jpsi_width_vs_pt =
new TH1F(
"Jpsi_width_vs_pt",
823 "Jpsi width vs. Jpsi Pt; p_{T}(J/#psi) [GeV/c]; Width [GeV/c^{2}]", 6, 10.,
825 TH1F* h_jpsi_width_vs_z0 =
new TH1F(
"Jpsi_width_vs_z0",
"Jpsi width vs. muon z0; z0(#mu) [mm]; Width [GeV/c^{2}]",
827 TH1F* h_jpsi_width_vs_phi =
new TH1F(
"Jpsi_width_vs_phi",
828 "Jpsi width vs. Jpsi phi; #phi(J/#psi) [rad]; Width [GeV/c^{2}]", 6, -3.15,
830 TH1F* h_jpsi_width_vs_phiplus =
new TH1F(
"Jpsi_width_vs_phiplus",
831 "Jpsi width vs. Muon+ phi; #phi(#mu^{+}) [rad]; Width [GeV/c^{2}]", 6,
833 TH1F* h_jpsi_width_vs_phiminus =
new TH1F(
"Jpsi_width_vs_phiminus",
834 "Jpsi width vs. Muon- phi; #phi(#mu^{-}) [rad]; Width [GeV/c^{2}]", 6,
836 TH1F* h_jpsi_width_vs_phidiff =
new TH1F(
"Jpsi_width_vs_phidiff",
837 "Jpsi width vs. |phi(+)-phi(-)|; |#phi(#mu^{+})-#phi(#mu^{-})| [rad]; Width [GeV/c^{2}]", 6, 0.,
839 TH1F* h_jpsi_width_vs_phisum =
new TH1F(
"Jpsi_width_vs_phisum",
840 "Jpsi width vs. phi(+)+phi(-);#phi(#mu^{+})+#phi(#mu^{-}) [rad];Width [GeV/c^{2}]", 6, -3.15,
842 TH1F* h_jpsi_width_vs_eta =
new TH1F(
"Jpsi_width_vs_eta",
"Jpsi width vs. Jpsi eta; #eta(J/#psi); Width[GeV/c^{2}]",
844 TH1F* h_jpsi_width_vs_eta_barrel =
new TH1F(
"Jpsi_width_vs_eta_barrel",
845 "Jpsi width vs. Jpsi eta (barrel); #eta(J/#psi); Width [GeV/c^{2}]", 2,
847 TH1F* h_jpsi_width_vs_eta_ecc =
new TH1F(
"Jpsi_width_vs_eta_ecc",
848 "Jpsi width vs. Jpsi eta (endcap C); #eta(J/#psi); Width [GeV/c^{2}]", 2,
850 TH1F* h_jpsi_width_vs_eta_eca =
new TH1F(
"Jpsi_width_vs_eta_eca",
851 "Jpsi width vs. Jpsi eta (endcap A); #eta(J/#psi); Width [GeV/c^{2}]", 2,
853 TH1F* h_jpsi_width_vs_etaplus =
new TH1F(
"Jpsi_width_vs_etaplus",
854 "Jpsi width vs. Muon+ eta; #eta(#mu^{+}); Width [GeV/c^{2}]", 6, -2.4,
856 TH1F* h_jpsi_width_vs_etaminus =
new TH1F(
"Jpsi_width_vs_etaminus",
857 "Jpsi width vs. Muon- eta; #eta(#mu^{-}); Width [GeV/c^{2}]", 6, -2.4,
859 TH1F* h_jpsi_width_vs_maxeta =
new TH1F(
"Jpsi_width_vs_maxeta",
860 "Jpsi width vs. max Muon |eta|; max|#eta(#mu)|; Width[GeV/c^{2}]", 6, -2.4,
862 TH1F* h_jpsi_width_vs_etadiff =
new TH1F(
"Jpsi_width_vs_etadiff",
863 "Jpsi width vs. eta(+)-eta(-); #eta(#mu^{+})-#eta(#mu^{-}); Width [GeV/c^{2}]", 6, -0.5,
865 TH1F* h_jpsi_width_vs_sumeta =
new TH1F(
"Jpsi_width_vs_sumeta",
866 "Jpsi width vs. eta(+)+eta(-); #eta(#mu^{+})+#eta(#mu^{-});Width [GeV/c^{2}]", 6, -4.8,
868 TH1F* h_jpsi_width_vs_sumabseta =
new TH1F(
"Jpsi_width_vs_sumabseta",
869 "Jpsi width vs. |eta(+)|+|eta(-)|;|#eta(#mu^{+})|+|#eta(#mu^{-})|;Width [GeV/c^{2}]", 6, 0.,
871 TH1F* h_jpsi_width_vs_crt =
new TH1F(
"Jpsi_width_vs_curvature",
872 "Jpsi width vs. crt(+)-|crt(-)|; 1/p_{T}(#mu^{+})-1/p_{T}(#mu^{-}) [GeV^{-1}]; Width [GeV/c^{2}]", 6, -0.15,
874 TH1F* h_jpsi_width_vs_invpt =
new TH1F(
"Jpsi_width_vs_invpt",
875 "Jpsi width vs. muon 1/Pt; 1/p_{T}(#mu) [(GeV/c)^{-1}]; Width [GeV/c^{2}]",
877 TH1F* h_jpsi_width_vs_angle_eta =
new TH1F(
"Jpsi_width_vs_angle_eta",
878 "Jpsi width vs. arccos(#Delta#eta/#DeltaR);arccos(#Delta#eta/#DeltaR); Width [GeV/c^{2}]", 6, 0.,
881 TH1F* h_eff_pt =
new TH1F(
"eff_pt",
"ID tracking efficiency vs p_{T} (tag-and-probe);p_{T} [GeV]", 9, 2., 20.);
882 TH1F* h_eff_eta =
new TH1F(
"eff_eta",
"ID tracking efficiency vs #eta (tag-and-probe);#eta", 10, -2.5, 2.5);
883 TH1F* h_eff_phi =
new TH1F(
"eff_phi",
"ID tracking efficiency vs #phi (tag-and-probe);#phi [rad]", 8, -3.15, 3.15);
885 TH1F* h_chargeasym_vs_pt =
new TH1F(
"chargeAsym_vs_pt",
886 "Charge asymmetry vs. p_{T};p_{T}(#mu) [GeV];#frac{N^{-}-N^{+}}{N^{-}+N^{+}}",
913 TH1F* h_mass = (
TH1F*) (
f->Get((
path +
"/Jpsi_invmass").c_str())->Clone());
915 TH1F* h_Nevents = (
TH1F*)
f->Get((
path +
"/Nevents").c_str());
916 TH1F* h_rate =
new TH1F(
"rate",
"production rate", 1, 0, 1);
917 double Ntot = h_Nevents->GetEntries();
918 double yield = h_mass->Integral(h_mass->FindBin(2.95), h_mass->FindBin(3.25));
919 double rate = yield / Ntot;
920 double rate_error = sqrt(1 / yield + 1 / Ntot) * yield / Ntot;
921 h_rate->SetBinContent(1, rate);
922 h_rate->SetBinError(1, rate_error);
923 h_rate->Write(
"", TObject::kOverwrite);
939 TH1F* h_mass_rebin = (
TH1F*) (
f->Get((
path +
"/Jpsi_invmass").c_str())->Clone(
"Jpsi_invmass_rebin"));
940 TString
title = h_mass_rebin->GetTitle();
941 h_mass_rebin->SetMarkerStyle(21);
942 h_mass_rebin->Rebin(2);
943 h_mass_rebin->SetTitle(
title +
" (larger binning for low Stats.)");
944 h_mass_rebin->Write(
"Jpsi_invmass_rebin", TObject::kOverwrite);
949 TH1F* h_probe_all_pt = (
TH1F*) (
f->Get((
path +
"/probe_all_pt").c_str())->Clone());
952 TH1F* h_probe_match_pt = (
TH1F*) (
f->Get((
path +
"/probe_match_pt").c_str())->Clone());
955 TH1F* h_probe_all_eta = (
TH1F*) (
f->Get((
path +
"/probe_all_eta").c_str())->Clone());
958 TH1F* h_probe_match_eta = (
TH1F*) (
f->Get((
path +
"/probe_match_eta").c_str())->Clone());
961 TH1F* h_probe_all_phi = (
TH1F*) (
f->Get((
path +
"/probe_all_phi").c_str())->Clone());
964 TH1F* h_probe_match_phi = (
TH1F*) (
f->Get((
path +
"/probe_match_phi").c_str())->Clone());
967 TH1F* h_ptplus = (
TH1F*) (
f->Get((
path +
"/Muonplus_pt").c_str())->Clone());
970 TH1F* h_ptminus = (
TH1F*) (
f->Get((
path +
"/Muonminus_pt").c_str())->Clone());
972 char cpt[100], cz0[100], cphi[100], cphidiff[100], ceta[100], cetadiff[100], cmaxeta[100], ccrt[100], cinvpt[100],
973 cphiplus[100], cphiminus[100], cetaplus[100], cetaminus[100], ceta_b[100], ceta_ecc[100], ceta_eca[100],
974 cangle_eta[100], csumeta[100], csumabseta[100], csumphi[100];
976 sprintf(cpt, (
path +
"/pt_bin%d").c_str(),
i);
977 sprintf(cz0, (
path +
"/z0_bin%d").c_str(),
i);
978 sprintf(cphi, (
path +
"/phi_bin%d").c_str(),
i);
979 sprintf(cphiplus, (
path +
"/phiplus_bin%d").c_str(),
i);
980 sprintf(cphiminus, (
path +
"/phiminus_bin%d").c_str(),
i);
981 sprintf(cphidiff, (
path +
"/phidiff_bin%d").c_str(),
i);
982 sprintf(ceta, (
path +
"/eta_bin%d").c_str(),
i);
983 sprintf(cetaplus, (
path +
"/etaplus_bin%d").c_str(),
i);
984 sprintf(cetaminus, (
path +
"/etaminus_bin%d").c_str(),
i);
985 sprintf(cmaxeta, (
path +
"/maxeta_bin%d").c_str(),
i);
986 sprintf(cetadiff, (
path +
"/etadiff_bin%d").c_str(),
i);
987 sprintf(ccrt, (
path +
"/crt_bin%d").c_str(),
i);
988 sprintf(cinvpt, (
path +
"/invpt_bin%d").c_str(),
i);
989 sprintf(cangle_eta, (
path +
"/angle_eta_bin%d").c_str(),
i);
990 sprintf(csumphi, (
path +
"/phi_sum%d").c_str(),
i);
991 sprintf(csumeta, (
path +
"/eta_sum%d").c_str(),
i);
992 sprintf(csumabseta, (
path +
"/eta_AbsSum%d").c_str(),
i);
1028 hpt[
i] = (
TH1F*) (
f->Get(cpt)->Clone());
1029 hz0[
i] = (
TH1F*) (
f->Get(cz0)->Clone());
1030 hphi[
i] = (
TH1F*) (
f->Get(cphi)->Clone());
1031 hphiplus[
i] = (
TH1F*) (
f->Get(cphiplus)->Clone());
1032 hphiminus[
i] = (
TH1F*) (
f->Get(cphiminus)->Clone());
1033 hphidiff[
i] = (
TH1F*) (
f->Get(cphidiff)->Clone());
1034 heta[
i] = (
TH1F*) (
f->Get(ceta)->Clone());
1035 hetaplus[
i] = (
TH1F*) (
f->Get(cetaplus)->Clone());
1036 hetaminus[
i] = (
TH1F*) (
f->Get(cetaminus)->Clone());
1037 hetadiff[
i] = (
TH1F*) (
f->Get(cetadiff)->Clone());
1038 hmaxeta[
i] = (
TH1F*) (
f->Get(cmaxeta)->Clone());
1039 hcrt[
i] = (
TH1F*) (
f->Get(ccrt)->Clone());
1040 hinvpt[
i] = (
TH1F*) (
f->Get(cinvpt)->Clone());
1041 hangle_eta[
i] = (
TH1F*) (
f->Get(cangle_eta)->Clone());
1042 hsumphi[
i] = (
TH1F*) (
f->Get(csumphi)->Clone());
1043 hsumeta[
i] = (
TH1F*) (
f->Get(csumeta)->Clone());
1044 hsumabseta[
i] = (
TH1F*) (
f->Get(csumabseta)->Clone());
1047 sprintf(ceta_b, (
path +
"/eta_b_bin%d").c_str(),
i);
1048 sprintf(ceta_eca, (
path +
"/eta_eca_bin%d").c_str(),
i);
1049 sprintf(ceta_ecc, (
path +
"/eta_ecc_bin%d").c_str(),
i);
1056 heta_b[
i] = (
TH1F*) (
f->Get(ceta_b)->Clone());
1057 heta_ecc[
i] = (
TH1F*) (
f->Get(ceta_ecc)->Clone());
1058 heta_eca[
i] = (
TH1F*) (
f->Get(ceta_eca)->Clone());
1061 h_mass->SetMarkerStyle(21);
1063 TCanvas* myCanvas =
new TCanvas(
"MyCanvas");
1081 fitJpsiHistograms(h_jpsi_invmass_vs_eta_barrel, h_jpsi_width_vs_eta_barrel, heta_b, 2);
1082 fitJpsiHistograms(h_jpsi_invmass_vs_eta_eca, h_jpsi_width_vs_eta_eca, heta_eca, 2);
1083 fitJpsiHistograms(h_jpsi_invmass_vs_eta_ecc, h_jpsi_width_vs_eta_ecc, heta_ecc, 2);
1088 if (h_eff_pt->GetNbinsX() == h_probe_match_pt->GetNbinsX()) {
1089 h_eff_pt->SetMarkerStyle(21);
1090 h_eff_eta->SetMarkerStyle(21);
1091 h_eff_phi->SetMarkerStyle(21);
1092 h_eff_pt->Divide(h_probe_match_pt, h_probe_all_pt, 1, 1,
"B");
1093 h_eff_eta->Divide(h_probe_match_eta, h_probe_all_eta, 1, 1,
"B");
1094 h_eff_phi->Divide(h_probe_match_phi, h_probe_all_phi, 1, 1,
"B");
1097 h_chargeasym_vs_pt->Write(
"", TObject::kOverwrite);
1100 if (
f->cd(
path.c_str()) == 0) {
1106 h_mass->Write(
"", TObject::kOverwrite);
1108 hpt[
i]->Write(
"", TObject::kOverwrite);
1109 hz0[
i]->Write(
"", TObject::kOverwrite);
1110 hphi[
i]->Write(
"", TObject::kOverwrite);
1111 hphiplus[
i]->Write(
"", TObject::kOverwrite);
1112 hphiminus[
i]->Write(
"", TObject::kOverwrite);
1113 hphidiff[
i]->Write(
"", TObject::kOverwrite);
1114 heta[
i]->Write(
"", TObject::kOverwrite);
1115 hetadiff[
i]->Write(
"", TObject::kOverwrite);
1116 hmaxeta[
i]->Write(
"", TObject::kOverwrite);
1117 hinvpt[
i]->Write(
"", TObject::kOverwrite);
1118 hcrt[
i]->Write(
"", TObject::kOverwrite);
1119 hetaplus[
i]->Write(
"", TObject::kOverwrite);
1120 hetaminus[
i]->Write(
"", TObject::kOverwrite);
1121 hangle_eta[
i]->Write(
"", TObject::kOverwrite);
1122 hsumphi[
i]->Write(
"", TObject::kOverwrite);
1123 hsumeta[
i]->Write(
"", TObject::kOverwrite);
1124 hsumabseta[
i]->Write(
"", TObject::kOverwrite);
1126 heta_b[
i]->Write(
"", TObject::kOverwrite);
1127 heta_ecc[
i]->Write(
"", TObject::kOverwrite);
1128 heta_eca[
i]->Write(
"", TObject::kOverwrite);
1132 h_jpsi_invmass_vs_pt->Write(
"", TObject::kOverwrite);
1133 h_jpsi_invmass_vs_z0->Write(
"", TObject::kOverwrite);
1134 h_jpsi_invmass_vs_phi->Write(
"", TObject::kOverwrite);
1135 h_jpsi_invmass_vs_phiplus->Write(
"", TObject::kOverwrite);
1136 h_jpsi_invmass_vs_phiminus->Write(
"", TObject::kOverwrite);
1137 h_jpsi_invmass_vs_phidiff->Write(
"", TObject::kOverwrite);
1138 h_jpsi_invmass_vs_eta->Write(
"", TObject::kOverwrite);
1139 h_jpsi_invmass_vs_eta_barrel->Write(
"", TObject::kOverwrite);
1140 h_jpsi_invmass_vs_eta_ecc->Write(
"", TObject::kOverwrite);
1141 h_jpsi_invmass_vs_eta_eca->Write(
"", TObject::kOverwrite);
1142 h_jpsi_invmass_vs_etadiff->Write(
"", TObject::kOverwrite);
1143 h_jpsi_invmass_vs_etaplus->Write(
"", TObject::kOverwrite);
1144 h_jpsi_invmass_vs_etaminus->Write(
"", TObject::kOverwrite);
1145 h_jpsi_invmass_vs_maxeta->Write(
"", TObject::kOverwrite);
1146 h_jpsi_invmass_vs_crt->Write(
"", TObject::kOverwrite);
1147 h_jpsi_invmass_vs_invpt->Write(
"", TObject::kOverwrite);
1148 h_jpsi_invmass_vs_angle_eta->Write(
"", TObject::kOverwrite);
1149 h_jpsi_invmass_vs_phisum->Write(
"", TObject::kOverwrite);
1150 h_jpsi_invmass_vs_sumeta->Write(
"", TObject::kOverwrite);
1151 h_jpsi_invmass_vs_sumabseta->Write(
"", TObject::kOverwrite);
1153 h_jpsi_width_vs_pt->Write(
"", TObject::kOverwrite);
1154 h_jpsi_width_vs_z0->Write(
"", TObject::kOverwrite);
1155 h_jpsi_width_vs_phi->Write(
"", TObject::kOverwrite);
1156 h_jpsi_width_vs_phiplus->Write(
"", TObject::kOverwrite);
1157 h_jpsi_width_vs_phiminus->Write(
"", TObject::kOverwrite);
1158 h_jpsi_width_vs_phidiff->Write(
"", TObject::kOverwrite);
1159 h_jpsi_width_vs_eta->Write(
"", TObject::kOverwrite);
1160 h_jpsi_width_vs_eta_barrel->Write(
"", TObject::kOverwrite);
1161 h_jpsi_width_vs_eta_ecc->Write(
"", TObject::kOverwrite);
1162 h_jpsi_width_vs_eta_eca->Write(
"", TObject::kOverwrite);
1163 h_jpsi_width_vs_etadiff->Write(
"", TObject::kOverwrite);
1164 h_jpsi_width_vs_etaplus->Write(
"", TObject::kOverwrite);
1165 h_jpsi_width_vs_etaminus->Write(
"", TObject::kOverwrite);
1166 h_jpsi_width_vs_maxeta->Write(
"", TObject::kOverwrite);
1167 h_jpsi_width_vs_crt->Write(
"", TObject::kOverwrite);
1168 h_jpsi_width_vs_invpt->Write(
"", TObject::kOverwrite);
1169 h_jpsi_width_vs_angle_eta->Write(
"", TObject::kOverwrite);
1170 h_jpsi_width_vs_phisum->Write(
"", TObject::kOverwrite);
1171 h_jpsi_width_vs_sumeta->Write(
"", TObject::kOverwrite);
1172 h_jpsi_width_vs_sumabseta->Write(
"", TObject::kOverwrite);
1174 h_eff_pt->Write(
"", TObject::kOverwrite);
1175 h_eff_eta->Write(
"", TObject::kOverwrite);
1176 h_eff_phi->Write(
"", TObject::kOverwrite);
1193 path = run_dir +
"IDPerfMon/Upsilon/" + TriggerName;
1195 if (
f->cd(
path.c_str()) == 0) {
1201 TH1F* h_upsilon_invmass_vs_pt =
new TH1F(
"Upsilon_invmass_vs_pt",
1202 "Upsilon invmass-PDGmass vs. Upsilon Pt; p_{T}(#Upsilon) [GeV/c]; Mass Shift [GeV/c^{2}]", 6, 4.,
1204 TH1F* h_upsilon_invmass_vs_z0 =
new TH1F(
"Upsilon_invmass_vs_z0",
1205 "Upsilon invmass-PDGmass vs. muon z0; z0(#mu) [mm]; Mass Shift [GeV/c^{2}]", 6, -100.,
1207 TH1F* h_upsilon_invmass_vs_phi =
new TH1F(
"Upsilon_invmass_vs_phi",
1208 "Upsilon invmass-PDGmass vs. Upsilon phi; #phi(#Upsilon) [rad]; Mass Shift [GeV/c^{2}]", 6, -3.15,
1210 TH1F* h_upsilon_invmass_vs_phiplus =
new TH1F(
"Upsilon_invmass_vs_phiplus",
1211 "Upsilon invmass-PDGmass vs. Muon+ phi; #phi(#mu^{+}) [rad]; Mass Shift [GeV/c^{2}]", 6, -3.15,
1213 TH1F* h_upsilon_invmass_vs_phiminus =
new TH1F(
"Upsilon_invmass_vs_phiminus",
1214 "Upsilon invmass-PDGmass vs. Muon- phi; #phi(#mu^{-}) [rad]; Mass Shift [GeV/c^{2}]", 6, -3.15,
1216 TH1F* h_upsilon_invmass_vs_phidiff =
new TH1F(
"Upsilon_invmass_vs_phidiff",
1217 "Upsilon invmass-PDGmass vs. |phi(+)-phi(-)|; |#phi(#mu^{+})-#phi(#mu^{-})| [rad]; Mass Shift [GeV/c^{2}]", 6, 0.,
1219 TH1F* h_upsilon_invmass_vs_eta =
new TH1F(
"Upsilon_invmass_vs_eta",
1220 "Upsilon invmass-PDGmass vs. Upsilon eta; #eta(#Upsilon); Mass Shift [GeV/c^{2}]", 8, -3.2,
1222 TH1F* h_upsilon_invmass_vs_eta_barrel =
new TH1F(
"Upsilon_invmass_vs_eta_barrel",
1223 "Upsilon invmass-PDGmass vs. Upsilon eta (barrel); #eta(#Upsilon); Mass Shift [GeV/c^{2}]", 2, -0.8,
1225 TH1F* h_upsilon_invmass_vs_eta_eca =
new TH1F(
"Upsilon_invmass_vs_eta_eca",
1226 "Upsilon invmass-PDGmass vs. Upsilon eta (endcap A); #eta(#Upsilon); Mass Shift [GeV/c^{2}]", 3, 0.8,
1228 TH1F* h_upsilon_invmass_vs_eta_ecc =
new TH1F(
"Upsilon_invmass_vs_eta_ecc",
1229 "Upsilon invmass-PDGmass vs. Upsilon eta (endcap C); #eta(#Upsilon); Mass Shift [GeV/c^{2}]", 3, -3.2,
1231 TH1F* h_upsilon_invmass_vs_etaplus =
new TH1F(
"Upsilon_invmass_vs_etaplus",
1232 "Upsilon invmass-PDGmass vs. Muon+ eta; #eta(#mu^{+}); Mass Shift [GeV/c^{2}]", 6, -2.4,
1234 TH1F* h_upsilon_invmass_vs_etaminus =
new TH1F(
"Upsilon_invmass_vs_etaminus",
1235 "Upsilon invmass-PDGmass vs. Muon- eta; #eta(#mu^{-}); Mass Shift [GeV/c^{2}]", 6, -2.4,
1237 TH1F* h_upsilon_invmass_vs_maxeta =
new TH1F(
"Upsilon_invmass_vs_maxeta",
1238 "Upsilon invmass-PDGmass vs. max Muon |eta|; max|#eta(#mu)|; Mass Shift [GeV/c^{2}]", 6, -2.4,
1240 TH1F* h_upsilon_invmass_vs_etadiff =
new TH1F(
"Upsilon_invmass_vs_etadiff",
1241 "Upsilon invmass-PDGmass vs. eta(+)-eta(-); #eta(#mu^{+})-#eta(#mu^{-}); Mass Shift [GeV/c^{2}]", 6, -1.5,
1243 TH1F* h_upsilon_invmass_vs_crt =
new TH1F(
"Upsilon_invmass_vs_curvature",
1244 "Upsilon invmass-PDGmass vs. crt(+)-|crt(-)|; 1/p_{T}(#mu^{+})-1/p_{T}(#mu^{-}) [GeV^{-1}]; Mass Shift [GeV/c^{2}]", 6, -0.15,
1246 TH1F* h_upsilon_invmass_vs_invpt =
new TH1F(
"Upsilon_invmass_vs_invpt",
1247 "Upsilon invmass-PDGmass vs. muon 1/Pt; 1/p_{T}(#mu) [(GeV/c)^{-1}]; Mass Shift [GeV/c^{2}]", 6, 0.05,
1249 TH1F* h_upsilon_invmass_vs_angle_eta =
new TH1F(
"Upsilon_invmass_vs_angle_eta",
1250 "Upsilon invmass-PDGmass vs. arccos(#Delta#eta/#DeltaR);arccos(#Delta#eta/#DeltaR); Mass Shift [GeV/c^{2}]", 6, 0.,
1253 TH1F* h_upsilon_width_vs_pt =
new TH1F(
"Upsilon_width_vs_pt",
1254 "Upsilon width vs. Upsilon Pt; p_{T}(#Upsilon) [GeV/c]; Width [GeV/c^{2}]",
1256 TH1F* h_upsilon_width_vs_z0 =
new TH1F(
"Upsilon_width_vs_z0",
1257 "Upsilon width vs. muon z0; z0(#mu) [mm]; Width [GeV/c^{2}]", 6, -100.,
1259 TH1F* h_upsilon_width_vs_phi =
new TH1F(
"Upsilon_width_vs_phi",
1260 "Upsilon width vs. Upsilon phi; #phi(#Upsilon) [rad]; Width [GeV/c^{2}]", 6,
1262 TH1F* h_upsilon_width_vs_phiplus =
new TH1F(
"Upsilon_width_vs_phiplus",
1263 "Upsilon width vs. Muon+ phi; #phi(#mu^{+}) [rad]; Width [GeV/c^{2}]",
1265 TH1F* h_upsilon_width_vs_phiminus =
new TH1F(
"Upsilon_width_vs_phiminus",
1266 "Upsilon width vs. Muon- phi; #phi(#mu^{-}) [rad]; Width [GeV/c^{2}]",
1268 TH1F* h_upsilon_width_vs_phidiff =
new TH1F(
"Upsilon_width_vs_phidiff",
1269 "Upsilon width vs. |phi(+)-phi(-)|; |#phi(#mu^{+})-#phi(#mu^{-})| [rad]; Width [GeV/c^{2}]", 6, 0.,
1271 TH1F* h_upsilon_width_vs_eta =
new TH1F(
"Upsilon_width_vs_eta",
1272 "Upsilon width vs. Upsilon eta; #eta(#Upsilon); Width [GeV/c^{2}]", 8, -3.2,
1274 TH1F* h_upsilon_width_vs_eta_barrel =
new TH1F(
"Upsilon_width_vs_eta_barrel",
1275 "Upsilon width vs. Upsilon eta (barrel); #eta(#Upsilon); Width [GeV/c^{2}]", 2, -0.8,
1277 TH1F* h_upsilon_width_vs_eta_eca =
new TH1F(
"Upsilon_width_vs_eta_eca",
1278 "Upsilon width vs. Upsilon eta (endcap A); #eta(#Upsilon); Width [GeV/c^{2}]", 3, 0.8,
1280 TH1F* h_upsilon_width_vs_eta_ecc =
new TH1F(
"Upsilon_width_vs_eta_ecc",
1281 "Upsilon width vs. Upsilon eta (endcap C); #eta(#Upsilon); Width [GeV/c^{2}]", 3, -3.2,
1283 TH1F* h_upsilon_width_vs_etaplus =
new TH1F(
"Upsilon_width_vs_etaplus",
1284 "Upsilon width vs. Muon+ eta; #eta(#mu^{+}); Width [GeV/c^{2}]", 6,
1286 TH1F* h_upsilon_width_vs_etaminus =
new TH1F(
"Upsilon_width_vs_etaminus",
1287 "Upsilon width vs. Muon- eta; #eta(#mu^{-}); Width [GeV/c^{2}]", 6,
1289 TH1F* h_upsilon_width_vs_maxeta =
new TH1F(
"Upsilon_width_vs_maxeta",
1290 "Upsilon width vs. max Muon |eta|; max|#eta(#mu)|; Width [GeV/c^{2}]", 6,
1292 TH1F* h_upsilon_width_vs_etadiff =
new TH1F(
"Upsilon_width_vs_etadiff",
1293 "Upsilon width vs. eta(+)-eta(-); #eta(#mu^{+})-#eta(#mu^{-}); Width [GeV/c^{2}]", 6, -1.5,
1295 TH1F* h_upsilon_width_vs_crt =
new TH1F(
"Upsilon_width_vs_curvature",
1296 "Upsilon width vs. crt(+)-|crt(-)|; 1/p_{T}(#mu^{+})-1/p_{T}(#mu^{-}) [GeV^{-1}]; Width [GeV/c^{2}]", 6, -0.15,
1298 TH1F* h_upsilon_width_vs_invpt =
new TH1F(
"Upsilon_width_vs_invpt",
1299 "Upsilon width vs. muon 1/Pt; 1/p_{T}(#mu) [(GeV/c)^{-1}]; Width [GeV/c^{2}]", 6, 0.05,
1301 TH1F* h_upsilon_width_vs_angle_eta =
new TH1F(
"Upsilon_width_vs_angle_eta",
1302 "Upsilon width vs. arccos(#Delta#eta/#DeltaR);arccos(#Delta#eta/#DeltaR); width [GeV/c^{2}]", 6, 0.,
1305 const int nbins = 6;
1326 TH1F* h_mass = (
TH1F*) (
f->Get((
path +
"/Upsilon_invmass").c_str())->Clone());
1328 TH1F* h_Nevents = (
TH1F*)
f->Get((
path +
"/Nevents").c_str());
1329 TH1F* h_rate =
new TH1F(
"rate",
"production rate", 1, 0, 1);
1330 double Ntot = h_Nevents->GetEntries();
1331 double yield = h_mass->Integral(h_mass->FindBin(9.1), h_mass->FindBin(9.8));
1332 double rate = yield / Ntot;
1333 double rate_error = sqrt(1 / yield + 1 / Ntot) * yield / Ntot;
1334 h_rate->SetBinContent(1, rate);
1335 h_rate->SetBinError(1, rate_error);
1336 h_rate->Write(
"", TObject::kOverwrite);
1352 TH1F* h_mass_rebin = (
TH1F*) (
f->Get((
path +
"/Upsilon_invmass").c_str())->Clone(
"Upsilon_invmass_rebin"));
1353 TString
title = h_mass_rebin->GetTitle();
1354 h_mass_rebin->SetMarkerStyle(21);
1355 h_mass_rebin->Rebin(8);
1356 h_mass_rebin->SetTitle(
title +
" (larger binning for low Stats.)");
1357 h_mass_rebin->Write(
"Upsilon_invmass_rebin", TObject::kOverwrite);
1360 char cpt[100], cz0[100], cphi[100], cphidiff[100], ceta[100], cetadiff[100], cmaxeta[100], ccrt[100], cinvpt[100],
1361 cphiplus[100], cphiminus[100], cetaplus[100], cetaminus[100], ceta_b[100], ceta_ecc[100], ceta_eca[100],
1365 sprintf(cpt, (
path +
"/pt_bin%d").c_str(),
i);
1366 sprintf(cz0, (
path +
"/z0_bin%d").c_str(),
i);
1367 sprintf(cphi, (
path +
"/phi_bin%d").c_str(),
i);
1368 sprintf(cphiplus, (
path +
"/phiplus_bin%d").c_str(),
i);
1369 sprintf(cphiminus, (
path +
"/phiminus_bin%d").c_str(),
i);
1370 sprintf(cphidiff, (
path +
"/phidiff_bin%d").c_str(),
i);
1371 sprintf(cetaplus, (
path +
"/etaplus_bin%d").c_str(),
i);
1372 sprintf(cetaminus, (
path +
"/etaminus_bin%d").c_str(),
i);
1373 sprintf(cmaxeta, (
path +
"/maxeta_bin%d").c_str(),
i);
1374 sprintf(cetadiff, (
path +
"/etadiff_bin%d").c_str(),
i);
1375 sprintf(ccrt, (
path +
"/crt_bin%d").c_str(),
i);
1376 sprintf(cinvpt, (
path +
"/invpt_bin%d").c_str(),
i);
1377 sprintf(cangle_eta, (
path +
"/angle_eta_bin%d").c_str(),
i);
1405 hpt[
i] = (
TH1F*) (
f->Get(cpt)->Clone());
1406 hz0[
i] = (
TH1F*) (
f->Get(cz0)->Clone());
1407 hphi[
i] = (
TH1F*) (
f->Get(cphi)->Clone());
1408 hphiplus[
i] = (
TH1F*) (
f->Get(cphiplus)->Clone());
1409 hphiminus[
i] = (
TH1F*) (
f->Get(cphiminus)->Clone());
1410 hphidiff[
i] = (
TH1F*) (
f->Get(cphidiff)->Clone());
1411 hetaplus[
i] = (
TH1F*) (
f->Get(cetaplus)->Clone());
1412 hetaminus[
i] = (
TH1F*) (
f->Get(cetaminus)->Clone());
1413 hetadiff[
i] = (
TH1F*) (
f->Get(cetadiff)->Clone());
1414 hmaxeta[
i] = (
TH1F*) (
f->Get(cmaxeta)->Clone());
1415 hcrt[
i] = (
TH1F*) (
f->Get(ccrt)->Clone());
1416 hinvpt[
i] = (
TH1F*) (
f->Get(cinvpt)->Clone());
1417 hangle_eta[
i] = (
TH1F*) (
f->Get(cangle_eta)->Clone());
1420 sprintf(ceta_b, (
path +
"/eta_b_bin%d").c_str(),
i);
1423 heta_b[
i] = (
TH1F*) (
f->Get(ceta_b)->Clone());
1426 sprintf(ceta_ecc, (
path +
"/eta_ecc_bin%d").c_str(),
i);
1427 sprintf(ceta_eca, (
path +
"/eta_eca_bin%d").c_str(),
i);
1432 heta_ecc[
i] = (
TH1F*) (
f->Get(ceta_ecc)->Clone());
1433 heta_eca[
i] = (
TH1F*) (
f->Get(ceta_eca)->Clone());
1436 for (
int i = 0;
i < 8;
i++) {
1437 sprintf(ceta, (
path +
"/eta_bin%d").c_str(),
i);
1440 heta[
i] = (
TH1F*) (
f->Get(ceta)->Clone());
1448 h_mass->SetMarkerStyle(21);
1450 TCanvas* myCanvas =
new TCanvas(
"MyCanvas");
1463 fitUpsilonHistograms(h_upsilon_invmass_vs_eta_barrel, h_upsilon_width_vs_eta_barrel, heta_b, 2);
1476 if (
f->cd(
path.c_str()) == 0) {
1482 h_mass->Write(
"", TObject::kOverwrite);
1484 hpt[
i]->Write(
"", TObject::kOverwrite);
1485 hz0[
i]->Write(
"", TObject::kOverwrite);
1486 hphi[
i]->Write(
"", TObject::kOverwrite);
1487 hphiplus[
i]->Write(
"", TObject::kOverwrite);
1488 hphiminus[
i]->Write(
"", TObject::kOverwrite);
1489 hphidiff[
i]->Write(
"", TObject::kOverwrite);
1490 hetadiff[
i]->Write(
"", TObject::kOverwrite);
1491 hmaxeta[
i]->Write(
"", TObject::kOverwrite);
1492 hinvpt[
i]->Write(
"", TObject::kOverwrite);
1493 hcrt[
i]->Write(
"", TObject::kOverwrite);
1494 hetaplus[
i]->Write(
"", TObject::kOverwrite);
1495 hetaminus[
i]->Write(
"", TObject::kOverwrite);
1496 hangle_eta[
i]->Write(
"", TObject::kOverwrite);
1498 heta_b[
i]->Write(
"", TObject::kOverwrite);
1501 heta_ecc[
i]->Write(
"", TObject::kOverwrite);
1502 heta_eca[
i]->Write(
"", TObject::kOverwrite);
1505 for (
int i = 0;
i < 8;
i++) {
1506 heta[
i]->Write(
"", TObject::kOverwrite);
1508 h_upsilon_invmass_vs_pt->Write(
"", TObject::kOverwrite);
1509 h_upsilon_invmass_vs_z0->Write(
"", TObject::kOverwrite);
1510 h_upsilon_invmass_vs_phi->Write(
"", TObject::kOverwrite);
1511 h_upsilon_invmass_vs_phiplus->Write(
"", TObject::kOverwrite);
1512 h_upsilon_invmass_vs_phiminus->Write(
"", TObject::kOverwrite);
1513 h_upsilon_invmass_vs_phidiff->Write(
"", TObject::kOverwrite);
1514 h_upsilon_invmass_vs_eta->Write(
"", TObject::kOverwrite);
1515 h_upsilon_invmass_vs_eta_barrel->Write(
"", TObject::kOverwrite);
1516 h_upsilon_invmass_vs_eta_ecc->Write(
"", TObject::kOverwrite);
1517 h_upsilon_invmass_vs_eta_eca->Write(
"", TObject::kOverwrite);
1518 h_upsilon_invmass_vs_etadiff->Write(
"", TObject::kOverwrite);
1519 h_upsilon_invmass_vs_etaplus->Write(
"", TObject::kOverwrite);
1520 h_upsilon_invmass_vs_etaminus->Write(
"", TObject::kOverwrite);
1521 h_upsilon_invmass_vs_maxeta->Write(
"", TObject::kOverwrite);
1522 h_upsilon_invmass_vs_crt->Write(
"", TObject::kOverwrite);
1523 h_upsilon_invmass_vs_invpt->Write(
"", TObject::kOverwrite);
1524 h_upsilon_invmass_vs_angle_eta->Write(
"", TObject::kOverwrite);
1526 h_upsilon_width_vs_pt->Write(
"", TObject::kOverwrite);
1527 h_upsilon_width_vs_z0->Write(
"", TObject::kOverwrite);
1528 h_upsilon_width_vs_phi->Write(
"", TObject::kOverwrite);
1529 h_upsilon_width_vs_phiplus->Write(
"", TObject::kOverwrite);
1530 h_upsilon_width_vs_phiminus->Write(
"", TObject::kOverwrite);
1531 h_upsilon_width_vs_phidiff->Write(
"", TObject::kOverwrite);
1532 h_upsilon_width_vs_eta->Write(
"", TObject::kOverwrite);
1533 h_upsilon_width_vs_eta_barrel->Write(
"", TObject::kOverwrite);
1534 h_upsilon_width_vs_eta_ecc->Write(
"", TObject::kOverwrite);
1535 h_upsilon_width_vs_eta_eca->Write(
"", TObject::kOverwrite);
1536 h_upsilon_width_vs_etadiff->Write(
"", TObject::kOverwrite);
1537 h_upsilon_width_vs_etaplus->Write(
"", TObject::kOverwrite);
1538 h_upsilon_width_vs_etaminus->Write(
"", TObject::kOverwrite);
1539 h_upsilon_width_vs_maxeta->Write(
"", TObject::kOverwrite);
1540 h_upsilon_width_vs_crt->Write(
"", TObject::kOverwrite);
1541 h_upsilon_width_vs_invpt->Write(
"", TObject::kOverwrite);
1542 h_upsilon_width_vs_angle_eta->Write(
"", TObject::kOverwrite);
1556 path = run_dir +
"IDPerfMon/Zee/" + TriggerName;
1557 if (
f->cd(
path.c_str()) == 0) {
1563 f->cd(
path.c_str());
1567 TH1F* h_mass = (
TH1F*) (
f->Get((
path +
"/Zee_invmass").c_str())->Clone());
1569 TH1F* h_Nevents = (
TH1F*)
f->Get((
path +
"/Nevents").c_str());
1570 TH1F* h_rate =
new TH1F(
"rate",
"production rate", 1, 0, 1);
1571 double Ntot = h_Nevents->GetEntries();
1572 double yield = h_mass->Integral(h_mass->FindBin(80), h_mass->FindBin(105));
1573 double rate = yield / Ntot;
1574 double rate_error = sqrt(1 / yield + 1 / Ntot) * yield / Ntot;
1575 h_rate->SetBinContent(1, rate);
1576 h_rate->SetBinError(1, rate_error);
1577 h_rate->Write(
"", TObject::kOverwrite);
1593 incl, barrel, eca, ecc, Nregions
1595 std::vector<std::string> region_strings;
1596 region_strings.push_back(
"incl");
1597 region_strings.push_back(
"barrel");
1598 region_strings.push_back(
"eca");
1599 region_strings.push_back(
"ecc");
1601 std::vector<TH1F*> h_Zee_Eopdiff;
1602 std::vector<TH1F*> h_Zee_Eop_plus;
1603 std::vector<TH1F*> h_Zee_Eop_minus;
1605 std::vector<TProfile*> h_Zee_Eopdiff_vs_p;
1606 std::vector<TProfile*> h_Zee_meanEop_vs_p_plus;
1607 std::vector<TProfile*> h_Zee_meanEop_vs_p_minus;
1609 std::vector<TProfile*> h_Zee_Eopdiff_vs_invp;
1610 std::vector<TProfile*> h_Zee_meanEop_vs_invp_plus;
1611 std::vector<TProfile*> h_Zee_meanEop_vs_invp_minus;
1613 std::vector<TProfile*> h_Zee_Eopdiff_vs_E;
1614 std::vector<TProfile*> h_Zee_meanEop_vs_E_plus;
1615 std::vector<TProfile*> h_Zee_meanEop_vs_E_minus;
1617 std::vector<TProfile*> h_Zee_Eopdiff_vs_phi;
1618 std::vector<TProfile*> h_Zee_meanEop_vs_phi_plus;
1619 std::vector<TProfile*> h_Zee_meanEop_vs_phi_minus;
1621 std::vector<TProfile*> h_Zee_Eopdiff_vs_eta;
1622 std::vector<TProfile*> h_Zee_meanEop_vs_eta_plus;
1623 std::vector<TProfile*> h_Zee_meanEop_vs_eta_minus;
1627 for (
int region = 0; region != Nregions; ++region) {
1628 str =
path +
"/Zee_Eop_plus_" + region_strings[region];
1631 h_Zee_Eop_plus.push_back((
TH1F*) (
f->Get(
str.c_str())));
1632 h_Zee_Eop_plus[region]->SetTitle(h_Zee_Eop_plus[region]->GetTitle());
1633 str =
path +
"/Zee_Eop_minus_" + region_strings[region];
1636 h_Zee_Eop_minus.push_back((
TH1F*) (
f->Get(
str.c_str())));
1637 h_Zee_Eop_minus[region]->SetTitle(h_Zee_Eop_minus[region]->GetTitle());
1638 str =
path +
"/Zee_Eopdiff_" + region_strings[region];
1641 h_Zee_Eopdiff.push_back((
TH1F*) (
f->Get(
str.c_str())));
1642 h_Zee_Eopdiff[region]->SetTitle(h_Zee_Eopdiff[region]->GetTitle());
1644 h_Zee_Eopdiff[region]->Add(h_Zee_Eop_plus[region], h_Zee_Eop_minus[region], 1., -1);
1646 if (region == incl) {
1647 str =
path +
"/Zee_meanEop_vs_p_plus";
1650 h_Zee_meanEop_vs_p_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1651 h_Zee_meanEop_vs_p_plus[region]->SetTitle(h_Zee_meanEop_vs_p_plus[region]->GetTitle());
1652 str =
path +
"/Zee_meanEop_vs_p_minus";
1655 h_Zee_meanEop_vs_p_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1656 h_Zee_meanEop_vs_p_minus[region]->SetTitle(h_Zee_meanEop_vs_p_minus[region]->GetTitle());
1657 str =
path +
"/Zee_Eopdiff_vs_p";
1660 h_Zee_Eopdiff_vs_p.push_back((
TProfile*) (
f->Get(
str.c_str())));
1661 h_Zee_Eopdiff_vs_p[region]->SetTitle(h_Zee_Eopdiff_vs_p[region]->GetTitle());
1663 str =
path +
"/Zee_meanEop_vs_invp_plus";
1666 h_Zee_meanEop_vs_invp_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1667 h_Zee_meanEop_vs_invp_plus[region]->SetTitle(h_Zee_meanEop_vs_invp_plus[region]->GetTitle());
1668 str =
path +
"/Zee_meanEop_vs_invp_minus";
1671 h_Zee_meanEop_vs_invp_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1672 h_Zee_meanEop_vs_invp_minus[region]->SetTitle(h_Zee_meanEop_vs_invp_minus[region]->GetTitle());
1673 str =
path +
"/Zee_Eopdiff_vs_invp";
1676 h_Zee_Eopdiff_vs_invp.push_back((
TProfile*) (
f->Get(
str.c_str())));
1677 h_Zee_Eopdiff_vs_invp[region]->SetTitle(h_Zee_Eopdiff_vs_invp[region]->GetTitle());
1679 str =
path +
"/Zee_meanEop_vs_E_plus";
1682 h_Zee_meanEop_vs_E_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1683 h_Zee_meanEop_vs_E_plus[region]->SetTitle(h_Zee_meanEop_vs_E_plus[region]->GetTitle());
1684 str =
path +
"/Zee_meanEop_vs_E_minus";
1687 h_Zee_meanEop_vs_E_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1688 h_Zee_meanEop_vs_E_minus[region]->SetTitle(h_Zee_meanEop_vs_E_minus[region]->GetTitle());
1689 str =
path +
"/Zee_Eopdiff_vs_E";
1692 h_Zee_Eopdiff_vs_E.push_back((
TProfile*) (
f->Get(
str.c_str())));
1693 h_Zee_Eopdiff_vs_E[region]->SetTitle(h_Zee_Eopdiff_vs_E[region]->GetTitle());
1695 str =
path +
"/Zee_meanEop_vs_phi_plus";
1698 h_Zee_meanEop_vs_phi_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1699 h_Zee_meanEop_vs_phi_plus[region]->SetTitle(h_Zee_meanEop_vs_phi_plus[region]->GetTitle());
1700 str =
path +
"/Zee_meanEop_vs_phi_minus";
1703 h_Zee_meanEop_vs_phi_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1704 h_Zee_meanEop_vs_phi_minus[region]->SetTitle(h_Zee_meanEop_vs_phi_minus[region]->GetTitle());
1705 str =
path +
"/Zee_Eopdiff_vs_phi";
1708 h_Zee_Eopdiff_vs_phi.push_back((
TProfile*) (
f->Get(
str.c_str())));
1709 h_Zee_Eopdiff_vs_phi[region]->SetTitle(h_Zee_Eopdiff_vs_phi[region]->GetTitle());
1711 str =
path +
"/Zee_meanEop_vs_eta_plus";
1714 h_Zee_meanEop_vs_eta_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1715 h_Zee_meanEop_vs_eta_plus[region]->SetTitle(h_Zee_meanEop_vs_eta_plus[region]->GetTitle());
1716 str =
path +
"/Zee_meanEop_vs_eta_minus";
1719 h_Zee_meanEop_vs_eta_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1720 h_Zee_meanEop_vs_eta_minus[region]->SetTitle(h_Zee_meanEop_vs_eta_minus[region]->GetTitle());
1721 str =
path +
"/Zee_Eopdiff_vs_eta";
1724 h_Zee_Eopdiff_vs_eta.push_back((
TProfile*) (
f->Get(
str.c_str())));
1725 h_Zee_Eopdiff_vs_eta[region]->SetTitle(h_Zee_Eopdiff_vs_eta[region]->GetTitle());
1727 h_Zee_Eopdiff_vs_p[region]->Add(h_Zee_meanEop_vs_p_plus[region], h_Zee_meanEop_vs_p_minus[region], 1., -1);
1728 h_Zee_Eopdiff_vs_invp[region]->Add(h_Zee_meanEop_vs_invp_plus[region], h_Zee_meanEop_vs_invp_minus[region], 1.,
1730 h_Zee_Eopdiff_vs_E[region]->Add(h_Zee_meanEop_vs_E_plus[region], h_Zee_meanEop_vs_E_minus[region], 1., -1);
1731 h_Zee_Eopdiff_vs_phi[region]->Add(h_Zee_meanEop_vs_phi_plus[region], h_Zee_meanEop_vs_phi_minus[region], 1.,
1733 h_Zee_Eopdiff_vs_eta[region]->Add(h_Zee_meanEop_vs_eta_plus[region], h_Zee_meanEop_vs_eta_minus[region], 1.,
1738 for (
int region = 0; region != Nregions; ++region) {
1739 h_Zee_Eopdiff[region]->Write(
"", TObject::kOverwrite);
1740 if (region == incl) {
1741 h_Zee_Eopdiff_vs_p[region]->Write(
"", TObject::kOverwrite);
1742 h_Zee_Eopdiff_vs_invp[region]->Write(
"", TObject::kOverwrite);
1743 h_Zee_Eopdiff_vs_E[region]->Write(
"", TObject::kOverwrite);
1744 h_Zee_Eopdiff_vs_phi[region]->Write(
"", TObject::kOverwrite);
1745 h_Zee_Eopdiff_vs_eta[region]->Write(
"", TObject::kOverwrite);
1756 path = run_dir +
"IDPerfMon/Wenu/" + TriggerName;
1757 if (
f->cd(
path.c_str()) == 0) {
1763 f->cd(
path.c_str());
1767 TH1F* h_mass = (
TH1F*) (
f->Get((
path +
"/Wenu_trk_transmass_sel").c_str())->Clone());
1769 TH1F* h_Nevents = (
TH1F*)
f->Get((
path +
"/Nevents").c_str());
1770 TH1F* h_rate =
new TH1F(
"rate",
"production rate", 1, 0, 1);
1771 double Ntot = h_Nevents->GetEntries();
1772 double yield = h_mass->Integral(h_mass->FindBin(50), h_mass->FindBin(80));
1773 double rate = yield / Ntot;
1774 double rate_error = sqrt(1 / yield + 1 / Ntot) * yield / Ntot;
1775 h_rate->SetBinContent(1, rate);
1776 h_rate->SetBinError(1, rate_error);
1777 h_rate->Write(
"", TObject::kOverwrite);
1794 incl, barrel, eca, ecc, Nregions
1796 std::vector<std::string> region_strings;
1797 region_strings.push_back(
"incl");
1798 region_strings.push_back(
"barrel");
1799 region_strings.push_back(
"eca");
1800 region_strings.push_back(
"ecc");
1802 std::vector<TH1F*> h_Wenu_Eopdiff;
1803 std::vector<TH1F*> h_Wenu_Eop_plus;
1804 std::vector<TH1F*> h_Wenu_Eop_minus;
1806 std::vector<TProfile*> h_Wenu_Eopdiff_vs_p;
1807 std::vector<TProfile*> h_Wenu_meanEop_vs_p_plus;
1808 std::vector<TProfile*> h_Wenu_meanEop_vs_p_minus;
1810 std::vector<TProfile*> h_Wenu_Eopdiff_vs_invp;
1811 std::vector<TProfile*> h_Wenu_meanEop_vs_invp_plus;
1812 std::vector<TProfile*> h_Wenu_meanEop_vs_invp_minus;
1814 std::vector<TProfile*> h_Wenu_Eopdiff_vs_E;
1815 std::vector<TProfile*> h_Wenu_meanEop_vs_E_plus;
1816 std::vector<TProfile*> h_Wenu_meanEop_vs_E_minus;
1818 std::vector<TProfile*> h_Wenu_Eopdiff_vs_phi;
1819 std::vector<TProfile*> h_Wenu_meanEop_vs_phi_plus;
1820 std::vector<TProfile*> h_Wenu_meanEop_vs_phi_minus;
1822 std::vector<TProfile*> h_Wenu_Eopdiff_vs_eta;
1823 std::vector<TProfile*> h_Wenu_meanEop_vs_eta_plus;
1824 std::vector<TProfile*> h_Wenu_meanEop_vs_eta_minus;
1828 for (
int region = 0; region != Nregions; ++region) {
1829 str =
path +
"/Wenu_Eop_plus_" + region_strings[region];
1832 h_Wenu_Eop_plus.push_back((
TH1F*) (
f->Get(
str.c_str())));
1833 h_Wenu_Eop_plus[region]->SetTitle(h_Wenu_Eop_plus[region]->GetTitle());
1834 str =
path +
"/Wenu_Eop_minus_" + region_strings[region];
1837 h_Wenu_Eop_minus.push_back((
TH1F*) (
f->Get(
str.c_str())));
1838 h_Wenu_Eop_minus[region]->SetTitle(h_Wenu_Eop_minus[region]->GetTitle());
1839 str =
path +
"/Wenu_Eopdiff_" + region_strings[region];
1842 h_Wenu_Eopdiff.push_back((
TH1F*) (
f->Get(
str.c_str())));
1843 h_Wenu_Eopdiff[region]->SetTitle(h_Wenu_Eopdiff[region]->GetTitle());
1845 h_Wenu_Eopdiff[region]->Add(h_Wenu_Eop_plus[region], h_Wenu_Eop_minus[region], 1., -1);
1847 if (region == incl) {
1848 str =
path +
"/Wenu_meanEop_vs_p_plus";
1851 h_Wenu_meanEop_vs_p_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1852 h_Wenu_meanEop_vs_p_plus[region]->SetTitle(h_Wenu_meanEop_vs_p_plus[region]->GetTitle());
1853 str =
path +
"/Wenu_meanEop_vs_p_minus";
1856 h_Wenu_meanEop_vs_p_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1857 h_Wenu_meanEop_vs_p_minus[region]->SetTitle(h_Wenu_meanEop_vs_p_minus[region]->GetTitle());
1858 str =
path +
"/Wenu_Eopdiff_vs_p";
1861 h_Wenu_Eopdiff_vs_p.push_back((
TProfile*) (
f->Get(
str.c_str())));
1862 h_Wenu_Eopdiff_vs_p[region]->SetTitle(h_Wenu_Eopdiff_vs_p[region]->GetTitle());
1864 str =
path +
"/Wenu_meanEop_vs_invp_plus";
1867 h_Wenu_meanEop_vs_invp_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1868 h_Wenu_meanEop_vs_invp_plus[region]->SetTitle(h_Wenu_meanEop_vs_invp_plus[region]->GetTitle());
1869 str =
path +
"/Wenu_meanEop_vs_invp_minus";
1872 h_Wenu_meanEop_vs_invp_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1873 h_Wenu_meanEop_vs_invp_minus[region]->SetTitle(h_Wenu_meanEop_vs_invp_minus[region]->GetTitle());
1874 str =
path +
"/Wenu_Eopdiff_vs_invp";
1877 h_Wenu_Eopdiff_vs_invp.push_back((
TProfile*) (
f->Get(
str.c_str())));
1878 h_Wenu_Eopdiff_vs_invp[region]->SetTitle(h_Wenu_Eopdiff_vs_invp[region]->GetTitle());
1880 str =
path +
"/Wenu_meanEop_vs_E_plus";
1883 h_Wenu_meanEop_vs_E_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1884 h_Wenu_meanEop_vs_E_plus[region]->SetTitle(h_Wenu_meanEop_vs_E_plus[region]->GetTitle());
1885 str =
path +
"/Wenu_meanEop_vs_E_minus";
1888 h_Wenu_meanEop_vs_E_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1889 h_Wenu_meanEop_vs_E_minus[region]->SetTitle(h_Wenu_meanEop_vs_E_minus[region]->GetTitle());
1890 str =
path +
"/Wenu_Eopdiff_vs_E";
1893 h_Wenu_Eopdiff_vs_E.push_back((
TProfile*) (
f->Get(
str.c_str())));
1894 h_Wenu_Eopdiff_vs_E[region]->SetTitle(h_Wenu_Eopdiff_vs_E[region]->GetTitle());
1896 str =
path +
"/Wenu_meanEop_vs_phi_plus";
1899 h_Wenu_meanEop_vs_phi_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1900 h_Wenu_meanEop_vs_phi_plus[region]->SetTitle(h_Wenu_meanEop_vs_phi_plus[region]->GetTitle());
1901 str =
path +
"/Wenu_meanEop_vs_phi_minus";
1904 h_Wenu_meanEop_vs_phi_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1905 h_Wenu_meanEop_vs_phi_minus[region]->SetTitle(h_Wenu_meanEop_vs_phi_minus[region]->GetTitle());
1906 str =
path +
"/Wenu_Eopdiff_vs_phi";
1909 h_Wenu_Eopdiff_vs_phi.push_back((
TProfile*) (
f->Get(
str.c_str())));
1910 h_Wenu_Eopdiff_vs_phi[region]->SetTitle(h_Wenu_Eopdiff_vs_phi[region]->GetTitle());
1912 str =
path +
"/Wenu_meanEop_vs_eta_plus";
1915 h_Wenu_meanEop_vs_eta_plus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1916 h_Wenu_meanEop_vs_eta_plus[region]->SetTitle(h_Wenu_meanEop_vs_eta_plus[region]->GetTitle());
1917 str =
path +
"/Wenu_meanEop_vs_eta_minus";
1920 h_Wenu_meanEop_vs_eta_minus.push_back((
TProfile*) (
f->Get(
str.c_str())));
1921 h_Wenu_meanEop_vs_eta_minus[region]->SetTitle(h_Wenu_meanEop_vs_eta_minus[region]->GetTitle());
1922 str =
path +
"/Wenu_Eopdiff_vs_eta";
1925 h_Wenu_Eopdiff_vs_eta.push_back((
TProfile*) (
f->Get(
str.c_str())));
1926 h_Wenu_Eopdiff_vs_eta[region]->SetTitle(h_Wenu_Eopdiff_vs_eta[region]->GetTitle());
1928 h_Wenu_Eopdiff_vs_p[region]->Add(h_Wenu_meanEop_vs_p_plus[region], h_Wenu_meanEop_vs_p_minus[region], 1., -1);
1929 h_Wenu_Eopdiff_vs_invp[region]->Add(h_Wenu_meanEop_vs_invp_plus[region], h_Wenu_meanEop_vs_invp_minus[region],
1931 h_Wenu_Eopdiff_vs_E[region]->Add(h_Wenu_meanEop_vs_E_plus[region], h_Wenu_meanEop_vs_E_minus[region], 1., -1);
1932 h_Wenu_Eopdiff_vs_phi[region]->Add(h_Wenu_meanEop_vs_phi_plus[region], h_Wenu_meanEop_vs_phi_minus[region], 1.,
1934 h_Wenu_Eopdiff_vs_eta[region]->Add(h_Wenu_meanEop_vs_eta_plus[region], h_Wenu_meanEop_vs_eta_minus[region], 1.,
1939 for (
int region = 0; region != Nregions; ++region) {
1940 h_Wenu_Eopdiff[region]->Write(
"", TObject::kOverwrite);
1941 if (region == incl) {
1942 h_Wenu_Eopdiff_vs_p[region]->Write(
"", TObject::kOverwrite);
1943 h_Wenu_Eopdiff_vs_invp[region]->Write(
"", TObject::kOverwrite);
1944 h_Wenu_Eopdiff_vs_E[region]->Write(
"", TObject::kOverwrite);
1945 h_Wenu_Eopdiff_vs_phi[region]->Write(
"", TObject::kOverwrite);
1946 h_Wenu_Eopdiff_vs_eta[region]->Write(
"", TObject::kOverwrite);
1957 std::vector<TH1F*> hvec;
1958 gROOT->SetStyle(
"Plain");
1960 path = run_dir +
"IDPerfMon/ZMM/" + TriggerName;
1962 if (
f->cd(
path.c_str()) == 0) {
1967 f->cd(
path.c_str());
1972 TH1F* h_ZMass_CB_Shift_vs_Regions =
new TH1F(
"Z_Mass_CB_Shift_vs_Regions",
"Z_Mass_CB Shift vs. Regions", 4, 0.5,
1974 TH1F* h_ZMass_CB_Width_vs_Regions =
new TH1F(
"Z_Mass_CB_Width_vs_Regions",
"Z_Mass_CB Width vs. Regions", 4, 0.5,
1982 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_CB_All").c_str())->Clone()));
1983 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_CB_BB").c_str())->Clone()));
1984 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_CB_BE").c_str())->Clone()));
1985 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_CB_EE").c_str())->Clone()));
1988 h_ZMass_CB_Shift_vs_Regions->SetStats(0);
1989 h_ZMass_CB_Width_vs_Regions->SetStats(0);
1990 h_ZMass_CB_Shift_vs_Regions->Write(
"", TObject::kOverwrite);
1991 h_ZMass_CB_Width_vs_Regions->Write(
"", TObject::kOverwrite);
1994 TH1F* h_ZMass_ID_Shift_vs_Regions =
new TH1F(
"Z_Mass_ID_Shift_vs_Regions",
"Z_Mass_ID Shift vs. Regions", 4, 0.5,
1996 TH1F* h_ZMass_ID_Width_vs_Regions =
new TH1F(
"Z_Mass_ID_Width_vs_Regions",
"Z_Mass_ID Width vs. Regions", 4, 0.5,
2004 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ID_All").c_str())->Clone()));
2005 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ID_BB").c_str())->Clone()));
2006 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ID_BE").c_str())->Clone()));
2007 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ID_EE").c_str())->Clone()));
2010 h_ZMass_ID_Shift_vs_Regions->SetStats(0);
2011 h_ZMass_ID_Width_vs_Regions->SetStats(0);
2012 h_ZMass_ID_Shift_vs_Regions->Write(
"", TObject::kOverwrite);
2013 h_ZMass_ID_Width_vs_Regions->Write(
"", TObject::kOverwrite);
2016 TH1F* h_ZMass_ME_Shift_vs_Regions =
new TH1F(
"Z_Mass_ME_Shift_vs_Regions",
"Z_Mass_ME Shift vs. Regions", 4, 0.5,
2018 TH1F* h_ZMass_ME_Width_vs_Regions =
new TH1F(
"Z_Mass_ME_Width_vs_Regions",
"Z_Mass_ME Width vs. Regions", 4, 0.5,
2026 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ME_All").c_str())->Clone()));
2027 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ME_BB").c_str())->Clone()));
2028 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ME_BE").c_str())->Clone()));
2029 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_ME_EE").c_str())->Clone()));
2032 h_ZMass_ME_Shift_vs_Regions->SetStats(0);
2033 h_ZMass_ME_Width_vs_Regions->SetStats(0);
2034 h_ZMass_ME_Shift_vs_Regions->Write(
"", TObject::kOverwrite);
2035 h_ZMass_ME_Width_vs_Regions->Write(
"", TObject::kOverwrite);
2038 TH1F* h_ZMass_MS_Shift_vs_Regions =
new TH1F(
"Z_Mass_MS_Shift_vs_Regions",
"Z_Mass_MS Shift vs. Regions", 4, 0.5,
2040 TH1F* h_ZMass_MS_Width_vs_Regions =
new TH1F(
"Z_Mass_MS_Width_vs_Regions",
"Z_Mass_MS Width vs. Regions", 4, 0.5,
2049 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_MS_All").c_str())->Clone()));
2050 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_MS_BB").c_str())->Clone()));
2051 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_MS_BE").c_str())->Clone()));
2052 hvec.push_back((
TH1F*) (
f->Get((
path +
"/Z_Mass_MS_EE").c_str())->Clone()));
2055 h_ZMass_MS_Shift_vs_Regions->SetStats(0);
2056 h_ZMass_MS_Width_vs_Regions->SetStats(0);
2057 h_ZMass_MS_Shift_vs_Regions->Write(
"", TObject::kOverwrite);
2058 h_ZMass_MS_Width_vs_Regions->Write(
"", TObject::kOverwrite);
2065 TH1F* h_ZMass_ID = (
TH1F*) (
f->Get((
path +
"/z-mass_trks").c_str())->Clone());
2066 h_ZMass_ID->SetTitle(
"Z Mass ID Tracks");
2072 TH1F* h_ZMass_CB = (
TH1F*) (
f->Get((
path +
"/z-mass_comb").c_str())->Clone());
2073 h_ZMass_CB->SetTitle(
"Z Mass CB Tracks");
2079 TH1F* h_Nevents = (
TH1F*)
f->Get((
path +
"/Nevents").c_str());
2080 TH1F* h_rate =
new TH1F(
"rate",
"production rate", 1, 0, 1);
2081 double Ntot = h_Nevents->GetEntries();
2082 double yield = h_ZMass_ID->Integral(h_ZMass_ID->FindBin(80), h_ZMass_ID->FindBin(105));
2083 double rate = yield / Ntot;
2084 double rate_error = sqrt(1 / yield + 1 / Ntot) * yield / Ntot;
2086 h_rate->SetBinContent(1, rate);
2087 h_rate->SetBinError(1, rate_error);
2088 h_rate->Write(
"rate", TObject::kOverwrite);
2097 double jpsiPDGmass = 3.097;
2099 double mass_error = 0;
2101 double width_error = 0;
2102 double maxmass = 0.;
2103 double maxwidth = 0.;
2104 double minwidth = 999;
2106 hmass->SetMarkerStyle(21);
2107 hwidth->SetMarkerStyle(21);
2110 TF1* fitjpsi =
new TF1(
"fitjpsi",
"gaus", 2.6, 3.6);
2112 fitjpsi->SetLineColor(2);
2113 for (
int i = 0;
i <
n;
i++) {
2114 int h1entries =
h1[
i]->GetEntries();
2115 if (h1entries > 50) {
2116 double mean =
h1[
i]->GetMean();
2117 double spread = 2 * (
h1[
i]->GetRMS());
2118 double constantGuess =
double(h1entries) / 10.;
2119 fitjpsi->SetParameters(constantGuess, jpsiPDGmass, 0.05);
2120 fitjpsi->SetRange(
mean - spread,
mean + spread);
2121 h1[
i]->Fit(
"fitjpsi",
"RQM");
2122 mean = fitjpsi->GetParameter(1);
2123 spread = 1.2 * (fitjpsi->GetParameter(2));
2124 fitjpsi->SetRange(
mean - spread,
mean + spread);
2125 h1[
i]->Fit(
"fitjpsi",
"RQM");
2126 h1[
i]->SetMarkerStyle(21);
2127 mass = fitjpsi->GetParameter(1) - jpsiPDGmass;
2128 mass_error = fitjpsi->GetParError(1);
2129 width = fitjpsi->GetParameter(2);
2130 width_error = fitjpsi->GetParError(2);
2131 hmass->SetBinContent(
i + 1,
mass);
2132 hmass->SetBinError(
i + 1, mass_error);
2133 hwidth->SetBinContent(
i + 1,
width);
2134 hwidth->SetBinError(
i + 1, width_error);
2135 if ((fabs(
mass) + mass_error) > maxmass) maxmass = fabs(
mass) + mass_error;
2136 if ((fabs(
width) + width_error) > maxwidth) maxwidth = fabs(
width) + width_error;
2137 if ((fabs(
width) - width_error) < minwidth) minwidth = fabs(
width) - width_error;
2140 if (maxmass > 0.1) maxmass = 0.1;
2141 if (maxwidth > 0.2) maxwidth = 0.2;
2142 if (minwidth < 0.) minwidth = 0.;
2143 hmass->SetAxisRange(-maxmass * 1.05, maxmass * 1.05,
"Y");
2145 if (minwidth < maxwidth) hwidth->SetAxisRange(minwidth * 0.9, maxwidth * 1.05,
"Y");
2153 double upsilonPDGmass = 9.46;
2155 double mass_error = 0;
2157 double width_error = 0;
2158 double maxmass = 0.;
2159 double maxwidth = 0.;
2160 double minwidth = 999;
2162 hmass->SetMarkerStyle(21);
2163 hwidth->SetMarkerStyle(21);
2166 TF1* fitupsi =
new TF1(
"fitupsi",
"gaus(0)+pol1(3)", 8.5, 10.5);
2167 fitupsi->SetParNames(
"Constant",
"Mean",
"Sigma",
"Constant",
"Slope");
2168 fitupsi->SetLineColor(2);
2169 for (
int i = 0;
i <
n;
i++) {
2171 double max =
h1[
i]->GetBinContent(
h1[
i]->GetMaximumBin());
2172 fitupsi->SetParameter(1, 9.46);
2173 fitupsi->SetParameter(2, 0.15);
2174 fitupsi->SetParLimits(1, 8., 11.);
2175 fitupsi->SetParLimits(2, 0., 0.5);
2176 fitupsi->SetParameter(0,
max);
2177 h1[
i]->SetMarkerStyle(21);
2178 h1[
i]->Fit(
"fitupsi",
"RQM");
2179 mass = fitupsi->GetParameter(1) - upsilonPDGmass;
2180 mass_error = fitupsi->GetParError(1);
2181 width = fitupsi->GetParameter(2);
2182 width_error = fitupsi->GetParError(2);
2183 hmass->SetBinContent(
i + 1,
mass);
2184 hmass->SetBinError(
i + 1, mass_error);
2185 hwidth->SetBinContent(
i + 1,
width);
2186 hwidth->SetBinError(
i + 1, width_error);
2187 if ((fabs(
mass) + mass_error) > maxmass) maxmass = fabs(
mass) + mass_error;
2188 if ((fabs(
width) + width_error) > maxwidth) maxwidth = fabs(
width) + width_error;
2189 if ((fabs(
width) - width_error) < minwidth) minwidth = fabs(
width) - width_error;
2192 if (maxmass > 0.1) maxmass = 0.1;
2193 if (maxwidth > 0.4) maxwidth = 0.4;
2194 if (minwidth < 0.) minwidth = 0.;
2195 hmass->SetAxisRange(-maxmass * 1.05, maxmass * 1.05,
"Y");
2196 if (minwidth < maxwidth) hwidth->SetAxisRange(minwidth * 0.9, maxwidth * 1.05,
"Y");
2202 const double ZPDGmass = 91.1876;
2203 const int size = (
int) hvec.size();
2205 for (
int i = 0;
i <
size;
i++) {
2211 hmass->SetBinContent(
i + 1,
mass);
2212 hmass->SetBinError(
i + 1, mass_err);
2213 hmass->GetXaxis()->SetBinLabel(
i + 1, hvec[
i]->GetName());
2214 hmass->GetXaxis()->SetTitle(
"Different Detector Regions");
2215 hmass->SetAxisRange(-3.0, 3.0,
"Y");
2217 hwidth->SetBinContent(
i + 1,
width);
2218 hwidth->SetBinError(
i + 1, width_err);
2219 hwidth->GetXaxis()->SetBinLabel(
i + 1, hvec[
i]->GetName());
2220 hwidth->GetXaxis()->SetTitle(
"Different Detector Regions");
2221 hwidth->SetAxisRange(0, 8,
"Y");
2227 RooAbsPdf::verboseEval(-100);
2228 RooRealVar
m(
"mass",
"dimuon invariable mass", 91.2, 60., 120.,
"GeV");
2229 RooDataHist*
data = 0;
2230 data =
new RooDataHist(
"data",
"data",
m, hmass);
2231 RooRealVar bwm0(
"bw_#mu",
"bw_#mu", 91.2, 85., 95.);
2232 RooRealVar bwsg(
"bw_#sigma",
"bw_#sigma", 2.4952);
2233 RooBreitWigner bw(
"bw",
"bw",
m, bwm0, bwsg);
2235 RooRealVar cbm0(
"cb_#mu",
"cb_#mu", 0);
2236 RooRealVar cbsg(
"cb_#sigma",
"cb_#sigma", 5., 0.1, 10.);
2237 RooRealVar cbal(
"cb_#alpha",
"cb_#alpha", 1.5, 0.1, 10.);
2238 RooRealVar cbn(
"cb_n",
"cb_n", 1.5, 0.01, 10.);
2239 RooCBShape cb(
"cb",
"cb",
m, cbm0, cbsg, cbal, cbn);
2242 RooFFTConvPdf bxc(
"bxc",
"BW (X) CB",
m, bw, cb);
2243 auto resourceToDelete = bxc.fitTo(*
data, RooFit::PrintLevel(-1), RooFit::PrintEvalErrors(-1), RooFit::Warnings(kFALSE));
2245 RooArgSet*
params = bxc.getVariables();
2247 RooRealVar* fit_bwm0 = (RooRealVar*)
params->find(
"bw_#mu");
2248 RooRealVar* fit_cbsg = (RooRealVar*)
params->find(
"cb_#sigma");
2253 delete resourceToDelete;
2254 return std::make_pair(*fit_bwm0, *fit_cbsg);
2260 RooAbsPdf::verboseEval(-100);
2261 RooRealVar
m(
"mass",
"dimuon invariable mass", 91.2, 60., 120.,
"GeV");
2262 RooDataHist*
data = 0;
2263 data =
new RooDataHist(
"data",
"data",
m, hmass);
2264 RooRealVar bwm0(
"bw_#mu",
"bw_#mu", 91.2, 85., 95.);
2265 RooRealVar bwsg(
"bw_#sigma",
"bw_#sigma", 2.4952);
2266 RooBreitWigner bw(
"bw",
"bw",
m, bwm0, bwsg);
2268 RooRealVar cbm0(
"cb_#mu",
"cb_#mu", 0);
2269 RooRealVar cbsg(
"cb_#sigma",
"cb_#sigma", 5., 0.1, 10.);
2270 RooRealVar cbal(
"cb_#alpha",
"cb_#alpha", 1.5, 0.1, 10.);
2271 RooRealVar cbn(
"cb_n",
"cb_n", 1.5, 0.01, 10.);
2272 RooCBShape cb(
"cb",
"cb",
m, cbm0, cbsg, cbal, cbn);
2275 RooFFTConvPdf bxc(
"bxc",
"BW (X) CB",
m, bw, cb);
2276 auto resourceToDelete = bxc.fitTo(*
data, RooFit::PrintLevel(-1), RooFit::PrintEvalErrors(-1), RooFit::Warnings(kFALSE));
2277 RooPlot* frame =
m.frame();
2278 data->plotOn(frame, RooFit::MarkerSize(0.9));
2280 bxc.plotOn(frame, RooFit::LineColor(kYellow));
2281 cb.plotOn(frame, RooFit::LineColor(kRed));
2282 bw.plotOn(frame, RooFit::LineStyle(kDashed));
2284 delete resourceToDelete;