Skip to content

Commit f934747

Browse files
authored
Merge pull request #48981 from bsunanda/Run3-alca261
Run3-alca261 Update the macros used to calibrate Hcal IsoTrack studies
2 parents db6a2ac + a38ddae commit f934747

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

Calibration/HcalCalibAlgos/macros/CalibFitPlots.C

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,6 +2699,7 @@ void PlotHistCorrFactors(char* infile1,
26992699
bool isRealData = false,
27002700
const char* year = "2024",
27012701
int iformat = 0,
2702+
int range = 1,
27022703
int save = 0) {
27032704
std::map<int, cfactors> cfacs[5];
27042705
std::vector<std::string> texts;
@@ -2746,6 +2747,17 @@ void PlotHistCorrFactors(char* infile1,
27462747
gStyle->SetPadColor(kWhite);
27472748
gStyle->SetFillColor(kWhite);
27482749
gStyle->SetOptTitle(0);
2750+
double ylow, yhigh;
2751+
if (range == 0) {
2752+
ylow = 0.8;
2753+
yhigh = 1.2;
2754+
} else if (range == 1) {
2755+
ylow = 0.5;
2756+
yhigh = 1.5;
2757+
} else {
2758+
ylow = 0.0;
2759+
yhigh = 2.0;
2760+
}
27492761
if ((!ratio) && drawStatBox) {
27502762
gStyle->SetOptStat(10);
27512763
gStyle->SetOptFit(10);
@@ -2808,7 +2820,7 @@ void PlotHistCorrFactors(char* infile1,
28082820
h->GetYaxis()->SetLabelOffset(0.005);
28092821
h->GetYaxis()->SetTitleSize(0.036);
28102822
h->GetYaxis()->SetTitleOffset(1.20);
2811-
h->GetYaxis()->SetRangeUser(0.50, 1.50);
2823+
h->GetYaxis()->SetRangeUser(ylow, yhigh);
28122824
hists.push_back(h);
28132825
fitr.push_back(fit);
28142826
htype.push_back(ih);
@@ -2859,7 +2871,7 @@ void PlotHistCorrFactors(char* infile1,
28592871
h->GetYaxis()->SetTitle("Correction Factor");
28602872
h->GetYaxis()->SetLabelOffset(0.005);
28612873
h->GetYaxis()->SetTitleOffset(1.20);
2862-
h->GetYaxis()->SetRangeUser(0.5, 1.5);
2874+
h->GetYaxis()->SetRangeUser(ylow, yhigh);
28632875
hists.push_back(h);
28642876
entries.push_back(nent);
28652877
if (drawStatBox)
@@ -2954,6 +2966,7 @@ void PlotHistCorr2Factors(char* infile1,
29542966
bool isRealData = true,
29552967
const char* year = "2024",
29562968
int iformat = 0,
2969+
int range = 1,
29572970
int save = 0) {
29582971
std::map<int, cfactors> cfacs[5];
29592972
std::vector<std::string> texts;
@@ -2980,6 +2993,17 @@ void PlotHistCorr2Factors(char* infile1,
29802993
gStyle->SetPadColor(kWhite);
29812994
gStyle->SetFillColor(kWhite);
29822995
gStyle->SetOptTitle(0);
2996+
double ylow, yhigh;
2997+
if (range == 0) {
2998+
ylow = 0.8;
2999+
yhigh = 1.2;
3000+
} else if (range == 1) {
3001+
ylow = 0.5;
3002+
yhigh = 1.5;
3003+
} else {
3004+
ylow = 0.0;
3005+
yhigh = 2.0;
3006+
}
29833007
if ((!ratio) && drawStatBox) {
29843008
gStyle->SetOptStat(10);
29853009
gStyle->SetOptFit(10);
@@ -3036,7 +3060,7 @@ void PlotHistCorr2Factors(char* infile1,
30363060
h->GetYaxis()->SetLabelOffset(0.005);
30373061
h->GetYaxis()->SetTitleSize(0.036);
30383062
h->GetYaxis()->SetTitleOffset(1.20);
3039-
h->GetYaxis()->SetRangeUser(0.80, 1.20);
3063+
h->GetYaxis()->SetRangeUser(ylow, yhigh);
30403064
hists.push_back(h);
30413065
fitr.push_back(fit);
30423066
htype.push_back(ih);
@@ -3081,7 +3105,7 @@ void PlotHistCorr2Factors(char* infile1,
30813105
h->GetYaxis()->SetTitle("Correction Factor");
30823106
h->GetYaxis()->SetLabelOffset(0.005);
30833107
h->GetYaxis()->SetTitleOffset(1.20);
3084-
h->GetYaxis()->SetRangeUser(0.8, 1.2);
3108+
h->GetYaxis()->SetRangeUser(ylow, yhigh);
30853109
hists.push_back(h);
30863110
entries.push_back(nent);
30873111
if (drawStatBox)
@@ -3176,6 +3200,7 @@ void PlotHistCorrDFactors(char* infile1,
31763200
bool isRealData = true,
31773201
const char* year = "2024",
31783202
int iformat = 0,
3203+
int range = 0,
31793204
int save = 0) {
31803205
std::map<int, cfactors> cfacs[5];
31813206
std::vector<std::string> texts;
@@ -3223,6 +3248,17 @@ void PlotHistCorrDFactors(char* infile1,
32233248
gStyle->SetPadColor(kWhite);
32243249
gStyle->SetFillColor(kWhite);
32253250
gStyle->SetOptTitle(0);
3251+
double ylow, yhigh;
3252+
if (range == 0) {
3253+
ylow = 0.8;
3254+
yhigh = 1.2;
3255+
} else if (range == 1) {
3256+
ylow = 0.5;
3257+
yhigh = 1.5;
3258+
} else {
3259+
ylow = 0.0;
3260+
yhigh = 2.0;
3261+
}
32263262
if ((!ratio) && drawStatBox) {
32273263
gStyle->SetOptStat(10);
32283264
gStyle->SetOptFit(10);
@@ -3283,7 +3319,7 @@ void PlotHistCorrDFactors(char* infile1,
32833319
h->GetYaxis()->SetLabelOffset(0.005);
32843320
h->GetYaxis()->SetTitleSize(0.036);
32853321
h->GetYaxis()->SetTitleOffset(1.20);
3286-
h->GetYaxis()->SetRangeUser(0.80, 1.20);
3322+
h->GetYaxis()->SetRangeUser(ylow, yhigh);
32873323
hists.push_back(h);
32883324
fitr.push_back(fit);
32893325
htype.push_back(ih);
@@ -3328,7 +3364,7 @@ void PlotHistCorrDFactors(char* infile1,
33283364
h->GetYaxis()->SetTitle("Correction Factor");
33293365
h->GetYaxis()->SetLabelOffset(0.005);
33303366
h->GetYaxis()->SetTitleOffset(1.20);
3331-
h->GetYaxis()->SetRangeUser(0.8, 1.2);
3367+
h->GetYaxis()->SetRangeUser(ylow, yhigh);
33323368
hists.push_back(h);
33333369
entries.push_back(nent);
33343370
if (drawStatBox)

0 commit comments

Comments
 (0)