diff --git a/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h b/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h index ee50dfb03bb6d..ca30bee08ea73 100644 --- a/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h +++ b/Detectors/EMCAL/workflow/include/EMCALWorkflow/EMCALDigitizerSpec.h @@ -57,7 +57,7 @@ class DigitizerSpec final : public o2::base::BaseDPLDigitizer, public o2::framew public: using o2::base::BaseDPLDigitizer::init; /// \brief Constructor - DigitizerSpec(std::shared_ptr calibloader, bool requireCTPInput) : o2::base::BaseDPLDigitizer(o2::base::InitServices::GEOM), o2::framework::Task(), mRequireCTPInput(requireCTPInput), mCalibHandler(calibloader) {} + DigitizerSpec(std::shared_ptr calibloader, bool requireCTPInput, const o2::detectors::DetID::mask_t& detMask) : o2::base::BaseDPLDigitizer(o2::base::InitServices::GEOM), o2::framework::Task(), mRequireCTPInput(requireCTPInput), mDetMask(detMask), mCalibHandler(calibloader) {} /// \brief Destructor ~DigitizerSpec() final = default; @@ -90,6 +90,7 @@ class DigitizerSpec final : public o2::base::BaseDPLDigitizer, public o2::framew std::vector mHits; ///< Vector with input hits std::vector mSimChains; o2::ctp::CTPConfiguration* mCTPConfig; ///< CTP configuration + o2::detectors::DetID::mask_t mDetMask; ///< to keep track whether FT0 and FV0 are included o2::steer::MCKinematicsReader* mcReader; ///< reader to access MC collision information DigitizerTRU mDigitizerTRU; ///< Digitizer object TRU @@ -99,7 +100,7 @@ class DigitizerSpec final : public o2::base::BaseDPLDigitizer, public o2::framew /// \brief Create new digitizer spec /// \return Digitizer spec -o2::framework::DataProcessorSpec getEMCALDigitizerSpec(int channel, bool requireCTPInput, bool mctruth = true, bool useccdb = true); +o2::framework::DataProcessorSpec getEMCALDigitizerSpec(int channel, bool requireCTPInput, const std::vector& detList, bool mctruth = true, bool useccdb = true); } // namespace emcal } // end namespace o2 diff --git a/Detectors/EMCAL/workflow/src/EMCALDigitizerSpec.cxx b/Detectors/EMCAL/workflow/src/EMCALDigitizerSpec.cxx index cabdb2c74d818..d45be5e7880f4 100644 --- a/Detectors/EMCAL/workflow/src/EMCALDigitizerSpec.cxx +++ b/Detectors/EMCAL/workflow/src/EMCALDigitizerSpec.cxx @@ -248,15 +248,19 @@ void DigitizerSpec::run(framework::ProcessingContext& ctx) } LOG(debug) << "FTO mask: " << std::bitset<64>(ft0mask); LOG(debug) << "FVO mask: " << std::bitset<64>(fv0mask); - for (const auto& trg : ctx.inputs().get>("ft0inputs")) { - if (trg.mInputs.to_ulong() & ft0mask) { - mbtriggers.emplace_back(trg.mIntRecord); + if (mDetMask[o2::detectors::DetID::FT0]) { + for (const auto& trg : ctx.inputs().get>("ft0inputs")) { + if (trg.mInputs.to_ulong() & ft0mask) { + mbtriggers.emplace_back(trg.mIntRecord); + } } } - for (const auto& trg : ctx.inputs().get>("fv0inputs")) { - if (trg.mInputs.to_ulong() & fv0mask) { - if (std::find(mbtriggers.begin(), mbtriggers.end(), trg.mIntRecord) == mbtriggers.end()) { - mbtriggers.emplace_back(trg.mIntRecord); + if (mDetMask[o2::detectors::DetID::FV0]) { + for (const auto& trg : ctx.inputs().get>("fv0inputs")) { + if (trg.mInputs.to_ulong() & fv0mask) { + if (std::find(mbtriggers.begin(), mbtriggers.end(), trg.mIntRecord) == mbtriggers.end()) { + mbtriggers.emplace_back(trg.mIntRecord); + } } } } @@ -460,7 +464,7 @@ void DigitizerSpec::finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, vo } } -o2::framework::DataProcessorSpec getEMCALDigitizerSpec(int channel, bool requireCTPInput, bool mctruth, bool useccdb) +o2::framework::DataProcessorSpec getEMCALDigitizerSpec(int channel, bool requireCTPInput, const std::vector& detList, bool mctruth, bool useccdb) { // create the full data processor spec using // a name identifier @@ -485,9 +489,16 @@ o2::framework::DataProcessorSpec getEMCALDigitizerSpec(int channel, bool require calibloader->enableFEEDCS(true); calibloader->defineInputSpecs(inputs); } + o2::detectors::DetID::mask_t detMask; if (requireCTPInput) { - inputs.emplace_back("ft0inputs", "FT0", "TRIGGERINPUT", 0, Lifetime::Timeframe); - inputs.emplace_back("fv0inputs", "FV0", "TRIGGERINPUT", 0, Lifetime::Timeframe); + if (std::find(detList.begin(), detList.end(), o2::detectors::DetID::FT0) != detList.end()) { + detMask.set(o2::detectors::DetID::FT0); + inputs.emplace_back("ft0inputs", "FT0", "TRIGGERINPUT", 0, Lifetime::Timeframe); + } + if (std::find(detList.begin(), detList.end(), o2::detectors::DetID::FV0) != detList.end()) { + detMask.set(o2::detectors::DetID::FV0); + inputs.emplace_back("fv0inputs", "FV0", "TRIGGERINPUT", 0, Lifetime::Timeframe); + } inputs.emplace_back("ctpconfig", "CTP", "CTPCONFIG", 0, Lifetime::Condition, ccdbParamSpec("CTP/Config/Config", true)); } @@ -495,7 +506,7 @@ o2::framework::DataProcessorSpec getEMCALDigitizerSpec(int channel, bool require "EMCALDigitizer", // Inputs{InputSpec{"collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast(channel), Lifetime::Timeframe}, InputSpec{"EMC_SimParam", o2::header::gDataOriginEMC, "SIMPARAM", 0, Lifetime::Condition, ccdbParamSpec("EMC/Config/SimParam")}}, inputs, outputs, - AlgorithmSpec{o2::framework::adaptFromTask(calibloader, requireCTPInput)}, + AlgorithmSpec{o2::framework::adaptFromTask(calibloader, requireCTPInput, detMask)}, Options{ {"pileup", VariantType::Int, 1, {"whether to run in continuous time mode"}}, {"disable-dig-tru", VariantType::Bool, false, {"Disable TRU digitisation"}}, diff --git a/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx b/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx index 7ba04725d928b..b38fd9e1d0134 100644 --- a/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx +++ b/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx @@ -739,7 +739,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) bool requireCTPInputs = !configcontext.options().get("no-require-ctpinputs-emc"); detList.emplace_back(o2::detectors::DetID::EMC); // connect the EMCal digitization - digitizerSpecs.emplace_back(o2::emcal::getEMCALDigitizerSpec(fanoutsize++, requireCTPInputs, mctruth, useCCDB)); + digitizerSpecs.emplace_back(o2::emcal::getEMCALDigitizerSpec(fanoutsize++, requireCTPInputs, detList, mctruth, useCCDB)); // connect the EMCal digit writer writerSpecs.emplace_back(o2::emcal::getEMCALDigitWriterSpec(mctruth)); }