Skip to content

Commit 87e2c12

Browse files
jokonigshahor02
authored andcommitted
[EMCAL-565, EMCAL-566] Reject calib triggered events in online calib
- Calibration triggered events need to be rejected during the online calibration - Previously these events did notas this was not working on CTP level - Calibration triggers are rejected by default and can be accepted if special flag is set (no-rejectCalibTrigger)
1 parent 79755c1 commit 87e2c12

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

Detectors/EMCAL/calibration/testWorkflow/EMCALChannelCalibratorSpec.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "DetectorsCalibration/Utils.h"
2424
#include "DataFormatsEMCAL/TriggerRecord.h"
2525
#include "CommonUtils/MemFileHelper.h"
26+
#include "CommonConstants/Triggers.h"
2627
#include "Framework/Task.h"
2728
#include "Framework/ConfigParamRegistry.h"
2829
#include "Framework/ControlService.h"
@@ -49,7 +50,7 @@ class EMCALChannelCalibDevice : public o2::framework::Task
4950
using EMCALCalibParams = o2::emcal::EMCALCalibParams;
5051

5152
public:
52-
EMCALChannelCalibDevice(std::shared_ptr<o2::base::GRPGeomRequest> req, bool params, std::string calibType) : mCCDBRequest(req), mLoadCalibParamsFromCCDB(params), mCalibType(calibType) {}
53+
EMCALChannelCalibDevice(std::shared_ptr<o2::base::GRPGeomRequest> req, bool params, std::string calibType, bool rejCalibTrg) : mCCDBRequest(req), mLoadCalibParamsFromCCDB(params), mCalibType(calibType), mRejectCalibTriggers(rejCalibTrg) {}
5354

5455
void init(o2::framework::InitContext& ic) final
5556
{
@@ -136,6 +137,15 @@ class EMCALChannelCalibDevice : public o2::framework::Task
136137
if (!trg.getNumberOfObjects()) {
137138
continue;
138139
}
140+
// reject calibration trigger from the calibration
141+
if (mRejectCalibTriggers) {
142+
LOG(debug) << "Trigger: " << trg.getTriggerBits() << " o2::trigger::Cal " << o2::trigger::Cal;
143+
if (trg.getTriggerBits() & o2::trigger::Cal) {
144+
LOG(debug) << "skipping triggered events due to wrong trigger (no Physics trigger)";
145+
continue;
146+
}
147+
}
148+
139149
gsl::span<const o2::emcal::Cell> eventData(data.data() + trg.getFirstEntry(), trg.getNumberOfObjects());
140150

141151
// fast calibration
@@ -185,6 +195,7 @@ class EMCALChannelCalibDevice : public o2::framework::Task
185195
bool mScaleFactorsInitialized = false; ///< Scale factor init status
186196
bool isBadChannelCalib = true; ///< Calibration mode bad channel calib (false := time calib)
187197
bool mLoadCalibParamsFromCCDB = true; ///< Switch for loading calib params from the CCDB
198+
bool mRejectCalibTriggers = true; ///! reject calibration triggers in the online calibration
188199
std::array<double, 2> timeMeas;
189200

190201
//________________________________________________________________
@@ -257,7 +268,7 @@ class EMCALChannelCalibDevice : public o2::framework::Task
257268
namespace framework
258269
{
259270

260-
DataProcessorSpec getEMCALChannelCalibDeviceSpec(const std::string calibType, const bool loadCalibParamsFromCCDB)
271+
DataProcessorSpec getEMCALChannelCalibDeviceSpec(const std::string calibType, const bool loadCalibParamsFromCCDB, const bool rejectCalibTrigger)
261272
{
262273
using device = o2::calibration::EMCALChannelCalibDevice;
263274
using clbUtils = o2::calibration::Utils;
@@ -297,7 +308,7 @@ DataProcessorSpec getEMCALChannelCalibDeviceSpec(const std::string calibType, co
297308
processorName,
298309
inputs,
299310
outputs,
300-
AlgorithmSpec{adaptFromTask<device>(ccdbRequest, loadCalibParamsFromCCDB, calibType)},
311+
AlgorithmSpec{adaptFromTask<device>(ccdbRequest, loadCalibParamsFromCCDB, calibType, rejectCalibTrigger)},
301312
Options{}};
302313
}
303314

Detectors/EMCAL/calibration/testWorkflow/emc-channel-calib-workflow.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
3838
std::vector<ConfigParamSpec> options{
3939
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
4040
{"calibType", VariantType::String, "time", {"choose which calibration should be performed: time for tiem calibration, badchannel for bad channel calibration"}},
41-
{"no-loadCalibParamsFromCCDB", VariantType::Bool, false, {"disabled by default such that calib params are taken from the ccdb. If enabled, calib params are taken from EMCALCalibParams.h directly"}}};
41+
{"no-loadCalibParamsFromCCDB", VariantType::Bool, false, {"disabled by default such that calib params are taken from the ccdb. If enabled, calib params are taken from EMCALCalibParams.h directly"}},
42+
{"no-rejectCalibTrigger", VariantType::Bool, false, {"disabled by default such that calib triggers are rejected. If enabled, calibration triggers (LED events etc.) also enter the calibration"}}};
4243

4344
std::swap(workflowOptions, options);
4445
}
@@ -51,9 +52,10 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
5152
o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
5253
std::string calibType = cfgc.options().get<std::string>("calibType");
5354
bool loadCalibParamsFromCCDB = !cfgc.options().get<bool>("no-loadCalibParamsFromCCDB");
55+
bool rejectCalibTrigger = !cfgc.options().get<bool>("no-rejectCalibTrigger");
5456

5557
WorkflowSpec specs;
56-
specs.emplace_back(getEMCALChannelCalibDeviceSpec(calibType, loadCalibParamsFromCCDB));
58+
specs.emplace_back(getEMCALChannelCalibDeviceSpec(calibType, loadCalibParamsFromCCDB, rejectCalibTrigger));
5759

5860
// configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
5961
// o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);

0 commit comments

Comments
 (0)