Skip to content

Commit

Permalink
added esConsumes to modules in RecoLocalCalo/Castor
Browse files Browse the repository at this point in the history
  • Loading branch information
JamminJones committed Jul 10, 2020
1 parent 4227922 commit 22da7c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RecoLocalCalo/Castor/src/CastorTowerProducer.cc
Expand Up @@ -31,6 +31,7 @@
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "DataFormats/Math/interface/Point3D.h"

// Castor Object include
Expand Down Expand Up @@ -66,6 +67,7 @@ class CastorTowerProducer : public edm::stream::EDProducer<> {
typedef std::vector<reco::CastorTower> CastorTowerCollection;
typedef edm::RefVector<CastorRecHitCollection> CastorRecHitRefVector;
edm::EDGetTokenT<CastorRecHitCollection> tok_input_;
edm::ESGetToken<CastorChannelQuality, CastorChannelQualityRcd> tok_channelQuality_;
double towercut_;
double mintime_;
double maxtime_;
Expand All @@ -88,6 +90,7 @@ CastorTowerProducer::CastorTowerProducer(const edm::ParameterSet& iConfig)
mintime_(iConfig.getParameter<double>("mintime")),
maxtime_(iConfig.getParameter<double>("maxtime")) {
tok_input_ = consumes<CastorRecHitCollection>(iConfig.getParameter<std::string>("inputprocess"));
tok_channelQuality_ = esConsumes<CastorChannelQuality, CastorChannelQualityRcd>();
//register your products
produces<CastorTowerCollection>();
//now do what ever other initialization is needed
Expand Down Expand Up @@ -146,8 +149,7 @@ void CastorTowerProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe
}

// retrieve the channel quality lists from database
edm::ESHandle<CastorChannelQuality> p;
iSetup.get<CastorChannelQualityRcd>().get(p);
edm::ESHandle<CastorChannelQuality> p = iSetup.getHandle(tok_channelQuality_);
std::vector<DetId> channels = p->getAllChannels();

// loop over rechits to build castortowerarray[4][16] and castorusedrechits[16]
Expand Down

0 comments on commit 22da7c6

Please sign in to comment.