CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EgammaHLTR9IDProducer.cc
Go to the documentation of this file.
1 
10 
11 // Framework
18 
21 
25 
27 {
28  // use configuration file to setup input/output collection names
29  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
30  ecalRechitEBTag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEB");
31  ecalRechitEETag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEE");
32  //register your products
33  produces < reco::RecoEcalCandidateIsolationMap >();
34 }
35 
36 
38 
39 
40 //
41 // member functions
42 //
43 
44 // ------------ method called to produce the data ------------
45 void
47 {
48 
49  // Get the HLT filtered objects
51  iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle);
52 
53  EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBTag_, ecalRechitEETag_ );
54 
56 
57  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
58 
59  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand-recoecalcandHandle->begin());
60 
61  float r9 = -1;
62 
63  float e9 = lazyTools.e3x3( *(recoecalcandref->superCluster()->seed()) );
64  float eraw = recoecalcandref->superCluster()->rawEnergy();
65  if (eraw > 0. ) {r9 = e9/eraw;}
66 
67  r9Map.insert(recoecalcandref, r9);
68 
69  }
70 
71  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map));
72  iEvent.put(R9Map);
73 
74 }
75 
76 //define this as a plug-in
77 //DEFINE_FWK_MODULE(EgammaHLTR9IDProducer);
T getParameter(std::string const &) const
float e3x3(const reco::BasicCluster &cluster)
virtual void produce(edm::Event &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
edm::InputTag recoEcalCandidateProducer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
void insert(const key_type &k, const data_type &v)
insert an association
EgammaHLTR9IDProducer(const edm::ParameterSet &)
tuple config
Definition: cmsDriver.py:17