CMS 3D CMS Logo

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::GsfElectron &theElectron, float radius)
 
void computeHGCAL (const reco::Photon &thePhoton, 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, CaloGeometryRecordcaloGeometry_
 
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< HGCRecHitCollectionrecHitsBH_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsEE_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsFH_
 
hgcal::RecHitTools recHitTools_
 

Detailed Description

Definition at line 31 of file HGCalEgammaIDHelper.h.

Constructor & Destructor Documentation

◆ HGCalEgammaIDHelper() [1/2]

HGCalEgammaIDHelper::HGCalEgammaIDHelper ( )
inline

Definition at line 33 of file HGCalEgammaIDHelper.h.

33 {}

◆ HGCalEgammaIDHelper() [2/2]

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

Definition at line 5 of file HGCalEgammaIDHelper.cc.

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 }

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().

◆ ~HGCalEgammaIDHelper()

HGCalEgammaIDHelper::~HGCalEgammaIDHelper ( )
inline

Definition at line 35 of file HGCalEgammaIDHelper.h.

35 {}

Member Function Documentation

◆ axis()

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

Definition at line 52 of file HGCalEgammaIDHelper.h.

52 { return pcaHelper_.axis(); }

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

◆ barycenter()

const math::XYZPoint& HGCalEgammaIDHelper::barycenter ( ) const
inline

Definition at line 51 of file HGCalEgammaIDHelper.h.

51 { return pcaHelper_.barycenter(); }

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

◆ clusterDepthCompatibility()

float HGCalEgammaIDHelper::clusterDepthCompatibility ( const hgcal::LongDeps ld,
float &  measDepth,
float &  expDepth,
float &  expSigma 
)
inline

Definition at line 60 of file HGCalEgammaIDHelper.h.

60  {
61  return pcaHelper_.clusterDepthCompatibility(ld, measDepth, expDepth, expSigma);
62  }

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

◆ computeHGCAL() [1/2]

void HGCalEgammaIDHelper::computeHGCAL ( const reco::GsfElectron theElectron,
float  radius 
)

Definition at line 62 of file HGCalEgammaIDHelper.cc.

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 }

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(), CosmicsPD_Skims::radius, and hgcal::EGammaPCAHelper::storeRecHits().

◆ computeHGCAL() [2/2]

void HGCalEgammaIDHelper::computeHGCAL ( const reco::Photon thePhoton,
float  radius 
)

Definition at line 36 of file HGCalEgammaIDHelper.cc.

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 }

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

◆ eigenValues()

const TVectorD& HGCalEgammaIDHelper::eigenValues ( ) const
inline

Definition at line 49 of file HGCalEgammaIDHelper.h.

49 { return pcaHelper_.eigenValues(); }

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

◆ energyPerLayer()

hgcal::LongDeps HGCalEgammaIDHelper::energyPerLayer ( float  radius,
bool  withHalo = true 
)
inline

Definition at line 55 of file HGCalEgammaIDHelper.h.

55  {
56  return pcaHelper_.energyPerLayer(radius, withHalo);
57  }

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

◆ eventInit()

void HGCalEgammaIDHelper::eventInit ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

◆ getIsolationRing()

float HGCalEgammaIDHelper::getIsolationRing ( unsigned int  ring) const
inline

Definition at line 65 of file HGCalEgammaIDHelper.h.

65 { return isoHelper_.getIso(ring); };

References HGCalIsoCalculator::getIso(), isoHelper_, and relativeConstraints::ring.

◆ pcaHelper()

const hgcal::EGammaPCAHelper* HGCalEgammaIDHelper::pcaHelper ( ) const
inline

Definition at line 69 of file HGCalEgammaIDHelper.h.

69 { return &pcaHelper_; }

References pcaHelper_.

◆ printHits()

void HGCalEgammaIDHelper::printHits ( float  radius) const
inline

◆ sigmaEE()

double HGCalEgammaIDHelper::sigmaEE ( ) const
inline

Definition at line 47 of file HGCalEgammaIDHelper.h.

47 { return pcaHelper_.sigmaEE(); }

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

◆ sigmaPP()

double HGCalEgammaIDHelper::sigmaPP ( ) const
inline

Definition at line 48 of file HGCalEgammaIDHelper.h.

48 { return pcaHelper_.sigmaPP(); }

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

◆ sigmas()

const TVectorD& HGCalEgammaIDHelper::sigmas ( ) const
inline

Definition at line 50 of file HGCalEgammaIDHelper.h.

50 { return pcaHelper_.sigmas(); }

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

◆ sigmaUU()

double HGCalEgammaIDHelper::sigmaUU ( ) const
inline

Definition at line 45 of file HGCalEgammaIDHelper.h.

45 { return pcaHelper_.sigmaUU(); }

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

◆ sigmaVV()

double HGCalEgammaIDHelper::sigmaVV ( ) const
inline

Definition at line 46 of file HGCalEgammaIDHelper.h.

46 { return pcaHelper_.sigmaVV(); }

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

Member Data Documentation

◆ bhRecHitInputTag_

edm::InputTag HGCalEgammaIDHelper::bhRecHitInputTag_
private

Definition at line 74 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ caloGeometry_

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

Definition at line 84 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ debug_

bool HGCalEgammaIDHelper::debug_
private

Definition at line 86 of file HGCalEgammaIDHelper.h.

Referenced by computeHGCAL(), and HGCalEgammaIDHelper().

◆ dEdXWeights_

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

Definition at line 77 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ eeRecHitInputTag_

edm::InputTag HGCalEgammaIDHelper::eeRecHitInputTag_
private

Definition at line 72 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ fhRecHitInputTag_

edm::InputTag HGCalEgammaIDHelper::fhRecHitInputTag_
private

Definition at line 73 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ hitMap_

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

Definition at line 83 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ hitMapInputTag_

edm::InputTag HGCalEgammaIDHelper::hitMapInputTag_
private

Definition at line 75 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ isoHelper_

HGCalIsoCalculator HGCalEgammaIDHelper::isoHelper_
private

◆ pcaHelper_

hgcal::EGammaPCAHelper HGCalEgammaIDHelper::pcaHelper_
private

◆ recHitsBH_

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

Definition at line 82 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ recHitsEE_

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

Definition at line 80 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ recHitsFH_

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

Definition at line 81 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ recHitTools_

hgcal::RecHitTools HGCalEgammaIDHelper::recHitTools_
private

Definition at line 85 of file HGCalEgammaIDHelper.h.

Referenced by eventInit().

hgcal::EGammaPCAHelper::clusterDepthCompatibility
float clusterDepthCompatibility(const LongDeps &, float &measuredDepth, float &expectedDepth, float &expectedSigma)
Definition: EgammaPCAHelper.cc:307
reco::GsfElectron::isEB
bool isEB() const
Definition: GsfElectron.h:335
reco::Photon::superCluster
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
hgcal::EGammaPCAHelper::sigmas
const TVectorD & sigmas() const
Definition: EgammaPCAHelper.h:67
HGCalEgammaIDHelper::isoHelper_
HGCalIsoCalculator isoHelper_
Definition: HGCalEgammaIDHelper.h:79
HGCalIsoCalculator::setRecHits
void setRecHits(edm::Handle< HGCRecHitCollection > hitsEE, edm::Handle< HGCRecHitCollection > hitsFH, edm::Handle< HGCRecHitCollection > hitsBH)
fill - once per event
Definition: HGCalIsoCalculator.cc:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HGCalIsoCalculator::getIso
const float getIso(const unsigned int ring) const
Definition: HGCalIsoCalculator.cc:114
HGCalIsoCalculator::setMinDeltaR
void setMinDeltaR(const float dr)
Definition: HGCalIsoCalculator.h:54
hgcal::EGammaPCAHelper::printHits
void printHits(float radius) const
Definition: EgammaPCAHelper.cc:281
HGCalEgammaIDHelper::recHitTools_
hgcal::RecHitTools recHitTools_
Definition: HGCalEgammaIDHelper.h:85
hgcal::EGammaPCAHelper::sigmaEE
double sigmaEE() const
Definition: EgammaPCAHelper.h:63
hgcal::EGammaPCAHelper::setRecHitTools
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
Definition: EgammaPCAHelper.cc:32
edm::SortedCollection
Definition: SortedCollection.h:49
hgcal::EGammaPCAHelper::pcaInitialComputation
void pcaInitialComputation()
Definition: EgammaPCAHelper.h:53
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
hgcal::EGammaPCAHelper::eigenValues
const TVectorD & eigenValues() const
Definition: EgammaPCAHelper.h:66
hgcal::EGammaPCAHelper::setdEdXWeights
void setdEdXWeights(const std::vector< double > &dEdX)
Definition: EgammaPCAHelper.h:51
HGCalEgammaIDHelper::caloGeometry_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
Definition: HGCalEgammaIDHelper.h:84
HGCalEgammaIDHelper::hitMapInputTag_
edm::InputTag hitMapInputTag_
Definition: HGCalEgammaIDHelper.h:75
HGCalEgammaIDHelper::hitMap_
edm::EDGetTokenT< std::unordered_map< DetId, const HGCRecHit * > > hitMap_
Definition: HGCalEgammaIDHelper.h:83
HGCalIsoCalculator::setDeltaR
void setDeltaR(const float dr)
Definition: HGCalIsoCalculator.h:52
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
hgcal::EGammaPCAHelper::setHitMap
void setHitMap(const std::unordered_map< DetId, const HGCRecHit * > *hitMap)
to set once per event
Definition: EgammaPCAHelper.cc:27
HGCalIsoCalculator::setNRings
void setNRings(const size_t nrings)
Definition: HGCalIsoCalculator.cc:96
HGCalEgammaIDHelper::recHitsFH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
Definition: HGCalEgammaIDHelper.h:81
HGCalEgammaIDHelper::fhRecHitInputTag_
edm::InputTag fhRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:73
hgcal::EGammaPCAHelper::storeRecHits
void storeRecHits(const reco::CaloCluster &theCluster)
Definition: EgammaPCAHelper.cc:47
HGCalEgammaIDHelper::debug_
bool debug_
Definition: HGCalEgammaIDHelper.h:86
HGCalEgammaIDHelper::dEdXWeights_
std::vector< double > dEdXWeights_
Definition: HGCalEgammaIDHelper.h:77
hgcal::EGammaPCAHelper::axis
const math::XYZVector & axis() const
Definition: EgammaPCAHelper.h:57
reco::Photon::isEB
bool isEB() const
Definition: Photon.h:119
iEvent
int iEvent
Definition: GenABIO.cc:224
hgcal::EGammaPCAHelper::clear
void clear()
Definition: EgammaPCAHelper.cc:232
HGCalEgammaIDHelper::eeRecHitInputTag_
edm::InputTag eeRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:72
HGCalEgammaIDHelper::recHitsEE_
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
Definition: HGCalEgammaIDHelper.h:80
HGCalEgammaIDHelper::bhRecHitInputTag_
edm::InputTag bhRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:74
hgcal::EGammaPCAHelper::sigmaPP
double sigmaPP() const
Definition: EgammaPCAHelper.h:64
hgcal::EGammaPCAHelper::computeShowerWidth
void computeShowerWidth(float radius, bool withHalo=true)
Definition: EgammaPCAHelper.cc:173
hgcal::EGammaPCAHelper::sigmaUU
double sigmaUU() const
Definition: EgammaPCAHelper.h:61
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
hgcal::EGammaPCAHelper::computePCA
void computePCA(float radius, bool withHalo=true)
Definition: EgammaPCAHelper.cc:106
reco::GsfElectron::electronCluster
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:227
HGCalIsoCalculator::produceHGCalIso
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
Definition: HGCalIsoCalculator.cc:48
hgcal::RecHitTools::setGeometry
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
HGCalEgammaIDHelper::pcaHelper_
hgcal::EGammaPCAHelper pcaHelper_
Definition: HGCalEgammaIDHelper.h:78
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
HGCalIsoCalculator::setRecHitTools
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
Definition: HGCalIsoCalculator.h:56
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
hgcal::EGammaPCAHelper::sigmaVV
double sigmaVV() const
Definition: EgammaPCAHelper.h:62
hgcal::EGammaPCAHelper::energyPerLayer
LongDeps energyPerLayer(float radius, bool withHalo=true)
Definition: EgammaPCAHelper.cc:241
HGCalEgammaIDHelper::recHitsBH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
Definition: HGCalEgammaIDHelper.h:82
hgcal::EGammaPCAHelper::barycenter
const math::XYZPoint & barycenter() const
Definition: EgammaPCAHelper.h:56
edm::InputTag
Definition: InputTag.h:15