CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EgammaHLTClusterShapeProducer.cc
Go to the documentation of this file.
1 
10 
12 
17 
19 
20  // use configuration file to setup input/output collection names
21  recoEcalCandidateProducer_ = consumes<reco::RecoEcalCandidateCollection>(conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer"));
22 
23  ecalRechitEBTag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEB");
24  ecalRechitEETag_ = conf_.getParameter< edm::InputTag > ("ecalRechitEE");
25  EtaOrIeta_ = conf_.getParameter< bool > ("isIeta");
26 
27  //register your products
28  produces < reco::RecoEcalCandidateIsolationMap >();
29 }
30 
32 {}
33 
35 
37  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
38  desc.add< edm::InputTag >(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit","EcalRecHitsEB"));
39  desc.add< edm::InputTag >(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit","EcalRecHitsEE"));
40  desc.add< bool >(("isIeta"), true);
41  descriptions.add(("hltEgammaHLTClusterShapeProducer"), desc);
42 }
43 
45 
46  // Get the HLT filtered objects
48  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
49 
50  EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBTag_, ecalRechitEETag_ );
51 
53 
54  for(unsigned int iRecoEcalCand = 0; iRecoEcalCand<recoecalcandHandle->size(); iRecoEcalCand++) {
55 
56  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
57 
58  std::vector<float> vCov ;
59  double sigmaee;
60  if (EtaOrIeta_) {
61  vCov = lazyTools.localCovariances( *(recoecalcandref->superCluster()->seed()) );
62  sigmaee = sqrt(vCov[0]);
63  } else {
64  vCov = lazyTools.covariances( *(recoecalcandref->superCluster()->seed()) );
65  sigmaee = sqrt(vCov[0]);
66  double EtaSC = recoecalcandref->eta();
67  if (EtaSC > 1.479) sigmaee = sigmaee - 0.02*(EtaSC - 2.3);
68  }
69 
70  clshMap.insert(recoecalcandref, sigmaee);
71 
72  }
73 
74  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> clushMap(new reco::RecoEcalCandidateIsolationMap(clshMap));
75  iEvent.put(clushMap);
76 }
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
EgammaHLTClusterShapeProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
T sqrt(T t)
Definition: SSEVec.h:48
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void insert(const key_type &k, const data_type &v)
insert an association
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void produce(edm::Event &, const edm::EventSetup &)