Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ enum RunTypes {
PULSELENGTH_SCAN = 32,
TOT_CALIBRATION = 36,
TOT_CALIBRATION_1_ROW = 41,
VRESETD_150 = 38,
VRESETD_300 = 39,
VRESETD_2D = 42,
END_RUN = 0
};

Expand Down Expand Up @@ -161,7 +164,7 @@ class ITSThresholdCalibrator : public Task
short int vThreshold[N_COL];
bool vSuccess[N_COL];
unsigned char vNoise[N_COL];
short int vStrobeDel[N_COL];
short int vMixData[N_COL];
unsigned char vCharge[N_COL];
float vSlope[N_COL];
float vIntercept[N_COL];
Expand All @@ -182,11 +185,11 @@ class ITSThresholdCalibrator : public Task

// Helper functions related to threshold extraction
void initThresholdTree(bool recreate = true);
bool findUpperLower(std::vector<std::vector<unsigned short int>>, const short int&, short int&, short int&, bool);
bool findThreshold(const short int&, std::vector<std::vector<unsigned short int>>, const float*, short int&, float&, float&);
bool findThresholdFit(const short int&, std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&);
bool findThresholdDerivative(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&);
bool findThresholdHitcounting(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&);
bool findUpperLower(std::vector<std::vector<unsigned short int>>, const short int&, short int&, short int&, bool, int);
bool findThreshold(const short int&, std::vector<std::vector<unsigned short int>>, const float*, short int&, float&, float&, int);
bool findThresholdFit(const short int&, std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&, int);
bool findThresholdDerivative(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, float&, int);
bool findThresholdHitcounting(std::vector<std::vector<unsigned short int>>, const float*, const short int&, float&, int);
bool isScanFinished(const short int&, const short int&, const short int&);
void findAverage(const std::array<long int, 6>&, float&, float&, float&, float&);
void saveThreshold();
Expand All @@ -207,6 +210,7 @@ class ITSThresholdCalibrator : public Task

int mTFCounter = 0;
bool mVerboseOutput = false;
bool isFinalizeEos = false;
std::string mMetaType;
std::string mOutputDir;
std::string mMetafileDir = "/dev/null";
Expand Down
12 changes: 11 additions & 1 deletion Detectors/ITSMFT/ITS/workflow/src/ThresholdAggregatorSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void ITSThresholdAggregator::run(ProcessingContext& pc)
LOG(info) << "LHC period: " << mLHCPeriod;
LOG(info) << "Scan type : " << mScanType;
LOG(info) << "Fit type : " << std::to_string(mFitType);
LOG(info) << "DB version (no sense in pulse length 2D): " << mDBversion;
LOG(info) << "DB version (no sense in pulse length 2D and vresetd 2D): " << mDBversion;
}
for (auto const& inputRef : InputRecordWalker(pc.inputs(), {{"check", ConcreteDataTypeMatcher{"ITS", "TSTR"}}})) {
// Read strings with tuning info
Expand Down Expand Up @@ -223,6 +223,11 @@ void ITSThresholdAggregator::finalize(EndOfStreamContext* ec)
// fairMQ functionality; called automatically when the DDS stops processing
void ITSThresholdAggregator::stop()
{
if (!mStopped && (mScanType == 'R' || mScanType == 'r')) {
mStopped = true;
LOG(info) << "VRESETD scan: aggregator will not call finalize() since nothing needs to be shipped to CCDB";
return; // doing nothing
}
if (!mStopped) {
this->finalize(nullptr);
this->mStopped = true;
Expand All @@ -235,6 +240,11 @@ void ITSThresholdAggregator::stop()
// tells that there will be no more input data
void ITSThresholdAggregator::endOfStream(EndOfStreamContext& ec)
{
if (!mStopped && (mScanType == 'R' || mScanType == 'r')) {
mStopped = true;
LOG(info) << "VRESETD scan: aggregator will not call finalize() since nothing needs to be shipped to CCDB";
return; // doing nothing
}
if (!mStopped) {
this->finalize(&ec);
this->mStopped = true;
Expand Down
Loading