Skip to content

Commit e7da91e

Browse files
authored
ITS Calib: fix parallel processing for highly disordered data (#14756)
1 parent 2a8b5d6 commit e7da91e

File tree

2 files changed

+149
-82
lines changed

2 files changed

+149
-82
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class ITSThresholdCalibrator : public Task
175175
unsigned char vCharge[N_COL];
176176
unsigned char vHits[N_COL];
177177
short int mColStep = 8; // save s-curves to tree every mColStep pixels on 1 row
178+
short int mRowStep = 1;
178179

179180
// Initialize pointers for doing error function fits
180181
TH1F* mFitHist = nullptr;
@@ -232,7 +233,8 @@ class ITSThresholdCalibrator : public Task
232233
short int mRunTypeUp = -1;
233234
short int mRunTypeRU[N_RU] = {0};
234235
short int mRunTypeRUCopy[N_RU] = {0};
235-
short int mCdwCntRU[N_RU][N_ROW] = {{0}};
236+
bool mFlagsRU[N_RU] = {0};
237+
std::map<short int, std::map<short int, std::array<std::array<int, 500>, 500>>> mCdwCntRU; // RU --> row --> 2D hit map
236238
short int mLoopVal[N_RU][N_ROW] = {{0}};
237239
bool mActiveLinks[N_RU][3] = {{false}};
238240
std::set<short int> mRuSet;
@@ -241,6 +243,7 @@ class ITSThresholdCalibrator : public Task
241243
short int mMin = -1, mMax = -1, mMin2 = 0, mMax2 = 0;
242244
short int mStep = 1, mStep2 = 1;
243245
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
244247

245248
// Get threshold method (fit == 1, derivative == 0, or hitcounting == 2)
246249
char mFitType = -1;
@@ -293,6 +296,7 @@ class ITSThresholdCalibrator : public Task
293296
short int manualStep = 1, manualStep2 = 1;
294297
std::string manualScanType;
295298
short int manualStrobeWindow = 5;
299+
short int manualRowScan = 512; // used only to normalize % of success in thr/ithr/vcasn scans
296300

297301
// for CRU_ITS data processing
298302
bool isCRUITS = false;
@@ -306,7 +310,7 @@ class ITSThresholdCalibrator : public Task
306310
int maxDumpS = -1; // maximum number of s-curves to be dumped, default -1 = dump all
307311
std::string chipDumpS = ""; // list of comma-separated O2 chipIDs to be dumped, default is empty = dump all
308312
int dumpCounterS[24120] = {0}; // count dumps for every chip
309-
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
313+
bool isChipDB[24120] = {0}; // check whether a chip has been already added to DB entry
310314
TFile* fileDumpS; // file where to store the s-curves on disk
311315
std::vector<short int> chipDumpList; // vector of chips to dump
312316

@@ -324,6 +328,9 @@ class ITSThresholdCalibrator : public Task
324328

325329
// Percentage cut for VCASN/ITHR scans
326330
short int mPercentageCut = 25; // default, at least 1 good row equivalent
331+
332+
// For data replay only
333+
short int isLocal = false;
327334
};
328335

329336
// Create a processor spec

0 commit comments

Comments
 (0)