Skip to content
Closed
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 @@ -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> calibloader, bool requireCTPInput) : o2::base::BaseDPLDigitizer(o2::base::InitServices::GEOM), o2::framework::Task(), mRequireCTPInput(requireCTPInput), mCalibHandler(calibloader) {}
DigitizerSpec(std::shared_ptr<CalibLoader> 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;
Expand Down Expand Up @@ -90,6 +90,7 @@ class DigitizerSpec final : public o2::base::BaseDPLDigitizer, public o2::framew
std::vector<Hit> mHits; ///< Vector with input hits
std::vector<TChain*> 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
Expand All @@ -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<o2::detectors::DetID>& detList, bool mctruth = true, bool useccdb = true);

} // namespace emcal
} // end namespace o2
Expand Down
33 changes: 22 additions & 11 deletions Detectors/EMCAL/workflow/src/EMCALDigitizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<gsl::span<o2::ft0::DetTrigInput>>("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<gsl::span<o2::ft0::DetTrigInput>>("ft0inputs")) {
if (trg.mInputs.to_ulong() & ft0mask) {
mbtriggers.emplace_back(trg.mIntRecord);
}
}
}
for (const auto& trg : ctx.inputs().get<gsl::span<o2::fv0::DetTrigInput>>("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<gsl::span<o2::fv0::DetTrigInput>>("fv0inputs")) {
if (trg.mInputs.to_ulong() & fv0mask) {
if (std::find(mbtriggers.begin(), mbtriggers.end(), trg.mIntRecord) == mbtriggers.end()) {
mbtriggers.emplace_back(trg.mIntRecord);
}
}
}
}
Expand Down Expand Up @@ -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<o2::detectors::DetID>& detList, bool mctruth, bool useccdb)
{
// create the full data processor spec using
// a name identifier
Expand All @@ -485,17 +489,24 @@ 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));
}

return DataProcessorSpec{
"EMCALDigitizer", // Inputs{InputSpec{"collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast<SubSpecificationType>(channel), Lifetime::Timeframe}, InputSpec{"EMC_SimParam", o2::header::gDataOriginEMC, "SIMPARAM", 0, Lifetime::Condition, ccdbParamSpec("EMC/Config/SimParam")}},
inputs,
outputs,
AlgorithmSpec{o2::framework::adaptFromTask<DigitizerSpec>(calibloader, requireCTPInput)},
AlgorithmSpec{o2::framework::adaptFromTask<DigitizerSpec>(calibloader, requireCTPInput, detMask)},
Options{
{"pileup", VariantType::Int, 1, {"whether to run in continuous time mode"}},
{"disable-dig-tru", VariantType::Bool, false, {"Disable TRU digitisation"}},
Expand Down
2 changes: 1 addition & 1 deletion Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
bool requireCTPInputs = !configcontext.options().get<bool>("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));
}
Expand Down
Loading