Skip to content

Commit ce4e456

Browse files
committed
EMCAL: If CTP not present, do not process CTP data
1 parent 6dc67dc commit ce4e456

3 files changed

Lines changed: 23 additions & 10 deletions

File tree

Detectors/EMCAL/calibration/testWorkflow/EMCALChannelCalibratorSpec.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
// for time measurements
4040
#include <chrono>
41+
#include <optional>
4142

4243
using namespace o2::framework;
4344

@@ -97,7 +98,7 @@ class EMCALChannelCalibDevice : public o2::framework::Task
9798
mScaleFactorsInitialized = true;
9899
}
99100
}
100-
if (matcher == ConcreteDataMatcher("CTP", "CTPCONFIG", 0)) {
101+
if (mRejectL0Triggers && matcher == ConcreteDataMatcher("CTP", "CTPCONFIG", 0)) {
101102
// clear current class mask and prepare to fill in the updated values
102103
// The trigger names are seperated by a ":" in one string in the calib params
103104
mSelectedClassMasks.clear();
@@ -149,15 +150,21 @@ class EMCALChannelCalibDevice : public o2::framework::Task
149150
}
150151

151152
// prepare CTPConfiguration such that it can be loaded in finalise ccdb
152-
pc.inputs().get<o2::ctp::CTPConfiguration*>(getCTPConfigBinding());
153+
if (mRejectL0Triggers) {
154+
pc.inputs().get<o2::ctp::CTPConfiguration*>(getCTPConfigBinding());
155+
}
153156

154157
if (!mIsConfigured) {
155158
// configure calibrators (after calib params are loaded from the CCDB)
156159
configureCalibrators();
157160
mIsConfigured = true;
158161
}
159162

160-
auto ctpDigits = pc.inputs().get<gsl::span<o2::ctp::CTPDigit>>(getCTPDigitsBinding());
163+
using ctpDigitsType = std::decay_t<decltype(pc.inputs().get<gsl::span<o2::ctp::CTPDigit>>(getCTPDigitsBinding()))>;
164+
std::optional<ctpDigitsType> ctpDigits;
165+
if (mRejectL0Triggers) {
166+
ctpDigits = pc.inputs().get<gsl::span<o2::ctp::CTPDigit>>(getCTPDigitsBinding());
167+
}
161168

162169
// reset EOR behaviour
163170
if (mTimeCalibrator) {
@@ -197,7 +204,7 @@ class EMCALChannelCalibDevice : public o2::framework::Task
197204
bool acceptEvent = false;
198205
// Match the EMCal bc to the CTP bc
199206
int64_t bcEMC = trg.getBCData().toLong();
200-
for (auto& ctpDigit : ctpDigits) {
207+
for (auto& ctpDigit : *ctpDigits) {
201208
int64_t bcCTP = ctpDigit.intRecord.toLong();
202209
LOG(debug) << "bcEMC " << bcEMC << " bcCTP " << bcCTP;
203210
if (bcCTP == bcEMC) {
@@ -403,8 +410,10 @@ DataProcessorSpec getEMCALChannelCalibDeviceSpec(const std::string calibType, co
403410
// inputs.emplace_back("EMC_BadChannelMap", o2::header::gDataOriginEMC, "BADCHANNELMAP", 0, Lifetime::Condition, ccdbParamSpec("EMC/Calib/BadChannelMap"));
404411

405412
// data request needed for rejection of EMCal trigger
406-
inputs.emplace_back(device::getCTPConfigBinding(), "CTP", "CTPCONFIG", 0, Lifetime::Condition, ccdbParamSpec("CTP/Config/Config", ctpcfgperrun));
407-
inputs.emplace_back(device::getCTPDigitsBinding(), "CTP", "DIGITS", 0, Lifetime::Timeframe);
413+
if (rejectL0Trigger) {
414+
inputs.emplace_back(device::getCTPConfigBinding(), "CTP", "CTPCONFIG", 0, Lifetime::Condition, ccdbParamSpec("CTP/Config/Config", ctpcfgperrun));
415+
inputs.emplace_back(device::getCTPDigitsBinding(), "CTP", "DIGITS", 0, Lifetime::Timeframe);
416+
}
408417

409418
auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(true, // orbitResetTime
410419
true, // GRPECS=true
@@ -425,4 +434,4 @@ DataProcessorSpec getEMCALChannelCalibDeviceSpec(const std::string calibType, co
425434
} // namespace framework
426435
} // namespace o2
427436

428-
#endif
437+
#endif

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
6464
// configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
6565
// o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);
6666
return specs;
67-
}
67+
}

prodtests/full-system-test/aggregator-workflow.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,15 @@ fi
259259
# calibrations for AGGREGATOR_TASKS == CALO_TF
260260
if [[ $AGGREGATOR_TASKS == CALO_TF || $AGGREGATOR_TASKS == ALL ]]; then
261261
# EMC
262+
EMCAL_CALIB_CTP_OPT=
263+
if ! has_detector CTP; then
264+
EMCAL_CALIB_CTP_OPT="--no-rejectL0Trigger"
265+
fi
262266
if [[ $CALIB_EMC_BADCHANNELCALIB == 1 ]]; then
263-
add_W o2-calibration-emcal-channel-calib-workflow "--calibType \"badchannels\""
267+
add_W o2-calibration-emcal-channel-calib-workflow "${EMCAL_CALIB_CTP_OPT} --calibType \"badchannels\""
264268
fi
265269
if [[ $CALIB_EMC_TIMECALIB == 1 ]]; then
266-
add_W o2-calibration-emcal-channel-calib-workflow "--calibType \"time\""
270+
add_W o2-calibration-emcal-channel-calib-workflow "${EMCAL_CALIB_CTP_OPT} --calibType \"time\""
267271
fi
268272

269273
# PHS

0 commit comments

Comments
 (0)