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 
27 
29 public:
32 
33  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
34  void produce(edm::StreamID sid, edm::Event&, const edm::EventSetup&) const override;
35 
36 private:
37  // ----------member data ---------------------------
38 
42  const bool EtaOrIeta_;
43 };
44 
46  : recoEcalCandidateProducer_(
47  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
48  ecalRechitEBToken_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ecalRechitEB"))),
49  ecalRechitEEToken_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ecalRechitEE"))),
50  EtaOrIeta_(config.getParameter<bool>("isIeta")) {
51  //register your products
52  produces<reco::RecoEcalCandidateIsolationMap>();
53  produces<reco::RecoEcalCandidateIsolationMap>("sigmaIEtaIEta5x5");
54 }
55 
57 
60  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
61  desc.add<edm::InputTag>(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEB"));
62  desc.add<edm::InputTag>(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEE"));
63  desc.add<bool>(("isIeta"), true);
64  descriptions.add(("hltEgammaHLTClusterShapeProducer"), desc);
65 }
66 
69  const edm::EventSetup& iSetup) const {
70  // Get the HLT filtered objects
72  iEvent.getByToken(recoEcalCandidateProducer_, recoecalcandHandle);
73 
76 
77  reco::RecoEcalCandidateIsolationMap clshMap(recoecalcandHandle);
78  reco::RecoEcalCandidateIsolationMap clsh5x5Map(recoecalcandHandle);
79 
80  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
81  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
82  if (recoecalcandref->superCluster()->seed()->seed().det() != DetId::Ecal) { //HGCAL, skip for now
83  clshMap.insert(recoecalcandref, 0);
84  clsh5x5Map.insert(recoecalcandref, 0);
85  continue;
86  }
87 
88  std::vector<float> vCov;
89  double sigmaee;
90  if (EtaOrIeta_) {
91  vCov = lazyTools.localCovariances(*(recoecalcandref->superCluster()->seed()));
92  sigmaee = sqrt(vCov[0]);
93  } else {
94  vCov = lazyTools.covariances(*(recoecalcandref->superCluster()->seed()));
95  sigmaee = sqrt(vCov[0]);
96  double EtaSC = recoecalcandref->eta();
97  if (EtaSC > 1.479)
98  sigmaee = sigmaee - 0.02 * (EtaSC - 2.3);
99  }
100 
101  double sigmaee5x5 = sqrt(lazyTools5x5.localCovariances(*(recoecalcandref->superCluster()->seed()))[0]);
102  clshMap.insert(recoecalcandref, sigmaee);
103  clsh5x5Map.insert(recoecalcandref, sigmaee5x5);
104  }
105 
106  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clshMap));
107  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clsh5x5Map), "sigmaIEtaIEta5x5");
108 }
109 
RecoEcalCandidateIsolation.h
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
reco::RecoEcalCandidateCollection
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
Definition: RecoEcalCandidateFwd.h:9
EcalClusterLazyToolsT::localCovariances
std::vector< float > localCovariances(const reco::BasicCluster &cluster, float w0=4.7)
Definition: EcalClusterLazyTools.h:252
EgammaHLTClusterShapeProducer::ecalRechitEBToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
Definition: EgammaHLTClusterShapeProducer.cc:40
electrons_cff.bool
bool
Definition: electrons_cff.py:372
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
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
config
Definition: config.py:1
EgammaHLTClusterShapeProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EgammaHLTClusterShapeProducer.cc:58
MakerMacros.h
EgammaHLTClusterShapeProducer
Definition: EgammaHLTClusterShapeProducer.cc:28
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
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EgammaHLTClusterShapeProducer::produce
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
Definition: EgammaHLTClusterShapeProducer.cc:67
EgammaHLTClusterShapeProducer::EgammaHLTClusterShapeProducer
EgammaHLTClusterShapeProducer(const edm::ParameterSet &)
Definition: EgammaHLTClusterShapeProducer.cc:45
ParameterSetDescription.h
EcalClusterLazyTools
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
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
DetId::Ecal
Definition: DetId.h:27
edm::AssociationMap::insert
void insert(const key_type &k, const data_type &v)
insert an association
Definition: AssociationMap.h:166
RecoEcalCandidate.h
EgammaHLTClusterShapeProducer::EtaOrIeta_
const bool EtaOrIeta_
Definition: EgammaHLTClusterShapeProducer.cc:42
EgammaHLTClusterShapeProducer::ecalRechitEEToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
Definition: EgammaHLTClusterShapeProducer.cc:41
Frameworkfwd.h
SuperCluster.h
RecoEcalCandidateFwd.h
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
EgammaHLTClusterShapeProducer::~EgammaHLTClusterShapeProducer
~EgammaHLTClusterShapeProducer() override
Definition: EgammaHLTClusterShapeProducer.cc:56
EgammaHLTClusterShapeProducer::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTClusterShapeProducer.cc:39