You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,7 @@ namespace its
63
63
{
64
64
65
65
int nInj = 50;
66
+
int nInjScaled = 50; // different from nInj only if mMeb > 0, in this case it is nInj/3.
66
67
67
68
// List of the possible run types for reference
68
69
enum RunTypes {
@@ -72,6 +73,7 @@ enum RunTypes {
72
73
THR_SCAN_SHORT_2_10HZ = 18,
73
74
THR_SCAN_SHORT_100HZ = 19,
74
75
THR_SCAN_SHORT_200HZ = 20,
76
+
THR_SCAN_SHORT_150INJ = 55,
75
77
VCASN150 = 23,
76
78
VCASN100 = 10,
77
79
VCASN100_100HZ = 21,
@@ -164,7 +166,7 @@ class ITSThresholdCalibrator : public Task
164
166
shortint vRow[N_COL];
165
167
shortint vThreshold[N_COL];
166
168
bool vSuccess[N_COL];
167
-
unsignedchar vNoise[N_COL];
169
+
float vNoise[N_COL];
168
170
unsignedchar vPoints[N_COL];
169
171
shortint vMixData[N_COL];
170
172
unsignedchar vCharge[N_COL];
@@ -288,6 +290,7 @@ class ITSThresholdCalibrator : public Task
288
290
// parameters for manual mode: if run type is not among the listed one
289
291
bool isManualMode = false;
290
292
bool saveTree;
293
+
bool scaleNinj = false;
291
294
shortint manualMin, manualMin2 = 0;
292
295
shortint manualMax, manualMax2 = 0;
293
296
shortint manualStep = 1, manualStep2 = 1;
@@ -306,6 +309,7 @@ class ITSThresholdCalibrator : public Task
306
309
int maxDumpS = -1; // maximum number of s-curves to be dumped, default -1 = dump all
307
310
std::string chipDumpS = ""; // list of comma-separated O2 chipIDs to be dumped, default is empty = dump all
308
311
int dumpCounterS[24120] = {0}; // count dumps for every chip
312
+
int countCdw[24120] = {0}; // count how many CDWs have been processed with the maximum charge injected: usefull for s-curve dump when hits do not arrive in order
309
313
TFile* fileDumpS; // file where to store the s-curves on disk
310
314
std::vector<shortint> chipDumpList; // vector of chips to dump
311
315
@@ -317,6 +321,9 @@ class ITSThresholdCalibrator : public Task
317
321
boolmCalculate2DParams = true;
318
322
int chargeA = 0;
319
323
int chargeB = 0;
324
+
325
+
// Variable to select from which MEB to consider the hits.
if (!mChipsForbRows[chipID] && (!mCheckExactRow || d.getRow() == row)) { // row has NOT to be forbidden and we ignore hits coming from other rows (potential masking issue on chip)
1450
+
if (!mChipsForbRows[chipID] && (!mCheckExactRow || d.getRow() == row) && (mMeb < 0 || cwcnt % 3 == mMeb)) { // row has NOT to be forbidden and we ignore hits coming from other rows (potential masking issue on chip)
auto fndVal = std::find(chipDumpList.begin(), chipDumpList.end(), chipID);
1452
1470
int checkR = (mScanType == 'I') ? mMin : mMax;
1453
-
passCondition = (cwcnt == nInj - 1) && (loopval == checkR) && (fndVal != chipDumpList.end() || !chipDumpList.size()); // in this way we dump any s-curve, bad and good
1471
+
if (loopval == checkR) {
1472
+
countCdw[chipID]++;
1473
+
}
1474
+
passCondition = (countCdw[chipID] == nInj) && (loopval == checkR) && (fndVal != chipDumpList.end() || !chipDumpList.size()); // in this way we dump any s-curve, bad and good
if (mScanType != 'D' && mScanType != 'A' && mScanType != 'P' && mScanType != 'p' && mScanType != 'R' && mScanType != 'r' && passCondition) { // for D,A,P we do it at the end in finalize()
1469
1490
this->extractAndUpdate(chipID, row);
1491
+
countCdw[chipID] = 0;
1470
1492
// remove entry for this row whose scan is completed
1471
1493
mPixelHits[chipID].erase(row);
1472
1494
mForbiddenRows[chipID].push_back(row); // due to the loose cut in isScanFinished, extra hits may come for this deleted row. In this way the row is ignored afterwards
{"manual-scantype", VariantType::String, "T", {"scan type, can be D, T, I, V, P, p: use only in manual mode"}},
1983
2005
{"manual-strobewindow", VariantType::Int, 5, {"strobe duration in clock cycles, default is 5 = 125 ns: use only in manual mode"}},
1984
2006
{"save-tree", VariantType::Bool, false, {"Flag to save ROOT tree on disk: use only in manual mode"}},
2007
+
{"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"}},
1985
2008
{"enable-mpv", VariantType::Bool, false, {"Flag to enable calculation of most-probable value in vcasn/ithr scans"}},
1986
2009
{"enable-cru-its", VariantType::Bool, false, {"Flag to enable the analysis of raw data on disk produced by CRU_ITS IB commissioning tools"}},
1987
2010
{"ninj", VariantType::Int, 50, {"Number of injections per change, default is 50"}},
{"calculate-slope", VariantType::Bool, false, {"For Pulse Shape 2D: if enabled it calculate the slope of the charge vs strobe delay trend for each pixel and fill it in the output tree"}},
1992
2015
{"finalize-at-eos", VariantType::Bool, false, {"Call the finalize() method at the end of stream: to be used in case end-of-run flags are not available so to force calculations at end of run"}},
1993
2016
{"charge-a", VariantType::Int, 0, {"To use with --calculate-slope, it defines the charge (in DAC) for the 1st point used for the slope calculation"}},
1994
-
{"charge-b", VariantType::Int, 0, {"To use with --calculate-slope, it defines the charge (in DAC) for the 2nd point used for the slope calculation"}}}};
2017
+
{"charge-b", VariantType::Int, 0, {"To use with --calculate-slope, it defines the charge (in DAC) for the 2nd point used for the slope calculation"}},
2018
+
{"meb-select", VariantType::Int, -1, {"Select from which multi-event buffer consider the hits: 0,1 or 2"}}}};
0 commit comments