CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
HGCalEgammaIDHelper Class Reference

#include <HGCalEgammaIDHelper.h>

Public Member Functions

const math::XYZVectoraxis () const
 
const math::XYZPointbarycenter () const
 
float clusterDepthCompatibility (const hgcal::LongDeps &ld, float &measDepth, float &expDepth, float &expSigma)
 
void computeHGCAL (const reco::Photon &thePhoton, float radius)
 
void computeHGCAL (const reco::GsfElectron &theElectron, float radius)
 
const TVectorD & eigenValues () const
 
hgcal::LongDeps energyPerLayer (float radius, bool withHalo=true)
 
void eventInit (const edm::Event &iEvent, const edm::EventSetup &iSetup)
 
float getIsolationRing (unsigned int ring) const
 
 HGCalEgammaIDHelper ()
 
 HGCalEgammaIDHelper (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 
const hgcal::EGammaPCAHelperpcaHelper () const
 
void printHits (float radius) const
 
double sigmaEE () const
 
double sigmaPP () const
 
const TVectorD & sigmas () const
 
double sigmaUU () const
 
double sigmaVV () const
 
 ~HGCalEgammaIDHelper ()
 

Private Attributes

edm::InputTag bhRecHitInputTag_
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
caloGeometry_
 
bool debug_
 
std::vector< double > dEdXWeights_
 
edm::InputTag eeRecHitInputTag_
 
edm::InputTag fhRecHitInputTag_
 
edm::EDGetTokenT
< std::unordered_map< DetId,
const HGCRecHit * > > 
hitMap_
 
edm::InputTag hitMapInputTag_
 
HGCalIsoCalculator isoHelper_
 
hgcal::EGammaPCAHelper pcaHelper_
 
edm::EDGetTokenT
< HGCRecHitCollection
recHitsBH_
 
edm::EDGetTokenT
< HGCRecHitCollection
recHitsEE_
 
edm::EDGetTokenT
< HGCRecHitCollection
recHitsFH_
 
hgcal::RecHitTools recHitTools_
 

Detailed Description

Definition at line 31 of file HGCalEgammaIDHelper.h.

Constructor & Destructor Documentation

HGCalEgammaIDHelper::HGCalEgammaIDHelper ( )
inline

Definition at line 33 of file HGCalEgammaIDHelper.h.

33 {}
HGCalEgammaIDHelper::HGCalEgammaIDHelper ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 5 of file HGCalEgammaIDHelper.cc.

References bhRecHitInputTag_, caloGeometry_, debug_, dEdXWeights_, eeRecHitInputTag_, fhRecHitInputTag_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hitMap_, hitMapInputTag_, isoHelper_, pcaHelper_, recHitsBH_, recHitsEE_, recHitsFH_, hgcal::EGammaPCAHelper::setdEdXWeights(), HGCalIsoCalculator::setDeltaR(), HGCalIsoCalculator::setMinDeltaR(), and HGCalIsoCalculator::setNRings().

6  : eeRecHitInputTag_(iConfig.getParameter<edm::InputTag>("EERecHits")),
7  fhRecHitInputTag_(iConfig.getParameter<edm::InputTag>("FHRecHits")),
8  bhRecHitInputTag_(iConfig.getParameter<edm::InputTag>("BHRecHits")),
9  hitMapInputTag_(iConfig.getParameter<edm::InputTag>("hitMapTag")),
10  dEdXWeights_(iConfig.getParameter<std::vector<double>>("dEdXWeights")) {
11  isoHelper_.setDeltaR(iConfig.getParameter<double>("isoDeltaR"));
12  isoHelper_.setNRings(iConfig.getParameter<unsigned int>("isoNRings"));
13  isoHelper_.setMinDeltaR(iConfig.getParameter<double>("isoDeltaRmin"));
14 
18  hitMap_ = iC.consumes<std::unordered_map<DetId, const HGCRecHit*>>(hitMapInputTag_);
21  debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
22 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
void setMinDeltaR(const float dr)
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
edm::InputTag fhRecHitInputTag_
void setNRings(const size_t nrings)
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
void setdEdXWeights(const std::vector< double > &dEdX)
void setDeltaR(const float dr)
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
edm::InputTag bhRecHitInputTag_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
edm::InputTag hitMapInputTag_
std::vector< double > dEdXWeights_
hgcal::EGammaPCAHelper pcaHelper_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalIsoCalculator isoHelper_
edm::EDGetTokenT< std::unordered_map< DetId, const HGCRecHit * > > hitMap_
edm::InputTag eeRecHitInputTag_
HGCalEgammaIDHelper::~HGCalEgammaIDHelper ( )
inline

Definition at line 35 of file HGCalEgammaIDHelper.h.

35 {}

Member Function Documentation

const math::XYZVector& HGCalEgammaIDHelper::axis ( ) const
inline

Definition at line 52 of file HGCalEgammaIDHelper.h.

References hgcal::EGammaPCAHelper::axis(), and pcaHelper_.

52 { return pcaHelper_.axis(); }
hgcal::EGammaPCAHelper pcaHelper_
const math::XYZVector & axis() const
const math::XYZPoint& HGCalEgammaIDHelper::barycenter ( ) const
inline

Definition at line 51 of file HGCalEgammaIDHelper.h.

References hgcal::EGammaPCAHelper::barycenter(), and pcaHelper_.

51 { return pcaHelper_.barycenter(); }
const math::XYZPoint & barycenter() const
hgcal::EGammaPCAHelper pcaHelper_
float HGCalEgammaIDHelper::clusterDepthCompatibility ( const hgcal::LongDeps ld,
float &  measDepth,
float &  expDepth,
float &  expSigma 
)
inline

Definition at line 60 of file HGCalEgammaIDHelper.h.

References hgcal::EGammaPCAHelper::clusterDepthCompatibility(), and pcaHelper_.

60  {
61  return pcaHelper_.clusterDepthCompatibility(ld, measDepth, expDepth, expSigma);
62  }
hgcal::EGammaPCAHelper pcaHelper_
float clusterDepthCompatibility(const LongDeps &, float &measuredDepth, float &expectedDepth, float &expectedSigma)
void HGCalEgammaIDHelper::computeHGCAL ( const reco::Photon thePhoton,
float  radius 
)

Definition at line 36 of file HGCalEgammaIDHelper.cc.

References hgcal::EGammaPCAHelper::clear(), hgcal::EGammaPCAHelper::computePCA(), hgcal::EGammaPCAHelper::computeShowerWidth(), gather_cfg::cout, debug_, reco::Photon::isEB(), isoHelper_, pcaHelper_, hgcal::EGammaPCAHelper::pcaInitialComputation(), HGCalIsoCalculator::produceHGCalIso(), hgcal::EGammaPCAHelper::storeRecHits(), and reco::Photon::superCluster().

36  {
37  if (thePhoton.isEB()) {
38  if (debug_)
39  std::cout << "The photon is in the barrel" << std::endl;
40  pcaHelper_.clear();
41  return;
42  }
43 
44  pcaHelper_.storeRecHits(*thePhoton.superCluster()->seed());
45  if (debug_)
46  std::cout << " Stored the hits belonging to the photon superCluster seed " << std::endl;
47 
48  // initial computation, no radius cut, but halo hits not taken
49  if (debug_)
50  std::cout << " Calling PCA initial computation" << std::endl;
52  // first computation within cylinder, halo hits included
54  // second computation within cylinder, halo hits included
57 
58  // isolation
59  isoHelper_.produceHGCalIso(thePhoton.superCluster()->seed());
60 }
void computeShowerWidth(float radius, bool withHalo=true)
void computePCA(float radius, bool withHalo=true)
void storeRecHits(const reco::CaloCluster &theCluster)
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
hgcal::EGammaPCAHelper pcaHelper_
bool isEB() const
Definition: Photon.h:123
HGCalIsoCalculator isoHelper_
tuple cout
Definition: gather_cfg.py:144
void HGCalEgammaIDHelper::computeHGCAL ( const reco::GsfElectron theElectron,
float  radius 
)

Definition at line 62 of file HGCalEgammaIDHelper.cc.

References hgcal::EGammaPCAHelper::clear(), hgcal::EGammaPCAHelper::computePCA(), hgcal::EGammaPCAHelper::computeShowerWidth(), gather_cfg::cout, debug_, reco::GsfElectron::electronCluster(), reco::GsfElectron::isEB(), isoHelper_, pcaHelper_, hgcal::EGammaPCAHelper::pcaInitialComputation(), HGCalIsoCalculator::produceHGCalIso(), and hgcal::EGammaPCAHelper::storeRecHits().

62  {
63  if (theElectron.isEB()) {
64  if (debug_)
65  std::cout << "The electron is in the barrel" << std::endl;
66  pcaHelper_.clear();
67  return;
68  }
69 
70  pcaHelper_.storeRecHits(*theElectron.electronCluster());
71  if (debug_)
72  std::cout << " Stored the hits belonging to the electronCluster " << std::endl;
73 
74  // initial computation, no radius cut, but halo hits not taken
75  if (debug_)
76  std::cout << " Calling PCA initial computation" << std::endl;
78  // first computation within cylinder, halo hits included
80  // second computation within cylinder, halo hits included
84 }
void computeShowerWidth(float radius, bool withHalo=true)
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:220
void computePCA(float radius, bool withHalo=true)
bool isEB() const
Definition: GsfElectron.h:328
void storeRecHits(const reco::CaloCluster &theCluster)
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
hgcal::EGammaPCAHelper pcaHelper_
HGCalIsoCalculator isoHelper_
tuple cout
Definition: gather_cfg.py:144
const TVectorD& HGCalEgammaIDHelper::eigenValues ( ) const
inline

Definition at line 49 of file HGCalEgammaIDHelper.h.

References hgcal::EGammaPCAHelper::eigenValues(), and pcaHelper_.

49 { return pcaHelper_.eigenValues(); }
const TVectorD & eigenValues() const
hgcal::EGammaPCAHelper pcaHelper_
hgcal::LongDeps HGCalEgammaIDHelper::energyPerLayer ( float  radius,
bool  withHalo = true 
)
inline

Definition at line 55 of file HGCalEgammaIDHelper.h.

References hgcal::EGammaPCAHelper::energyPerLayer(), and pcaHelper_.

55  {
56  return pcaHelper_.energyPerLayer(radius, withHalo);
57  }
LongDeps energyPerLayer(float radius, bool withHalo=true)
hgcal::EGammaPCAHelper pcaHelper_
void HGCalEgammaIDHelper::eventInit ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 24 of file HGCalEgammaIDHelper.cc.

References caloGeometry_, edm::Event::get(), edm::EventSetup::getData(), edm::Event::getHandle(), hitMap_, isoHelper_, pcaHelper_, recHitsBH_, recHitsEE_, recHitsFH_, recHitTools_, hgcal::RecHitTools::setGeometry(), hgcal::EGammaPCAHelper::setHitMap(), HGCalIsoCalculator::setRecHits(), hgcal::EGammaPCAHelper::setRecHitTools(), and HGCalIsoCalculator::setRecHitTools().

24  {
25  auto recHitHandleEE = iEvent.getHandle(recHitsEE_);
26  auto recHitHandleFH = iEvent.getHandle(recHitsFH_);
27  auto recHitHandleBH = iEvent.getHandle(recHitsBH_);
28 
32  pcaHelper_.setHitMap(&iEvent.get(hitMap_));
33  isoHelper_.setRecHits(recHitHandleEE, recHitHandleFH, recHitHandleBH);
34 }
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
void setHitMap(const std::unordered_map< DetId, const HGCRecHit * > *hitMap)
to set once per event
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
void setRecHits(edm::Handle< HGCRecHitCollection > hitsEE, edm::Handle< HGCRecHitCollection > hitsFH, edm::Handle< HGCRecHitCollection > hitsBH)
fill - once per event
hgcal::RecHitTools recHitTools_
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
hgcal::EGammaPCAHelper pcaHelper_
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
HGCalIsoCalculator isoHelper_
edm::EDGetTokenT< std::unordered_map< DetId, const HGCRecHit * > > hitMap_
float HGCalEgammaIDHelper::getIsolationRing ( unsigned int  ring) const
inline

Definition at line 65 of file HGCalEgammaIDHelper.h.

References HGCalIsoCalculator::getIso(), and isoHelper_.

65 { return isoHelper_.getIso(ring); };
HGCalIsoCalculator isoHelper_
const float getIso(const unsigned int ring) const
const hgcal::EGammaPCAHelper* HGCalEgammaIDHelper::pcaHelper ( ) const
inline

Definition at line 69 of file HGCalEgammaIDHelper.h.

References pcaHelper_.

69 { return &pcaHelper_; }
hgcal::EGammaPCAHelper pcaHelper_
void HGCalEgammaIDHelper::printHits ( float  radius) const
inline
double HGCalEgammaIDHelper::sigmaEE ( ) const
inline

Definition at line 47 of file HGCalEgammaIDHelper.h.

References pcaHelper_, and hgcal::EGammaPCAHelper::sigmaEE().

47 { return pcaHelper_.sigmaEE(); }
hgcal::EGammaPCAHelper pcaHelper_
double sigmaEE() const
double HGCalEgammaIDHelper::sigmaPP ( ) const
inline

Definition at line 48 of file HGCalEgammaIDHelper.h.

References pcaHelper_, and hgcal::EGammaPCAHelper::sigmaPP().

48 { return pcaHelper_.sigmaPP(); }
double sigmaPP() const
hgcal::EGammaPCAHelper pcaHelper_
const TVectorD& HGCalEgammaIDHelper::sigmas ( ) const
inline

Definition at line 50 of file HGCalEgammaIDHelper.h.

References pcaHelper_, and hgcal::EGammaPCAHelper::sigmas().

50 { return pcaHelper_.sigmas(); }
const TVectorD & sigmas() const
hgcal::EGammaPCAHelper pcaHelper_
double HGCalEgammaIDHelper::sigmaUU ( ) const
inline

Definition at line 45 of file HGCalEgammaIDHelper.h.

References pcaHelper_, and hgcal::EGammaPCAHelper::sigmaUU().

45 { return pcaHelper_.sigmaUU(); }
double sigmaUU() const
hgcal::EGammaPCAHelper pcaHelper_
double HGCalEgammaIDHelper::sigmaVV ( ) const
inline

Definition at line 46 of file HGCalEgammaIDHelper.h.

References pcaHelper_, and hgcal::EGammaPCAHelper::sigmaVV().

46 { return pcaHelper_.sigmaVV(); }
hgcal::EGammaPCAHelper pcaHelper_
double sigmaVV() const

Member Data Documentation

edm::InputTag HGCalEgammaIDHelper::bhRecHitInputTag_
private

Definition at line 74 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> HGCalEgammaIDHelper::caloGeometry_
private

Definition at line 84 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

bool HGCalEgammaIDHelper::debug_
private

Definition at line 86 of file HGCalEgammaIDHelper.h.

Referenced by computeHGCAL(), and HGCalEgammaIDHelper().

std::vector<double> HGCalEgammaIDHelper::dEdXWeights_
private

Definition at line 77 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

edm::InputTag HGCalEgammaIDHelper::eeRecHitInputTag_
private

Definition at line 72 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

edm::InputTag HGCalEgammaIDHelper::fhRecHitInputTag_
private

Definition at line 73 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

edm::EDGetTokenT<std::unordered_map<DetId, const HGCRecHit*> > HGCalEgammaIDHelper::hitMap_
private

Definition at line 83 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

edm::InputTag HGCalEgammaIDHelper::hitMapInputTag_
private

Definition at line 75 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

HGCalIsoCalculator HGCalEgammaIDHelper::isoHelper_
private
hgcal::EGammaPCAHelper HGCalEgammaIDHelper::pcaHelper_
private
edm::EDGetTokenT<HGCRecHitCollection> HGCalEgammaIDHelper::recHitsBH_
private

Definition at line 82 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

edm::EDGetTokenT<HGCRecHitCollection> HGCalEgammaIDHelper::recHitsEE_
private

Definition at line 80 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

edm::EDGetTokenT<HGCRecHitCollection> HGCalEgammaIDHelper::recHitsFH_
private

Definition at line 81 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

hgcal::RecHitTools HGCalEgammaIDHelper::recHitTools_
private

Definition at line 85 of file HGCalEgammaIDHelper.h.

Referenced by eventInit().