Skip to content

Commit

Permalink
Merge pull request #34946 from mmusich/Alignment/CommonAlignmentProdu…
Browse files Browse the repository at this point in the history
…cer_migrateToConsumes_11_3_X

[11.3.X] migrate `AlignmentProducer` to event consumes
  • Loading branch information
cmsbuild authored Aug 20, 2021
2 parents 7a50edf + d7ec6bb commit 07247b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ AlignmentProducer::AlignmentProducer(const edm::ParameterSet &config)
: AlignmentProducerBase{config}, maxLoops_{config.getUntrackedParameter<unsigned int>("maxLoops")} {
edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::AlignmentProducer";

// do now all the consumes
trajTrackAssociationCollectionToken_ = consumes<TrajTrackAssociationCollection>(tjTkAssociationMapTag_);
bsToken_ = consumes<reco::BeamSpot>(beamSpotTag_);
tkFittedLasBeamCollectionToken_ = consumes<TkFittedLasBeamCollection>(tkLasBeamTag_);
tsosVectorCollectionToken_ = consumes<TsosVectorCollection>(tkLasBeamTag_);
aliClusterValueMapToken_ = consumes<AliClusterValueMap>(clusterValueMapTag_);

// Tell the framework what data is being produced
if (doTracker_) {
setWhatProduced(this, &AlignmentProducer::produceTracker);
Expand Down
16 changes: 11 additions & 5 deletions Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,39 @@ class AlignmentProducer : public AlignmentProducerBase, public edm::ESProducerLo
bool getAliClusterValueMap(const edm::Event&, edm::Handle<AliClusterValueMap>&) override;

const unsigned int maxLoops_; /// Number of loops to loop

edm::EDGetTokenT<TrajTrackAssociationCollection> trajTrackAssociationCollectionToken_;
edm::EDGetTokenT<reco::BeamSpot> bsToken_;
edm::EDGetTokenT<TkFittedLasBeamCollection> tkFittedLasBeamCollectionToken_;
edm::EDGetTokenT<TsosVectorCollection> tsosVectorCollectionToken_;
edm::EDGetTokenT<AliClusterValueMap> aliClusterValueMapToken_;
};

//------------------------------------------------------------------------------
inline bool AlignmentProducer::getTrajTrackAssociationCollection(const edm::Event& event,
edm::Handle<TrajTrackAssociationCollection>& result) {
return event.getByLabel(tjTkAssociationMapTag_, result);
return event.getByToken(trajTrackAssociationCollectionToken_, result);
}

//------------------------------------------------------------------------------
inline bool AlignmentProducer::getBeamSpot(const edm::Event& event, edm::Handle<reco::BeamSpot>& result) {
return event.getByLabel(beamSpotTag_, result);
return event.getByToken(bsToken_, result);
}

//------------------------------------------------------------------------------
inline bool AlignmentProducer::getTkFittedLasBeamCollection(const edm::Run& run,
edm::Handle<TkFittedLasBeamCollection>& result) {
return run.getByLabel(tkLasBeamTag_, result);
return run.getByToken(tkFittedLasBeamCollectionToken_, result);
}

//------------------------------------------------------------------------------
inline bool AlignmentProducer::getTsosVectorCollection(const edm::Run& run, edm::Handle<TsosVectorCollection>& result) {
return run.getByLabel(tkLasBeamTag_, result);
return run.getByToken(tsosVectorCollectionToken_, result);
}

//------------------------------------------------------------------------------
inline bool AlignmentProducer::getAliClusterValueMap(const edm::Event& event, edm::Handle<AliClusterValueMap>& result) {
return event.getByLabel(clusterValueMapTag_, result);
return event.getByToken(aliClusterValueMapToken_, result);
}

#endif

0 comments on commit 07247b0

Please sign in to comment.