Skip to content

Commit ade2c27

Browse files
committed
TRD: add option to turn on end of stream CCDB upload
1 parent 961d4ed commit ade2c27

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ class TRDDCSDataProcessor : public o2::framework::Task
150150
LOG(info) << "Invalid voltage variation trigger of DPs to update Anode/DriftUMon to " << utrigger << ", using default value of 1 V";
151151
}
152152

153+
mUploadAtEoS = ic.options().get<bool>("enable-uploadAtEoS");
154+
LOG(info) << "Setting upload of CCDB objects at end of stream to " << mUploadAtEoS;
155+
153156
mProcessor->init(vect);
154157
mTimerGas = std::chrono::high_resolution_clock::now();
155158
mTimerVoltages = mTimerGas;
@@ -217,15 +220,20 @@ class TRDDCSDataProcessor : public o2::framework::Task
217220

218221
void endOfStream(o2::framework::EndOfStreamContext& ec) final
219222
{
220-
sendDPsoutputGas(ec.outputs());
221-
sendDPsoutputVoltages(ec.outputs());
222-
sendDPsoutputCurrents(ec.outputs());
223-
sendDPsoutputEnv(ec.outputs());
224-
sendDPsoutputFedChamberStatus(ec.outputs());
225-
sendDPsoutputFedCFGtag(ec.outputs());
223+
// LB: no objects should be uploaded at end of stream, unless stated otherwise
224+
if (mUploadAtEoS) {
225+
LOG(info) << "End of stream upload of CCDB objects";
226+
sendDPsoutputGas(ec.outputs());
227+
sendDPsoutputVoltages(ec.outputs());
228+
sendDPsoutputCurrents(ec.outputs());
229+
sendDPsoutputEnv(ec.outputs());
230+
} else {
231+
LOG(info) << "No CCDB object upload done at the end of stream";
232+
}
226233
}
227234

228235
private:
236+
bool mUploadAtEoS = false;
229237
bool mReportTiming = false;
230238
std::unique_ptr<DCSProcessor> mProcessor;
231239
std::chrono::high_resolution_clock::time_point mTimerGas;
@@ -397,7 +405,8 @@ DataProcessorSpec getTRDDCSDataProcessorSpec()
397405
{"DPs-voltage-variation-trigger", VariantType::Int64, 1ll, {"Voltage variation trigger for upload of CCDB object"}},
398406
{"DPs-update-interval-gas", VariantType::Int64, 900ll, {"Interval (in s) after which to update the DPs CCDB entry for gas parameters"}},
399407
{"DPs-max-counter-alarm-fed", VariantType::Int, 1, {"Maximum number of alarms after FedChamberStatus and FedCFGtag changes, following changes are logged as warnings"}},
400-
{"DPs-min-counter-update-fed", VariantType::Int, 522, {"Minimum number of DPs to update FedChamberStatus and FedCFGtag objects"}}}};
408+
{"DPs-min-counter-update-fed", VariantType::Int, 522, {"Minimum number of DPs to update FedChamberStatus and FedCFGtag objects"}},
409+
{"enable-uploadAtEoS", VariantType::Bool, false, {"Upload CCDB objects at end of stream"}}}};
401410
}
402411

403412
} // namespace framework

0 commit comments

Comments
 (0)