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 
47  : recoEcalCandidateProducer_(
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 
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:41
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:59
MakerMacros.h
EgammaHLTClusterShapeProducer
Definition: EgammaHLTClusterShapeProducer.cc:29
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:68
EgammaHLTClusterShapeProducer::EgammaHLTClusterShapeProducer
EgammaHLTClusterShapeProducer(const edm::ParameterSet &)
Definition: EgammaHLTClusterShapeProducer.cc:46
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
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:43
EgammaHLTClusterShapeProducer::ecalRechitEEToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
Definition: EgammaHLTClusterShapeProducer.cc:42
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:57
EgammaHLTClusterShapeProducer::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTClusterShapeProducer.cc:40