CMS 3D CMS Logo

EcalHaloDataProducer.cc
Go to the documentation of this file.
3 
4 /*
5  [class]: EcalHaloDataProducer
6  [authors]: R. Remington, The University of Florida
7  [description]: See EcalHaloDataProducer.h
8  [date]: October 15, 2009
9 */
10 
11 using namespace edm;
12 using namespace std;
13 using namespace reco;
14 
15 EcalHaloDataProducer::EcalHaloDataProducer(const edm::ParameterSet& iConfig) : EcalAlgo(consumesCollector()) {
16  //RecHit Level
17  IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
18  IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
19  IT_ESRecHit = iConfig.getParameter<edm::InputTag>("ESRecHitLabel");
20  IT_HBHERecHit = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
21 
22  //Higher Level Reco
23  IT_SuperCluster = iConfig.getParameter<edm::InputTag>("SuperClusterLabel");
24  IT_Photon = iConfig.getParameter<edm::InputTag>("PhotonLabel");
25 
26  // Shower Shape cuts for EcalAlgo
27 
28  RoundnessCut = iConfig.getParameter<double>("RoundnessCutParam");
29  AngleCut = iConfig.getParameter<double>("AngleCutParam");
30 
31  EBRecHitEnergyThreshold = (float)iConfig.getParameter<double>("EBRecHitEnergyThresholdParam");
32  EERecHitEnergyThreshold = (float)iConfig.getParameter<double>("EERecHitEnergyThresholdParam");
33  ESRecHitEnergyThreshold = (float)iConfig.getParameter<double>("ESRecHitEnergyThresholdParam");
34  SumEcalEnergyThreshold = (float)iConfig.getParameter<double>("SumEcalEnergyThresholdParam");
35  NHitsEcalThreshold = iConfig.getParameter<int>("NHitsEcalThresholdParam");
36 
37  RoundnessCut = iConfig.getParameter<double>("RoundnessCutParam");
38  AngleCut = iConfig.getParameter<double>("AngleCutParam");
39 
40  ebrechit_token_ = consumes<EBRecHitCollection>(IT_EBRecHit);
41  eerechit_token_ = consumes<EERecHitCollection>(IT_EERecHit);
42  esrechit_token_ = consumes<ESRecHitCollection>(IT_ESRecHit);
43  hbherechit_token_ = consumes<HBHERecHitCollection>(IT_HBHERecHit);
44  supercluster_token_ = consumes<reco::SuperClusterCollection>(IT_SuperCluster);
45  photon_token_ = consumes<reco::PhotonCollection>(IT_Photon);
46  calogeometry_token_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
47 
48  produces<EcalHaloData>();
49 }
50 
52  //Get CaloGeometry
54 
55  //Get EB RecHits
57  // iEvent.getByLabel(IT_EBRecHit, TheEBRecHits);
58  iEvent.getByToken(ebrechit_token_, TheEBRecHits);
59 
60  //Get EE RecHits
62  // iEvent.getByLabel(IT_EERecHit, TheEERecHits);
63  iEvent.getByToken(eerechit_token_, TheEERecHits);
64 
65  //Get ES RecHits
67  // iEvent.getByLabel(IT_ESRecHit, TheESRecHits);
68  iEvent.getByToken(esrechit_token_, TheESRecHits);
69 
70  //Get HBHE RecHits
71  edm::Handle<HBHERecHitCollection> TheHBHERecHits;
72  iEvent.getByToken(hbherechit_token_, TheHBHERecHits);
73 
74  //Get ECAL Barrel SuperClusters
76  // iEvent.getByLabel(IT_SuperCluster, TheSuperClusters);
77  iEvent.getByToken(supercluster_token_, TheSuperClusters);
78 
79  //Get Photons
81  // iEvent.getByLabel(IT_Photon, ThePhotons);
82  iEvent.getByToken(photon_token_, ThePhotons);
83 
84  //Run the EcalHaloAlgo to reconstruct the EcalHaloData object
89 
90  iEvent.put(std::make_unique<EcalHaloData>(EcalAlgo.Calculate(
91  *TheCaloGeometry, ThePhotons, TheSuperClusters, TheEBRecHits, TheEERecHits, TheESRecHits, TheHBHERecHits, iSetup)));
92 
93  return;
94 }
95 
edm::EDGetTokenT< EBRecHitCollection > ebrechit_token_
void SetAngleCut(float a=4.)
Definition: EcalHaloAlgo.h:63
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< EERecHitCollection > eerechit_token_
edm::EDGetTokenT< reco::SuperClusterCollection > supercluster_token_
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::PhotonCollection > photon_token_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > calogeometry_token_
void SetRecHitEnergyThresholds(float EB, float EE, float ES)
Definition: EcalHaloAlgo.h:66
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< ESRecHitCollection > esrechit_token_
void SetPhiWedgeThresholds(float SumE, int nhits)
Definition: EcalHaloAlgo.h:74
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
reco::EcalHaloData Calculate(const CaloGeometry &TheCaloGeometry, edm::Handle< reco::PhotonCollection > &ThePhotons, edm::Handle< reco::SuperClusterCollection > &TheSuperClusters, edm::Handle< EBRecHitCollection > &TheEBRecHits, edm::Handle< EERecHitCollection > &TheEERecHits, edm::Handle< ESRecHitCollection > &TheESRecHits, edm::Handle< HBHERecHitCollection > &TheHBHERecHits, const edm::EventSetup &TheSetup)
Definition: EcalHaloAlgo.cc:32
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
fixed size matrix
HLT enums.
void SetRoundnessCut(float r=100.)
Definition: EcalHaloAlgo.h:61