Skip to content

Commit 96a75da

Browse files
committed
clang format applied
1 parent 37d117a commit 96a75da

File tree

2 files changed

+34
-35
lines changed

2 files changed

+34
-35
lines changed

Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ class ITSThresholdCalibrator : public Task
233233
short int mRunTypeRU[N_RU] = {0};
234234
short int mRunTypeRUCopy[N_RU] = {0};
235235
bool mFlagsRU[N_RU] = {0};
236-
//short int mCdwCntRU[N_RU][N_ROW] = {{0}};
237-
std::map<short int,std::map<short int, std::array<std::array<int, 500>, 500>>> mCdwCntRU; // RU --> row --> 2D hit map
236+
// short int mCdwCntRU[N_RU][N_ROW] = {{0}};
237+
std::map<short int, std::map<short int, std::array<std::array<int, 500>, 500>>> mCdwCntRU; // RU --> row --> 2D hit map
238238
short int mLoopVal[N_RU][N_ROW] = {{0}};
239239
bool mActiveLinks[N_RU][3] = {{false}};
240240
std::set<short int> mRuSet;
@@ -243,7 +243,7 @@ class ITSThresholdCalibrator : public Task
243243
short int mMin = -1, mMax = -1, mMin2 = 0, mMax2 = 0;
244244
short int mStep = 1, mStep2 = 1;
245245
short int mStrobeWindow = 5; // 5 means 5*25ns = 125 ns
246-
short int mRowScan = 512; // number of scanned rows, used only to normalize % of success
246+
short int mRowScan = 512; // number of scanned rows, used only to normalize % of success
247247

248248
// Get threshold method (fit == 1, derivative == 0, or hitcounting == 2)
249249
char mFitType = -1;

Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void ITSThresholdCalibrator::init(InitContext& ic)
154154
} catch (std::exception const& e) {
155155
throw std::runtime_error("Number of scanned rows not found, mandatory in manual mode");
156156
}
157-
157+
158158
try {
159159
manualMin = ic.options().get<short int>("manual-min");
160160
} catch (std::exception const& e) {
@@ -754,7 +754,7 @@ void ITSThresholdCalibrator::extractThresholdRow(const short int& chipID, const
754754

755755
for (int scan_i = 0; scan_i < ((mScanType == 'r') ? N_RANGE : N_RANGE2); scan_i++) {
756756
#ifdef WITH_OPENMP
757-
omp_set_num_threads(mNThreads);
757+
omp_set_num_threads(mNThreads);
758758
#pragma omp parallel for schedule(dynamic)
759759
#endif
760760
// Loop over all columns (pixels) in the row
@@ -801,8 +801,8 @@ void ITSThresholdCalibrator::extractThresholdRow(const short int& chipID, const
801801

802802
// Saves threshold information to internal memory
803803
if (mScanType != 'P' && mScanType != 'p' && mScanType != 't' && mScanType != 'R' && mScanType != 'r') {
804-
if(mVerboseOutput) {
805-
LOG(info)<<"Saving data of ChipID: "<<chipID<<" Row: "<<row;
804+
if (mVerboseOutput) {
805+
LOG(info) << "Saving data of ChipID: " << chipID << " Row: " << row;
806806
}
807807
this->saveThreshold();
808808
}
@@ -965,9 +965,9 @@ void ITSThresholdCalibrator::setRunType(const short int& runtype)
965965
mRowScan = 11;
966966
if (runtype == THR_SCAN_SHORT_33) {
967967
mRowScan = 33;
968-
} else if(runtype == THR_SCAN_SHORT_2_10HZ){
968+
} else if (runtype == THR_SCAN_SHORT_2_10HZ) {
969969
mRowScan = 2;
970-
}
970+
}
971971
} else if (runtype == VCASN150 || runtype == VCASN100 || runtype == VCASN100_100HZ || runtype == VCASN130 || runtype == VCASNBB) {
972972
// VCASN tuning for different target thresholds
973973
// Store average VCASN for each chip into CCDB
@@ -979,7 +979,7 @@ void ITSThresholdCalibrator::setRunType(const short int& runtype)
979979
this->mMax = inMaxVcasn; // 80 is the default
980980
this->N_RANGE = mMax - mMin + 1;
981981
this->mCheckExactRow = true;
982-
mRowScan = 4;
982+
mRowScan = 4;
983983

984984
} else if (runtype == ITHR150 || runtype == ITHR100 || runtype == ITHR100_100HZ || runtype == ITHR130) {
985985
// ITHR tuning -- average ITHR per chip
@@ -991,7 +991,7 @@ void ITSThresholdCalibrator::setRunType(const short int& runtype)
991991
this->mMax = inMaxIthr; // 100 is the default
992992
this->N_RANGE = mMax - mMin + 1;
993993
this->mCheckExactRow = true;
994-
mRowScan = 4;
994+
mRowScan = 4;
995995

996996
} else if (runtype == DIGITAL_SCAN || runtype == DIGITAL_SCAN_100HZ || runtype == DIGITAL_SCAN_NOMASK) {
997997
// Digital scan -- only storing one value per chip, no fit needed
@@ -1389,11 +1389,10 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
13891389
cwcnt = (short int)(calib.calibCounter);
13901390

13911391
// count injections
1392-
short int loopPoint = (loopval - this->mMin) / mStep;
1393-
short int chgPoint = (realcharge - this->mMin2) / mStep2;
1394-
auto &arr = mCdwCntRU[iRU][row];
1395-
arr[chgPoint][loopPoint]++;
1396-
1392+
short int loopPoint = (loopval - this->mMin) / mStep;
1393+
short int chgPoint = (realcharge - this->mMin2) / mStep2;
1394+
auto& arr = mCdwCntRU[iRU][row];
1395+
arr[chgPoint][loopPoint]++;
13971396

13981397
if (this->mVerboseOutput) {
13991398
LOG(info) << "RU: " << iRU << " CDWcounter: " << cwcnt << " row: " << row << " Loopval: " << loopval << " realcharge: " << realcharge << " confDBv: " << mCdwVersion;
@@ -1489,7 +1488,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
14891488
if (ruIndex < 0) {
14901489
continue;
14911490
}
1492-
short int nL = ruIndex > 47 ? 2 : 3; // total number of links per RU
1491+
short int nL = ruIndex > 47 ? 2 : 3; // total number of links per RU
14931492
std::vector<short int> chipEnabled = getChipListFromRu(ruIndex, mActiveLinks[ruIndex]); // chip boundaries
14941493
// Fill the chipDone info string
14951494
if (mRunTypeRUCopy[ruIndex] == nInjScaled * nL) {
@@ -1502,27 +1501,27 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
15021501
mRunTypeRUCopy[ruIndex] = 0; // reset here is safer (the other counter is reset in finalize)
15031502
}
15041503
// Check if scan of a row is finished: only for specific scans!
1505-
bool passCondition = true;
1506-
for(int j1=0; j1 < N_RANGE2; j1++) {
1507-
for(int j2=0; j2 < N_RANGE; j2++) {
1508-
if(mScanType == 't') { // ToT scan is done in specific ranges depending on charge (see ITSComm)
1509-
if ((j1 == 0 && j2<((600-mMin)/mStep)) || (j2>=((600-mMin)/mStep) && j2<=((800-mMin)/mStep)) || (j1==1 && j2>((800-mMin)/mStep))) {
1510-
if(mCdwCntRU[ruIndex][row][j1][j2] < nInjScaled * nL) {
1511-
passCondition = false;
1512-
break;
1513-
}
1514-
}
1515-
} else if(mCdwCntRU[ruIndex][row][j1][j2] < nInjScaled * nL) {
1504+
bool passCondition = true;
1505+
for (int j1 = 0; j1 < N_RANGE2; j1++) {
1506+
for (int j2 = 0; j2 < N_RANGE; j2++) {
1507+
if (mScanType == 't') { // ToT scan is done in specific ranges depending on charge (see ITSComm)
1508+
if ((j1 == 0 && j2 < ((600 - mMin) / mStep)) || (j2 >= ((600 - mMin) / mStep) && j2 <= ((800 - mMin) / mStep)) || (j1 == 1 && j2 > ((800 - mMin) / mStep))) {
1509+
if (mCdwCntRU[ruIndex][row][j1][j2] < nInjScaled * nL) {
1510+
passCondition = false;
1511+
break;
1512+
}
1513+
}
1514+
} else if (mCdwCntRU[ruIndex][row][j1][j2] < nInjScaled * nL) {
15161515
passCondition = false;
1517-
break;
1518-
}
1516+
break;
1517+
}
15191518
}
1520-
if(!passCondition){
1519+
if (!passCondition) {
15211520
break;
15221521
}
15231522
}
15241523
if (mVerboseOutput) {
1525-
LOG(info) << "PassCondition: " << passCondition << " - mCdwCntRU of RU" << ruIndex << " row " << row << " = " << mCdwCntRU[ruIndex][row][0][0] << "(Links: "<<mActiveLinks[ruIndex][0]<<", "<<mActiveLinks[ruIndex][1]<<","<<mActiveLinks[ruIndex][2]<<")";
1524+
LOG(info) << "PassCondition: " << passCondition << " - mCdwCntRU of RU" << ruIndex << " row " << row << " = " << mCdwCntRU[ruIndex][row][0][0] << "(Links: " << mActiveLinks[ruIndex][0] << ", " << mActiveLinks[ruIndex][1] << "," << mActiveLinks[ruIndex][2] << ")";
15261525
}
15271526

15281527
if (mScanType != 'D' && mScanType != 'A' && mScanType != 'P' && mScanType != 'R' && passCondition) {
@@ -1546,7 +1545,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
15461545
mCdwCntRU[ruIndex].erase(row); // row is gone
15471546
}
15481547

1549-
if(mRunTypeRU[ruIndex] >= nInjScaled * nL && passCondition) {
1548+
if (mRunTypeRU[ruIndex] >= nInjScaled * nL && passCondition) {
15501549
mFlagsRU[ruIndex] = true;
15511550
finalize();
15521551
LOG(info) << "Shipping all outputs to aggregator (before endOfStream arrival!)";
@@ -1834,7 +1833,7 @@ void ITSThresholdCalibrator::finalize()
18341833
}
18351834
if (mVerboseOutput) {
18361835
LOG(info) << "Average or mpv " << name << " of chip " << it->first << " = " << outVal << " e-";
1837-
}
1836+
}
18381837
float status = ((float)it->second[4] / (float)(mRowScan * N_COL)) * 100.; // percentage of successful threshold extractions
18391838
if (status < mPercentageCut && (mScanType == 'I' || mScanType == 'V')) {
18401839
if (mScanType == 'I') { // default ITHR if percentage of success < mPercentageCut
@@ -2023,7 +2022,7 @@ DataProcessorSpec getITSThresholdCalibratorSpec(const ITSCalibInpConf& inpConf)
20232022
{"manual-step2", VariantType::Int, 1, {"Step2 value: defines the steps between manual-min2 and manual-max2. Default is 1. Use only in manual mode"}},
20242023
{"manual-scantype", VariantType::String, "T", {"scan type, can be D, T, I, V, P, p: use only in manual mode"}},
20252024
{"manual-strobewindow", VariantType::Int, 5, {"strobe duration in clock cycles, default is 5 = 125 ns: use only in manual mode"}},
2026-
{"manual-rowscan", VariantType::Int, 512, {"Number of ALPIDE rows scanned in the run: use only in manual mode"}},
2025+
{"manual-rowscan", VariantType::Int, 512, {"Number of ALPIDE rows scanned in the run: use only in manual mode"}},
20272026
{"save-tree", VariantType::Bool, false, {"Flag to save ROOT tree on disk: use only in manual mode"}},
20282027
{"scale-ninj", VariantType::Bool, false, {"Flag to activate the scale of the number of injects to be used to count hits from specific MEBs: use only in manual mode and in combination with --meb-select"}},
20292028
{"enable-mpv", VariantType::Bool, false, {"Flag to enable calculation of most-probable value in vcasn/ithr scans"}},

0 commit comments

Comments
 (0)