diff --git a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc index 1b8d0f84cf226..6c4657564901f 100644 --- a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc +++ b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc @@ -14,6 +14,13 @@ AlignmentProducer::AlignmentProducer(const edm::ParameterSet &config) : AlignmentProducerBase{config}, maxLoops_{config.getUntrackedParameter("maxLoops")} { edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::AlignmentProducer"; + // do now all the consumes + trajTrackAssociationCollectionToken_ = consumes(tjTkAssociationMapTag_); + bsToken_ = consumes(beamSpotTag_); + tkFittedLasBeamCollectionToken_ = consumes(tkLasBeamTag_); + tsosVectorCollectionToken_ = consumes(tkLasBeamTag_); + aliClusterValueMapToken_ = consumes(clusterValueMapTag_); + // Tell the framework what data is being produced if (doTracker_) { setWhatProduced(this, &AlignmentProducer::produceTracker); diff --git a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h index a1af0d1c715a8..1935874cca559 100644 --- a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h +++ b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h @@ -58,33 +58,39 @@ class AlignmentProducer : public AlignmentProducerBase, public edm::ESProducerLo bool getAliClusterValueMap(const edm::Event&, edm::Handle&) override; const unsigned int maxLoops_; /// Number of loops to loop + + edm::EDGetTokenT trajTrackAssociationCollectionToken_; + edm::EDGetTokenT bsToken_; + edm::EDGetTokenT tkFittedLasBeamCollectionToken_; + edm::EDGetTokenT tsosVectorCollectionToken_; + edm::EDGetTokenT aliClusterValueMapToken_; }; //------------------------------------------------------------------------------ inline bool AlignmentProducer::getTrajTrackAssociationCollection(const edm::Event& event, edm::Handle& result) { - return event.getByLabel(tjTkAssociationMapTag_, result); + return event.getByToken(trajTrackAssociationCollectionToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getBeamSpot(const edm::Event& event, edm::Handle& result) { - return event.getByLabel(beamSpotTag_, result); + return event.getByToken(bsToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getTkFittedLasBeamCollection(const edm::Run& run, edm::Handle& result) { - return run.getByLabel(tkLasBeamTag_, result); + return run.getByToken(tkFittedLasBeamCollectionToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getTsosVectorCollection(const edm::Run& run, edm::Handle& result) { - return run.getByLabel(tkLasBeamTag_, result); + return run.getByToken(tsosVectorCollectionToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getAliClusterValueMap(const edm::Event& event, edm::Handle& result) { - return event.getByLabel(clusterValueMapTag_, result); + return event.getByToken(aliClusterValueMapToken_, result); } #endif