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 
43  const bool EtaOrIeta_;
44 };
45 
47  : recoEcalCandidateProducer_(consumes(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
48  ecalRechitEBToken_(consumes(config.getParameter<edm::InputTag>("ecalRechitEB"))),
49  ecalRechitEEToken_(consumes(config.getParameter<edm::InputTag>("ecalRechitEE"))),
50  ecalClusterLazyToolsESGetTokens_{consumesCollector()},
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 
75  auto const& ecalClusterLazyToolsESData = ecalClusterLazyToolsESGetTokens_.get(iSetup);
76 
77  EcalClusterLazyTools lazyTools(iEvent, ecalClusterLazyToolsESData, ecalRechitEBToken_, ecalRechitEEToken_);
78  noZS::EcalClusterLazyTools lazyTools5x5(iEvent, ecalClusterLazyToolsESData, ecalRechitEBToken_, ecalRechitEEToken_);
79 
80  reco::RecoEcalCandidateIsolationMap clshMap(recoecalcandHandle);
81  reco::RecoEcalCandidateIsolationMap clsh5x5Map(recoecalcandHandle);
82 
83  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
84  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
85  if (recoecalcandref->superCluster()->seed()->seed().det() != DetId::Ecal) { //HGCAL, skip for now
86  clshMap.insert(recoecalcandref, 0);
87  clsh5x5Map.insert(recoecalcandref, 0);
88  continue;
89  }
90 
91  std::vector<float> vCov;
92  double sigmaee;
93  if (EtaOrIeta_) {
94  vCov = lazyTools.localCovariances(*(recoecalcandref->superCluster()->seed()));
95  sigmaee = sqrt(vCov[0]);
96  } else {
97  vCov = lazyTools.covariances(*(recoecalcandref->superCluster()->seed()));
98  sigmaee = sqrt(vCov[0]);
99  double EtaSC = recoecalcandref->eta();
100  if (EtaSC > 1.479)
101  sigmaee = sigmaee - 0.02 * (EtaSC - 2.3);
102  }
103 
104  double sigmaee5x5 = sqrt(lazyTools5x5.localCovariances(*(recoecalcandref->superCluster()->seed()))[0]);
105  clshMap.insert(recoecalcandref, sigmaee);
106  clsh5x5Map.insert(recoecalcandref, sigmaee5x5);
107  }
108 
109  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clshMap));
110  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clsh5x5Map), "sigmaIEtaIEta5x5");
111 }
112 
RecoEcalCandidateIsolation.h
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
EgammaHLTClusterShapeProducer::ecalRechitEBToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
Definition: EgammaHLTClusterShapeProducer.cc:40
edm::EDGetTokenT< reco::RecoEcalCandidateCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalClusterLazyToolsT::localCovariances
std::vector< float > localCovariances(const reco::BasicCluster &cluster, float w0=4.7) const
Definition: EcalClusterLazyTools.h:282
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:46
EcalClusterLazyTools.h
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: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:68
EgammaHLTClusterShapeProducer::EgammaHLTClusterShapeProducer
EgammaHLTClusterShapeProducer(const edm::ParameterSet &)
Definition: EgammaHLTClusterShapeProducer.cc:46
EcalClusterLazyToolsBase::ESGetTokens
Definition: EcalClusterLazyTools.h:53
ParameterSetDescription.h
EcalClusterLazyTools
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
EcalClusterLazyToolsT
Definition: EcalClusterLazyTools.h:135
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::AssociationMap
Definition: AssociationMap.h:48
EgammaHLTClusterShapeProducer::ecalClusterLazyToolsESGetTokens_
const EcalClusterLazyTools::ESGetTokens ecalClusterLazyToolsESGetTokens_
Definition: EgammaHLTClusterShapeProducer.cc:42
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
DetId::Ecal
Definition: DetId.h:27
EcalClusterLazyToolsBase::ESGetTokens::get
ESData get(edm::EventSetup const &eventSetup) const
Definition: EcalClusterLazyTools.h:62
edm::AssociationMap::insert
void insert(const key_type &k, const data_type &v)
insert an association
Definition: AssociationMap.h:166
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
RecoEcalCandidate.h
EgammaHLTClusterShapeProducer::EtaOrIeta_
const bool EtaOrIeta_
Definition: EgammaHLTClusterShapeProducer.cc:43
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:57
EgammaHLTClusterShapeProducer::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTClusterShapeProducer.cc:39