CMS 3D CMS Logo

HcalHaloDataProducer.cc
Go to the documentation of this file.
3 
4 /*
5  [class]: HcalHaloDataProducer
6  [authors]: R. Remington, The University of Florida
7  [description]: See HcalHaloDataProducer.h
8  [date]: October 15, 2009
9 */
10 
11 using namespace edm;
12 using namespace std;
13 using namespace reco;
14 
15 HcalHaloDataProducer::HcalHaloDataProducer(const edm::ParameterSet& iConfig) {
16  //RecHit Level
17  IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
18  IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
19  IT_HBHERecHit = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
20  IT_HFRecHit = iConfig.getParameter<edm::InputTag>("HFRecHitLabel");
21  IT_HORecHit = iConfig.getParameter<edm::InputTag>("HORecHitLabel");
22  IT_CaloTowers = iConfig.getParameter<edm::InputTag>("caloTowerCollName");
23 
24  HBRecHitEnergyThreshold = (float)iConfig.getParameter<double>("HBRecHitEnergyThresholdParam");
25  HERecHitEnergyThreshold = (float)iConfig.getParameter<double>("HERecHitEnergyThresholdParam");
26  SumHcalEnergyThreshold = (float)iConfig.getParameter<double>("SumHcalEnergyThresholdParam");
27  NHitsHcalThreshold = iConfig.getParameter<int>("NHitsHcalThresholdParam");
28 
29  ebrechit_token_ = consumes<EBRecHitCollection>(IT_EBRecHit);
30  eerechit_token_ = consumes<EERecHitCollection>(IT_EERecHit);
31  hbherechit_token_ = consumes<HBHERecHitCollection>(IT_HBHERecHit);
32  hfrechit_token_ = consumes<HFRecHitCollection>(IT_HFRecHit);
33  calotower_token_ = consumes<CaloTowerCollection>(IT_CaloTowers);
34 
35  produces<HcalHaloData>();
36 }
37 
38 void HcalHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup) {
39  //Get CaloGeometry
40  edm::ESHandle<CaloGeometry> TheCaloGeometry;
41  iSetup.get<CaloGeometryRecord>().get(TheCaloGeometry);
42 
43  //Get CaloTowers
45  iEvent.getByToken(calotower_token_, TheCaloTowers);
46 
47  //Get EB RecHits
49  iEvent.getByToken(ebrechit_token_, TheEBRecHits);
50 
51  //Get EE RecHits
53  iEvent.getByToken(eerechit_token_, TheEERecHits);
54 
55  //Get HB/HE RecHits
56  edm::Handle<HBHERecHitCollection> TheHBHERecHits;
57  // iEvent.getByLabel(IT_HBHERecHit, TheHBHERecHits);
58  iEvent.getByToken(hbherechit_token_, TheHBHERecHits);
59 
60  //Get HF RecHits
62  // iEvent.getByLabel(IT_HFRecHit, TheHFRecHits);
63  iEvent.getByToken(hfrechit_token_, TheHFRecHits);
64 
65  // Run the HcalHaloAlgo to reconstruct the HcalHaloData object
66  HcalHaloAlgo HcalAlgo;
67  HcalAlgo.SetRecHitEnergyThresholds(HBRecHitEnergyThreshold, HERecHitEnergyThreshold);
68  HcalAlgo.SetPhiWedgeThresholds(SumHcalEnergyThreshold, NHitsHcalThreshold);
69 
70  iEvent.put(std::make_unique<HcalHaloData>(
71  HcalAlgo.Calculate(*TheCaloGeometry, TheHBHERecHits, TheCaloTowers, TheEBRecHits, TheEERecHits, iSetup)));
72  return;
73 }
74 
75 HcalHaloDataProducer::~HcalHaloDataProducer() {}
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
HcalHaloDataProducer.h
HcalHaloAlgo::SetRecHitEnergyThresholds
void SetRecHitEnergyThresholds(float HB, float HE)
Definition: HcalHaloAlgo.h:61
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ESHandle< CaloGeometry >
edm::ParameterSet
Definition: ParameterSet.h:36
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:669
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
HcalHaloAlgo::SetPhiWedgeThresholds
void SetPhiWedgeThresholds(float SumE, int nhits)
Definition: HcalHaloAlgo.h:69
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
std
Definition: JetResolutionObject.h:76
ConsumesCollector.h
edm::Event
Definition: Event.h:73
HcalHaloAlgo
Definition: HcalHaloAlgo.h:39
edm::InputTag
Definition: InputTag.h:15
HcalHaloAlgo::Calculate
reco::HcalHaloData Calculate(const CaloGeometry &TheCaloGeometry, edm::Handle< HBHERecHitCollection > &TheHBHERecHits, edm::Handle< CaloTowerCollection > &TheCaloTowers, edm::Handle< EBRecHitCollection > &TheEBRecHits, edm::Handle< EERecHitCollection > &TheEERecHits, const edm::EventSetup &TheSetup)
Definition: HcalHaloAlgo.cc:39