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  ~EgammaHLTR9IDProducer() override;
42 
43  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
44  void produce(edm::StreamID sid, edm::Event&, const edm::EventSetup&) const override;
45 
46 private:
47  // ----------member data ---------------------------
48 
52 };
53 
55  : recoEcalCandidateProducer_(
56  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
57  ecalRechitEBToken_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ecalRechitEB"))),
58  ecalRechitEEToken_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ecalRechitEE"))) {
59  //register your products
60  produces<reco::RecoEcalCandidateIsolationMap>();
61  produces<reco::RecoEcalCandidateIsolationMap>("r95x5");
62 }
63 
65 
68  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltRecoEcalCandidate"));
69  desc.add<edm::InputTag>(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEB"));
70  desc.add<edm::InputTag>(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEE"));
71  descriptions.add(("hltEgammaHLTR9IDProducer"), desc);
72 }
73 
74 // ------------ method called to produce the data ------------
76  // Get the HLT filtered objects
78  iEvent.getByToken(recoEcalCandidateProducer_, recoecalcandHandle);
79 
82  reco::RecoEcalCandidateIsolationMap r9Map(recoecalcandHandle);
83  reco::RecoEcalCandidateIsolationMap r95x5Map(recoecalcandHandle);
84  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
85  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand); //-recoecalcandHandle->begin());
86 
87  float r9 = -1;
88  float r95x5 = -1;
89 
90  float e9 = lazyTools.e3x3(*(recoecalcandref->superCluster()->seed()));
91  float e95x5 = lazyTools5x5.e3x3(*(recoecalcandref->superCluster()->seed()));
92 
93  float eraw = recoecalcandref->superCluster()->rawEnergy();
94  if (eraw > 0.) {
95  r9 = e9 / eraw;
96  r95x5 = e95x5 / eraw;
97  }
98 
99  r9Map.insert(recoecalcandref, r9);
100  r95x5Map.insert(recoecalcandref, r95x5);
101  }
102 
103  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(r9Map));
104 
105  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(r95x5Map), "r95x5");
106 }
107 
RecoEcalCandidateIsolation.h
ConfigurationDescriptions.h
EgammaHLTR9IDProducer::~EgammaHLTR9IDProducer
~EgammaHLTR9IDProducer() override
Definition: EgammaHLTR9IDProducer.cc:64
edm::StreamID
Definition: StreamID.h:30
electrons_cff.r9
r9
Definition: electrons_cff.py:366
reco::RecoEcalCandidateCollection
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
Definition: RecoEcalCandidateFwd.h:9
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::EDGetTokenT< reco::RecoEcalCandidateCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::SortedCollection< EcalRecHit >
EcalClusterLazyTools.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
EgammaHLTR9IDProducer::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTR9IDProducer.cc:49
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
EgammaHLTR9IDProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EgammaHLTR9IDProducer.cc:66
config
Definition: config.py:1
MakerMacros.h
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
ParameterSetDescription.h
EcalClusterLazyTools
EcalSeverityLevelAlgo.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
EcalClusterLazyToolsT
Definition: EcalClusterLazyTools.h:105
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
edm::AssociationMap
Definition: AssociationMap.h:48
EgammaHLTR9IDProducer::ecalRechitEBToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
Definition: EgammaHLTR9IDProducer.cc:50
EcalClusterLazyToolsT::e3x3
float e3x3(const reco::BasicCluster &cluster)
Definition: EcalClusterLazyTools.h:163
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
edm::AssociationMap::insert
void insert(const key_type &k, const data_type &v)
insert an association
Definition: AssociationMap.h:166
RecoEcalCandidate.h
Frameworkfwd.h
EgammaHLTR9IDProducer::ecalRechitEEToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
Definition: EgammaHLTR9IDProducer.cc:51
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:75
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15