Skip to content

Commit f20915c

Browse files
author
Sunanda
committed
Code check
1 parent 648ddf4 commit f20915c

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

Calibration/HcalCalibAlgos/macros/CalibCorr.C

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ public:
552552
~CalibThreshold() {}
553553

554554
double threshold(unsigned int detId);
555+
555556
private:
556557
double threshold(int subdet, int ieta, int depth);
557558
bool fileThreshold(const char* fname);
@@ -586,20 +587,21 @@ bool CalibThreshold::fileThreshold(const char* fname) {
586587
continue; //ignore comment
587588
std::vector<std::string> items = splitString(std::string(buffer));
588589
if (items.size() != 7) {
589-
++bad;
590+
++bad;
590591
std::cout << "Ignore line: " << buffer << std::endl;
591592
} else {
592593
++good;
593-
int ieta = std::atoi(items[0].c_str());
594-
int depth = std::atoi(items[2].c_str());
595-
double thr = std::atof(items[4].c_str());
596-
thresh_[std::pair<int, int>(ieta, depth)] = thr;
597-
}
594+
int ieta = std::atoi(items[0].c_str());
595+
int depth = std::atoi(items[2].c_str());
596+
double thr = std::atof(items[4].c_str());
597+
thresh_[std::pair<int, int>(ieta, depth)] = thr;
598+
}
598599
}
599600
fInput.close();
600-
std::cout << "Reads " << all << " entries from " << fname << " with " << good << " Good and " << bad << " bad records" << std::endl;
601+
std::cout << "Reads " << all << " entries from " << fname << " with " << good << " Good and " << bad
602+
<< " bad records" << std::endl;
601603
if (good > 0)
602-
ok = true;
604+
ok = true;
603605
}
604606
}
605607
return ok;
@@ -610,23 +612,19 @@ double CalibThreshold::threshold(int subdet, int ieta, int depth) {
610612
{0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2},
611613
{0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2},
612614
{0.2, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3}};
613-
double cutHB[4][4] = {{0.1, 0.2, 0.3, 0.3},
614-
{0.25, 0.25, 0.3, 0.3},
615-
{0.4, 0.3, 0.3, 0.3},
616-
{0.6, 0.4, 0.4, 0.5}};
615+
double cutHB[4][4] = {{0.1, 0.2, 0.3, 0.3}, {0.25, 0.25, 0.3, 0.3}, {0.4, 0.3, 0.3, 0.3}, {0.6, 0.4, 0.4, 0.5}};
617616

618617
double thr(0);
619618
if (ok_) {
620619
if ((form_ > 0) && (form_ <= 4)) {
621620
if (subdet == 2)
622-
thr = cutHE[form_ - 1][depth - 1];
621+
thr = cutHE[form_ - 1][depth - 1];
623622
else
624-
thr = cutHB[form_ - 1][depth - 1];
623+
thr = cutHB[form_ - 1][depth - 1];
625624
} else {
626-
std::map<std::pair<int, int>, double>::const_iterator itr =
627-
thresh_.find(std::pair<int, int>(ieta, depth));
625+
std::map<std::pair<int, int>, double>::const_iterator itr = thresh_.find(std::pair<int, int>(ieta, depth));
628626
if (itr != thresh_.end())
629-
thr = itr->second;
627+
thr = itr->second;
630628
}
631629
}
632630
return thr;

Calibration/HcalCalibAlgos/macros/CalibFitPlots.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ results fitOneGauss(TH1D* hist, bool fitTwice, bool debug) {
536536
if (LowEdge < 0.5)
537537
LowEdge = 0.5;
538538
diff = Fit1->Value(1) - LowEdge;
539-
HighEdge = (diff > fitrangeFactor1 * rms) ? (Fit1->Value(1) + fitrangeFactor1 * Fit1->Value(2)) : (Fit1->Value(1) + diff);
539+
HighEdge =
540+
(diff > fitrangeFactor1 * rms) ? (Fit1->Value(1) + fitrangeFactor1 * Fit1->Value(2)) : (Fit1->Value(1) + diff);
540541
if (HighEdge > 5.0)
541542
HighEdge = 5.0;
542543
if (debug)

Calibration/HcalCalibAlgos/macros/CalibMonitor.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@
104104
// d: as the format for threshold application,
105105
// 0: no threshold; 1: 2022 prompt data; 2:
106106
// 2022 reco data; 3: 2023 prompt data; 4: 2025
107-
// Begin of Year.
107+
// Begin of Year; 5: Derived from the file
108+
// PFCuts_IOV_362975.txt.
108109
// (default = 0)
109110
// etalo/etahi (int,int) = |eta| ranges (default = 0:30)
110111
// runlo (int) = lower value of run number to be included (+ve)

Calibration/HcalCalibAlgos/macros/CalibPlotProperties.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
// d: as the format for threshold application,
104104
// 0: no threshold; 1: 2022 prompt data; 2:
105105
// 2022 reco data; 3: 2023 prompt data; 4: 2025
106-
// Begin of Year.
106+
// Begin of Year; 5: Derived from the file
107+
// PFCuts_IOV_362975.txt.
107108
// (default = 0)
108109
// etalo/etahi (int,int) = |eta| ranges (0:30)
109110
// runlo (int) = lower value of run number to be included (+ve)

Calibration/HcalCalibAlgos/macros/CalibTree.C

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
// For threshold h: the format for threshold
8383
// application, 0: no threshold; 1: 2022 prompt
8484
// data; 2: 2022 reco data; 3: 2023 prompt data;
85-
// 4: 2025 Begin of Year.
85+
// 4: 2025 Begin of Year; 5: Derived from the file
86+
// PFCuts_IOV_362975.txt.
8687
// (Default 0)
8788
// useGen (bool) = use generator level momentum information (false)
8889
// runlo (int) = lower value of run number to be included (+ve)
@@ -1241,8 +1242,8 @@ void CalibTree::writeCorrFactor(const char *corrFileName, int ietaMax) {
12411242
int subdet, depth, zside, ieta, iphi;
12421243
unpackDetId(detId, subdet, zside, ieta, iphi, depth);
12431244
if (ieta <= ietaMax) {
1244-
double corrf = ((itr->second.first > 0.1) && (itr->second.first < 4.0)) ? itr->second.first : 1.0;
1245-
double dcorr = ((itr->second.first > 0.1) && (itr->second.first < 4.0)) ? itr->second.second : 0.0;
1245+
double corrf = ((itr->second.first > 0.1) && (itr->second.first < 4.0)) ? itr->second.first : 1.0;
1246+
double dcorr = ((itr->second.first > 0.1) && (itr->second.first < 4.0)) ? itr->second.second : 0.0;
12461247
myfile << std::setw(10) << std::hex << detId << std::setw(10) << std::dec << zside * ieta << std::setw(10)
12471248
<< depth << std::setw(10) << corrf << " " << std::setw(10) << dcorr << std::endl;
12481249
std::cout << corrf << ",";

0 commit comments

Comments
 (0)