Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.3.X] migrate AlignmentProducer to event consumes #34946

Merged
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 @@ -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