Skip to content

Commit 211cac7

Browse files
authored
ITS: added new calib scan: vresetd scan 1D and 2D + new minor features (#11686)
* added new calib scan: vresetd scan 1D and 2D + new minor features * fix small bug found during detailed tests
1 parent 9907b5a commit 211cac7

3 files changed

Lines changed: 166 additions & 94 deletions

File tree

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ enum RunTypes {
8787
PULSELENGTH_SCAN = 32,
8888
TOT_CALIBRATION = 36,
8989
TOT_CALIBRATION_1_ROW = 41,
90+
VRESETD_150 = 38,
91+
VRESETD_300 = 39,
92+
VRESETD_2D = 42,
9093
END_RUN = 0
9194
};
9295

@@ -161,7 +164,7 @@ class ITSThresholdCalibrator : public Task
161164
short int vThreshold[N_COL];
162165
bool vSuccess[N_COL];
163166
unsigned char vNoise[N_COL];
164-
short int vStrobeDel[N_COL];
167+
short int vMixData[N_COL];
165168
unsigned char vCharge[N_COL];
166169
float vSlope[N_COL];
167170
float vIntercept[N_COL];
@@ -182,11 +185,11 @@ class ITSThresholdCalibrator : public Task
182185

183186
// Helper functions related to threshold extraction
184187
void initThresholdTree(bool recreate = true);
185-
bool findUpperLower(std::vector<std::vector<unsigned short int>>, const short int&, short int&, short int&, bool);
186-
bool findThreshold(const short int&, std::vector<std::vector<unsigned short int>>, const float*, short int&, float&, float&);
187-
bool findThresholdFit(const short int&, std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&);
188-
bool findThresholdDerivative(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&);
189-
bool findThresholdHitcounting(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&);
188+
bool findUpperLower(std::vector<std::vector<unsigned short int>>, const short int&, short int&, short int&, bool, int);
189+
bool findThreshold(const short int&, std::vector<std::vector<unsigned short int>>, const float*, short int&, float&, float&, int);
190+
bool findThresholdFit(const short int&, std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&, int);
191+
bool findThresholdDerivative(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&, int);
192+
bool findThresholdHitcounting(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, int);
190193
bool isScanFinished(const short int&, const short int&, const short int&);
191194
void findAverage(const std::array<long int, 6>&, float&, float&, float&, float&);
192195
void saveThreshold();
@@ -207,6 +210,7 @@ class ITSThresholdCalibrator : public Task
207210

208211
int mTFCounter = 0;
209212
bool mVerboseOutput = false;
213+
bool isFinalizeEos = false;
210214
std::string mMetaType;
211215
std::string mOutputDir;
212216
std::string mMetafileDir = "/dev/null";

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void ITSThresholdAggregator::run(ProcessingContext& pc)
7575
LOG(info) << "LHC period: " << mLHCPeriod;
7676
LOG(info) << "Scan type : " << mScanType;
7777
LOG(info) << "Fit type : " << std::to_string(mFitType);
78-
LOG(info) << "DB version (no sense in pulse length 2D): " << mDBversion;
78+
LOG(info) << "DB version (no sense in pulse length 2D and vresetd 2D): " << mDBversion;
7979
}
8080
for (auto const& inputRef : InputRecordWalker(pc.inputs(), {{"check", ConcreteDataTypeMatcher{"ITS", "TSTR"}}})) {
8181
// Read strings with tuning info
@@ -223,6 +223,11 @@ void ITSThresholdAggregator::finalize(EndOfStreamContext* ec)
223223
// fairMQ functionality; called automatically when the DDS stops processing
224224
void ITSThresholdAggregator::stop()
225225
{
226+
if (!mStopped && (mScanType == 'R' || mScanType == 'r')) {
227+
mStopped = true;
228+
LOG(info) << "VRESETD scan: aggregator will not call finalize() since nothing needs to be shipped to CCDB";
229+
return; // doing nothing
230+
}
226231
if (!mStopped) {
227232
this->finalize(nullptr);
228233
this->mStopped = true;
@@ -235,6 +240,11 @@ void ITSThresholdAggregator::stop()
235240
// tells that there will be no more input data
236241
void ITSThresholdAggregator::endOfStream(EndOfStreamContext& ec)
237242
{
243+
if (!mStopped && (mScanType == 'R' || mScanType == 'r')) {
244+
mStopped = true;
245+
LOG(info) << "VRESETD scan: aggregator will not call finalize() since nothing needs to be shipped to CCDB";
246+
return; // doing nothing
247+
}
238248
if (!mStopped) {
239249
this->finalize(&ec);
240250
this->mStopped = true;

0 commit comments

Comments
 (0)