diff --git a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc index e231054798672..882b3b16d4472 100644 --- a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc +++ b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.cc @@ -80,21 +80,22 @@ CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer(const edm::ParameterS produces("MPCSORTED"); if (runME11ILT_ or runME21ILT_) produces(); + + // temporarily switch to a "one" module with a CSCTriggerPrimitivesBuilder data member + builder_ = std::make_unique(config_); } CSCTriggerPrimitivesProducer::~CSCTriggerPrimitivesProducer() {} -void CSCTriggerPrimitivesProducer::produce(edm::StreamID iID, edm::Event& ev, const edm::EventSetup& setup) const { - // Remark: access builder using "streamCache(iID)" - +void CSCTriggerPrimitivesProducer::produce(edm::Event& ev, const edm::EventSetup& setup) { // get the csc geometry edm::ESHandle h = setup.getHandle(cscToken_); - streamCache(iID)->setCSCGeometry(&*h); + builder_->setCSCGeometry(&*h); // get the gem geometry if it's there edm::ESHandle h_gem = setup.getHandle(gemToken_); if (h_gem.isValid()) { - streamCache(iID)->setGEMGeometry(&*h_gem); + builder_->setGEMGeometry(&*h_gem); } else { edm::LogInfo("CSCTriggerPrimitivesProducer|NoGEMGeometry") << "+++ Info: GEM geometry is unavailable. Running CSC-only trigger algorithm. +++\n"; @@ -114,7 +115,7 @@ void CSCTriggerPrimitivesProducer::produce(edm::StreamID iID, edm::Event& ev, co << "+++ Cannot continue emulation without these parameters +++\n"; return; } - streamCache(iID)->setConfigParameters(conf.product()); + builder_->setConfigParameters(conf.product()); } // Get the collections of comparator & wire digis from event. @@ -167,21 +168,21 @@ void CSCTriggerPrimitivesProducer::produce(edm::StreamID iID, edm::Event& ev, co // Fill output collections if valid input collections are available. if (wireDigis.isValid() && compDigis.isValid()) { const CSCBadChambers* temp = checkBadChambers_ ? pBadChambers.product() : new CSCBadChambers; - streamCache(iID)->build(temp, - wireDigis.product(), - compDigis.product(), - gemPads, - gemPadClusters, - *oc_alct, - *oc_alct_all, - *oc_clct, - *oc_clct_all, - *oc_alctpretrigger, - *oc_clctpretrigger, - *oc_pretrig, - *oc_lct, - *oc_sorted_lct, - *oc_gemcopad); + builder_->build(temp, + wireDigis.product(), + compDigis.product(), + gemPads, + gemPadClusters, + *oc_alct, + *oc_alct_all, + *oc_clct, + *oc_clct_all, + *oc_alctpretrigger, + *oc_clctpretrigger, + *oc_pretrig, + *oc_lct, + *oc_sorted_lct, + *oc_gemcopad); if (!checkBadChambers_) delete temp; } diff --git a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h index aec9a79920d58..9b9dba73d64cd 100644 --- a/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h +++ b/L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h @@ -30,7 +30,7 @@ #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/one/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/InputTag.h" @@ -45,20 +45,20 @@ #include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "CondFormats/DataRecord/interface/CSCDBL1TPParametersRcd.h" -class CSCTriggerPrimitivesProducer : public edm::global::EDProducer> { +// temporarily switch to a "one" module with a CSCTriggerPrimitivesBuilder data member +class CSCTriggerPrimitivesProducer : public edm::one::EDProducer<> { public: explicit CSCTriggerPrimitivesProducer(const edm::ParameterSet&); ~CSCTriggerPrimitivesProducer() override; - void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + void produce(edm::Event&, const edm::EventSetup&) override; private: // master configuration edm::ParameterSet config_; - std::unique_ptr beginStream(edm::StreamID) const override { - return std::unique_ptr(new CSCTriggerPrimitivesBuilder(config_)); - } + // temporarily switch to a "one" module with a CSCTriggerPrimitivesBuilder data member + std::unique_ptr builder_; // input tags for input collections edm::InputTag compDigiProducer_;