CMS 3D CMS Logo

EgammaHLTR9IDProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EgammaHLTProducers
4 // Class: EgammaHLTR9IDProducer
5 //
8 //
9 // Original Author: Roberto Covarelli (CERN)
10 // Created: Tue Jun 13 14:48:33 CEST 2006
11 // $Id: EgammaHLTR9Producer.h,v 1.2 2010/06/10 16:19:31 ghezzi Exp $
12 // modified by Chris Tully (Princeton)
13 //
14 //
15 
16 // system include files
17 #include <memory>
18 
19 // user include files
25 
28 
30 
31 // Framework
34 
37 
39 public:
41 
42  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
43  void produce(edm::StreamID sid, edm::Event&, const edm::EventSetup&) const override;
44 
45 private:
46  // ----------member data ---------------------------
47 
52 };
53 
55  : recoEcalCandidateProducer_(consumes(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
56  ecalRechitEBToken_(consumes(config.getParameter<edm::InputTag>("ecalRechitEB"))),
57  ecalRechitEEToken_(consumes(config.getParameter<edm::InputTag>("ecalRechitEE"))),
58  ecalClusterToolsESGetTokens_{consumesCollector()} {
59  //register your products
60  produces<reco::RecoEcalCandidateIsolationMap>();
61  produces<reco::RecoEcalCandidateIsolationMap>("r95x5");
62 }
63 
66  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltRecoEcalCandidate"));
67  desc.add<edm::InputTag>(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEB"));
68  desc.add<edm::InputTag>(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEE"));
69  descriptions.add(("hltEgammaHLTR9IDProducer"), desc);
70 }
71 
72 // ------------ method called to produce the data ------------
74  // Get the HLT filtered objects
76  iEvent.getByToken(recoEcalCandidateProducer_, recoecalcandHandle);
77 
78  auto const& ecalClusterToolsESData = ecalClusterToolsESGetTokens_.get(iSetup);
79  EcalClusterLazyTools lazyTools(iEvent, ecalClusterToolsESData, ecalRechitEBToken_, ecalRechitEEToken_);
80  noZS::EcalClusterLazyTools lazyTools5x5(iEvent, ecalClusterToolsESData, ecalRechitEBToken_, ecalRechitEEToken_);
81  reco::RecoEcalCandidateIsolationMap r9Map(recoecalcandHandle);
82  reco::RecoEcalCandidateIsolationMap r95x5Map(recoecalcandHandle);
83  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
84  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand); //-recoecalcandHandle->begin());
85 
86  float r9 = -1;
87  float r95x5 = -1;
88 
89  float e9 = lazyTools.e3x3(*(recoecalcandref->superCluster()->seed()));
90  float e95x5 = lazyTools5x5.e3x3(*(recoecalcandref->superCluster()->seed()));
91 
92  float eraw = recoecalcandref->superCluster()->rawEnergy();
93  if (eraw > 0.) {
94  r9 = e9 / eraw;
95  r95x5 = e95x5 / eraw;
96  }
97 
98  r9Map.insert(recoecalcandref, r9);
99  r95x5Map.insert(recoecalcandref, r95x5);
100  }
101 
102  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(r9Map));
103 
104  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(r95x5Map), "r95x5");
105 }
106 
RecoEcalCandidateIsolation.h
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
electrons_cff.r9
r9
Definition: electrons_cff.py:360
edm::EDGetTokenT< reco::RecoEcalCandidateCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
EcalClusterLazyTools.h
EgammaHLTR9IDProducer::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTR9IDProducer.cc:48
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
EgammaHLTR9IDProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EgammaHLTR9IDProducer.cc:64
config
Definition: config.py:1
MakerMacros.h
EcalClusterLazyToolsT::e3x3
float e3x3(const reco::BasicCluster &cluster) const
Definition: EcalClusterLazyTools.h:195
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLT_FULL_cff.r9Map
r9Map
Definition: HLT_FULL_cff.py:125474
EcalClusterLazyToolsBase::ESGetTokens
Definition: EcalClusterLazyTools.h:55
ParameterSetDescription.h
EcalClusterLazyTools
EcalSeverityLevelAlgo.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
EcalClusterLazyToolsT
Definition: EcalClusterLazyTools.h:137
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::AssociationMap
Definition: AssociationMap.h:48
EgammaHLTR9IDProducer::ecalClusterToolsESGetTokens_
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
Definition: EgammaHLTR9IDProducer.cc:51
EgammaHLTR9IDProducer::ecalRechitEBToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
Definition: EgammaHLTR9IDProducer.cc:49
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
EcalClusterLazyToolsBase::ESGetTokens::get
ESData get(edm::EventSetup const &eventSetup) const
Definition: EcalClusterLazyTools.h:64
edm::AssociationMap::insert
void insert(const key_type &k, const data_type &v)
insert an association
Definition: AssociationMap.h:166
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
RecoEcalCandidate.h
Frameworkfwd.h
EgammaHLTR9IDProducer::ecalRechitEEToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
Definition: EgammaHLTR9IDProducer.cc:50
EgammaHLTR9IDProducer::EgammaHLTR9IDProducer
EgammaHLTR9IDProducer(const edm::ParameterSet &)
Definition: EgammaHLTR9IDProducer.cc:54
EgammaHLTR9IDProducer
Definition: EgammaHLTR9IDProducer.cc:38
ParameterSet.h
EDProducer.h
EgammaHLTR9IDProducer::produce
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
Definition: EgammaHLTR9IDProducer.cc:73
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15