CMS 3D CMS Logo

EgammaHLTClusterShapeProducer.cc
Go to the documentation of this file.
1 
10 
12 
17 
19  recoEcalCandidateProducer_(consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
20  ecalRechitEBToken_(consumes<EcalRecHitCollection>(config.getParameter< edm::InputTag > ("ecalRechitEB"))),
21  ecalRechitEEToken_(consumes<EcalRecHitCollection>(config.getParameter< edm::InputTag > ("ecalRechitEE"))),
22  EtaOrIeta_(config.getParameter< bool > ("isIeta")) {
23 
24  //register your products
25  produces < reco::RecoEcalCandidateIsolationMap >();
26  produces < reco::RecoEcalCandidateIsolationMap >("sigmaIEtaIEta5x5");
27 }
28 
30 {}
31 
33 
35  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
36  desc.add< edm::InputTag >(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit","EcalRecHitsEB"));
37  desc.add< edm::InputTag >(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit","EcalRecHitsEE"));
38  desc.add< bool >(("isIeta"), true);
39  descriptions.add(("hltEgammaHLTClusterShapeProducer"), desc);
40 }
41 
43 
44  // Get the HLT filtered objects
46  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
47 
48  EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBToken_, ecalRechitEEToken_ );
50 
51  reco::RecoEcalCandidateIsolationMap clshMap(recoecalcandHandle);
52  reco::RecoEcalCandidateIsolationMap clsh5x5Map(recoecalcandHandle);
53 
54 
55  for(unsigned int iRecoEcalCand = 0; iRecoEcalCand<recoecalcandHandle->size(); iRecoEcalCand++) {
56 
57  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
58 
59  std::vector<float> vCov ;
60  double sigmaee;
61  if (EtaOrIeta_) {
62  vCov = lazyTools.localCovariances( *(recoecalcandref->superCluster()->seed()) );
63  sigmaee = sqrt(vCov[0]);
64  } else {
65  vCov = lazyTools.covariances( *(recoecalcandref->superCluster()->seed()) );
66  sigmaee = sqrt(vCov[0]);
67  double EtaSC = recoecalcandref->eta();
68  if (EtaSC > 1.479) sigmaee = sigmaee - 0.02*(EtaSC - 2.3);
69  }
70 
71  double sigmaee5x5 = sqrt(lazyTools5x5.localCovariances(*(recoecalcandref->superCluster()->seed()) )[0]);
72  clshMap.insert(recoecalcandref, sigmaee);
73  clsh5x5Map.insert(recoecalcandref,sigmaee5x5);
74 
75 
76  }
77 
78  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clshMap));
79  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clsh5x5Map),"sigmaIEtaIEta5x5");
80 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: config.py:1
EgammaHLTClusterShapeProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:224
T sqrt(T t)
Definition: SSEVec.h:18
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void insert(const key_type &k, const data_type &v)
insert an association
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
fixed size matrix
HLT enums.
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
std::vector< float > localCovariances(const reco::BasicCluster &cluster, float w0=4.7)
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_