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 
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 
45  const bool EtaOrIeta_;
46  const double multThresEB_;
47  const double multThresEE_;
48 };
49 
51  : recoEcalCandidateProducer_(consumes(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
52  ecalRechitEBToken_(consumes(config.getParameter<edm::InputTag>("ecalRechitEB"))),
53  ecalRechitEEToken_(consumes(config.getParameter<edm::InputTag>("ecalRechitEE"))),
54  ecalClusterLazyToolsESGetTokens_{consumesCollector()},
55  ecalPFRechitThresholdsToken_{esConsumes()},
56  EtaOrIeta_(config.getParameter<bool>("isIeta")),
57  multThresEB_(config.getParameter<double>("multThresEB")),
58  multThresEE_(config.getParameter<double>("multThresEE")) {
59  //register your products
60  produces<reco::RecoEcalCandidateIsolationMap>();
61  produces<reco::RecoEcalCandidateIsolationMap>("sigmaIEtaIEta5x5");
62  produces<reco::RecoEcalCandidateIsolationMap>("sigmaIEtaIEta5x5NoiseCleaned");
63 }
64 
66 
69  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
70  desc.add<edm::InputTag>(("ecalRechitEB"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEB"));
71  desc.add<edm::InputTag>(("ecalRechitEE"), edm::InputTag("hltEcalRegionalEgammaRecHit", "EcalRecHitsEE"));
72  desc.add<bool>(("isIeta"), true);
73  desc.add<double>(("multThresEB"), EgammaLocalCovParamDefaults::kMultThresEB);
74  desc.add<double>(("multThresEE"), EgammaLocalCovParamDefaults::kMultThresEE);
75  descriptions.add(("hltEgammaHLTClusterShapeProducer"), desc);
76 }
77 
80  const edm::EventSetup& iSetup) const {
81  // Get the HLT filtered objects
83  iEvent.getByToken(recoEcalCandidateProducer_, recoecalcandHandle);
84 
85  auto const& ecalClusterLazyToolsESData = ecalClusterLazyToolsESGetTokens_.get(iSetup);
86  auto const& thresholds = iSetup.getData(ecalPFRechitThresholdsToken_);
87 
88  EcalClusterLazyTools lazyTools(iEvent, ecalClusterLazyToolsESData, ecalRechitEBToken_, ecalRechitEEToken_);
89  noZS::EcalClusterLazyTools lazyTools5x5(iEvent, ecalClusterLazyToolsESData, ecalRechitEBToken_, ecalRechitEEToken_);
90 
91  reco::RecoEcalCandidateIsolationMap clshMap(recoecalcandHandle);
92  reco::RecoEcalCandidateIsolationMap clsh5x5Map(recoecalcandHandle);
93  reco::RecoEcalCandidateIsolationMap clsh5x5NoiseCleanedMap(recoecalcandHandle);
94 
95  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
96  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
97  if (recoecalcandref->superCluster()->seed()->seed().det() != DetId::Ecal) { //HGCAL, skip for now
98  clshMap.insert(recoecalcandref, 0);
99  clsh5x5Map.insert(recoecalcandref, 0);
100  continue;
101  }
102 
103  double sigmaee;
104  if (EtaOrIeta_) {
105  const auto& vCov = lazyTools.localCovariances(*(recoecalcandref->superCluster()->seed()));
106  sigmaee = sqrt(vCov[0]);
107  } else {
108  const auto& vCov = lazyTools.covariances(*(recoecalcandref->superCluster()->seed()));
109  sigmaee = sqrt(vCov[0]);
110  double EtaSC = recoecalcandref->eta();
111  if (EtaSC > 1.479)
112  sigmaee = sigmaee - 0.02 * (EtaSC - 2.3);
113  }
114 
115  double sigmaee5x5 = sqrt(lazyTools5x5.localCovariances(*(recoecalcandref->superCluster()->seed()))[0]);
116  double sigmaee5x5NoiseCleaned = sqrt(lazyTools5x5.localCovariances(*(recoecalcandref->superCluster()->seed()),
118  &thresholds,
119  multThresEB_,
120  multThresEE_)[0]);
121  clshMap.insert(recoecalcandref, sigmaee);
122  clsh5x5Map.insert(recoecalcandref, sigmaee5x5);
123  clsh5x5NoiseCleanedMap.insert(recoecalcandref, sigmaee5x5NoiseCleaned);
124  }
125 
126  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clshMap));
127  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clsh5x5Map), "sigmaIEtaIEta5x5");
128  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(clsh5x5NoiseCleanedMap),
129  "sigmaIEtaIEta5x5NoiseCleaned");
130 }
131 
RecoEcalCandidateIsolation.h
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
EgammaHLTClusterShapeProducer::ecalRechitEBToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEBToken_
Definition: EgammaHLTClusterShapeProducer.cc:41
particleFlowZeroSuppressionECAL_cff.thresholds
thresholds
Definition: particleFlowZeroSuppressionECAL_cff.py:31
edm::EDGetTokenT< reco::RecoEcalCandidateCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
EcalClusterLazyTools.h
EgammaLocalCovParamDefaults::kMultThresEB
static constexpr float kMultThresEB
Definition: EgammaLocalCovParamDefaults.h:6
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:67
EcalClusterLazyToolsT::localCovariances
std::array< float, 3 > localCovariances(const reco::BasicCluster &cluster, float w0=EgammaLocalCovParamDefaults::kRelEnCut, const EcalPFRecHitThresholds *rhthresholds=nullptr, float multEB=0.0, float multEE=0.0) const
Definition: EcalClusterLazyTools.h:284
MakerMacros.h
EgammaHLTClusterShapeProducer
Definition: EgammaHLTClusterShapeProducer.cc:29
EgammaHLTClusterShapeProducer::multThresEE_
const double multThresEE_
Definition: EgammaHLTClusterShapeProducer.cc:47
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:78
EgammaHLTClusterShapeProducer::multThresEB_
const double multThresEB_
Definition: EgammaHLTClusterShapeProducer.cc:46
EgammaHLTClusterShapeProducer::EgammaHLTClusterShapeProducer
EgammaHLTClusterShapeProducer(const edm::ParameterSet &)
Definition: EgammaHLTClusterShapeProducer.cc:50
EcalClusterLazyToolsBase::ESGetTokens
Definition: EcalClusterLazyTools.h:55
ParameterSetDescription.h
EcalClusterLazyTools
EgammaHLTClusterShapeProducer::ecalPFRechitThresholdsToken_
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
Definition: EgammaHLTClusterShapeProducer.cc:44
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
EgammaLocalCovParamDefaults::kRelEnCut
static constexpr float kRelEnCut
Definition: EgammaLocalCovParamDefaults.h:5
EcalClusterLazyToolsT
Definition: EcalClusterLazyTools.h:137
EgammaLocalCovParamDefaults::kMultThresEE
static constexpr float kMultThresEE
Definition: EgammaLocalCovParamDefaults.h:7
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::AssociationMap
Definition: AssociationMap.h:48
EgammaHLTClusterShapeProducer::ecalClusterLazyToolsESGetTokens_
const EcalClusterLazyTools::ESGetTokens ecalClusterLazyToolsESGetTokens_
Definition: EgammaHLTClusterShapeProducer.cc:43
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
DetId::Ecal
Definition: DetId.h:27
edm::ESGetToken
Definition: EventSetup.h:48
EcalClusterLazyToolsBase::ESGetTokens::get
ESData get(edm::EventSetup const &eventSetup) const
Definition: EcalClusterLazyTools.h:64
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
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:45
EgammaHLTClusterShapeProducer::ecalRechitEEToken_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEEToken_
Definition: EgammaHLTClusterShapeProducer.cc:42
Frameworkfwd.h
SuperCluster.h
RecoEcalCandidateFwd.h
EgammaLocalCovParamDefaults.h
ParameterSet.h
EDProducer.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
EgammaHLTClusterShapeProducer::~EgammaHLTClusterShapeProducer
~EgammaHLTClusterShapeProducer() override
Definition: EgammaHLTClusterShapeProducer.cc:65
EgammaHLTClusterShapeProducer::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTClusterShapeProducer.cc:40