CMS 3D CMS Logo

EgammaHLTClusterShapeProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EgammaHLTProducers
4 // Class: EgammaHLTClusterShapeProducer
5 //
8 //
9 // Original Author: Roberto Covarelli (CERN)
10 // Created: Tue Jun 13 14:48:33 CEST 2006
11 // $Id: EgammaHLTClusterShapeProducer.h,v 1.1 2009/01/15 14:28:27 covarell Exp $
12 //
13 //
14 
15 // user include files
28 
30 public:
33 
34  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
35  void produce(edm::StreamID sid, edm::Event&, const edm::EventSetup&) const override;
36 
37 private:
38  // ----------member data ---------------------------
39 
43  const bool EtaOrIeta_;
44 };
45 
48  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
49  ecalRechitEBToken_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ecalRechitEB"))),
50  ecalRechitEEToken_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ecalRechitEE"))),
51  EtaOrIeta_(config.getParameter<bool>("isIeta")) {
52  //register your products
53  produces<reco::RecoEcalCandidateIsolationMap>();
54  produces<reco::RecoEcalCandidateIsolationMap>("sigmaIEtaIEta5x5");
55 }
56 
58 
61  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
62  desc.add<edm::InputTag>(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEB"));
63  desc.add<edm::InputTag>(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEE"));
64  desc.add<bool>(("isIeta"), true);
65  descriptions.add(("hltEgammaHLTClusterShapeProducer"), desc);
66 }
67 
70  const edm::EventSetup& iSetup) const {
71  // Get the HLT filtered objects
73  iEvent.getByToken(recoEcalCandidateProducer_, recoecalcandHandle);
74 
77 
78  reco::RecoEcalCandidateIsolationMap clshMap(recoecalcandHandle);
79  reco::RecoEcalCandidateIsolationMap clsh5x5Map(recoecalcandHandle);
80 
81  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
82  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
83 
84  std::vector<float> vCov;
85  double sigmaee;
86  if (EtaOrIeta_) {
87  vCov = lazyTools.localCovariances(*(recoecalcandref->superCluster()->seed()));
88  sigmaee = sqrt(vCov[0]);
89  } else {
90  vCov = lazyTools.covariances(*(recoecalcandref->superCluster()->seed()));
91  sigmaee = sqrt(vCov[0]);
92  double EtaSC = recoecalcandref->eta();
93  if (EtaSC > 1.479)
94  sigmaee = sigmaee - 0.02 * (EtaSC - 2.3);
95  }
96 
97  double sigmaee5x5 = sqrt(lazyTools5x5.localCovariances(*(recoecalcandref->superCluster()->seed()))[0]);
98  clshMap.insert(recoecalcandref, sigmaee);
99  clsh5x5Map.insert(recoecalcandref, sigmaee5x5);
100  }
101 
102  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clshMap));
103  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clsh5x5Map), "sigmaIEtaIEta5x5");
104 }
105 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: config.py:1
EgammaHLTClusterShapeProducer(const edm::ParameterSet &)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
T sqrt(T t)
Definition: SSEVec.h:19
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_