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_
 
bool debug_
 
std::vector< double > dEdXWeights_
 
edm::InputTag eeRecHitInputTag_
 
edm::InputTag fhRecHitInputTag_
 
HGCalIsoCalculator isoHelper_
 
hgcal::EGammaPCAHelper pcaHelper_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsBH_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsEE_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsFH_
 
hgcal::RecHitTools recHitTools_
 

Detailed Description

Definition at line 30 of file HGCalEgammaIDHelper.h.

Constructor & Destructor Documentation

◆ HGCalEgammaIDHelper() [1/2]

HGCalEgammaIDHelper::HGCalEgammaIDHelper ( )
inline

Definition at line 32 of file HGCalEgammaIDHelper.h.

32 {}

◆ HGCalEgammaIDHelper() [2/2]

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

◆ ~HGCalEgammaIDHelper()

HGCalEgammaIDHelper::~HGCalEgammaIDHelper ( )
inline

Definition at line 34 of file HGCalEgammaIDHelper.h.

34 {}

Member Function Documentation

◆ axis()

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

Definition at line 51 of file HGCalEgammaIDHelper.h.

51 { return pcaHelper_.axis(); }

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

◆ barycenter()

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

Definition at line 50 of file HGCalEgammaIDHelper.h.

50 { 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 59 of file HGCalEgammaIDHelper.h.

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

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 48 of file HGCalEgammaIDHelper.h.

48 { return pcaHelper_.eigenValues(); }

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

◆ energyPerLayer()

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

Definition at line 54 of file HGCalEgammaIDHelper.h.

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

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

◆ eventInit()

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

Definition at line 21 of file HGCalEgammaIDHelper.cc.

21  {
22  edm::Handle<HGCRecHitCollection> recHitHandleEE;
23  iEvent.getByToken(recHitsEE_, recHitHandleEE);
24  edm::Handle<HGCRecHitCollection> recHitHandleFH;
25  iEvent.getByToken(recHitsFH_, recHitHandleFH);
26  edm::Handle<HGCRecHitCollection> recHitHandleBH;
27  iEvent.getByToken(recHitsBH_, recHitHandleBH);
28 
32  pcaHelper_.fillHitMap(*recHitHandleEE, *recHitHandleFH, *recHitHandleBH);
33  isoHelper_.setRecHits(recHitHandleEE, recHitHandleFH, recHitHandleBH);
34 }

References hgcal::EGammaPCAHelper::fillHitMap(), hgcal::RecHitTools::getEventSetup(), iEvent, isoHelper_, pcaHelper_, recHitsBH_, recHitsEE_, recHitsFH_, recHitTools_, HGCalIsoCalculator::setRecHits(), hgcal::EGammaPCAHelper::setRecHitTools(), and HGCalIsoCalculator::setRecHitTools().

◆ getIsolationRing()

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

Definition at line 64 of file HGCalEgammaIDHelper.h.

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

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

◆ pcaHelper()

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

Definition at line 68 of file HGCalEgammaIDHelper.h.

68 { return &pcaHelper_; }

References pcaHelper_.

◆ printHits()

void HGCalEgammaIDHelper::printHits ( float  radius) const
inline

◆ sigmaEE()

double HGCalEgammaIDHelper::sigmaEE ( ) const
inline

Definition at line 46 of file HGCalEgammaIDHelper.h.

46 { return pcaHelper_.sigmaEE(); }

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

◆ sigmaPP()

double HGCalEgammaIDHelper::sigmaPP ( ) const
inline

Definition at line 47 of file HGCalEgammaIDHelper.h.

47 { return pcaHelper_.sigmaPP(); }

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

◆ sigmas()

const TVectorD& HGCalEgammaIDHelper::sigmas ( ) const
inline

Definition at line 49 of file HGCalEgammaIDHelper.h.

49 { return pcaHelper_.sigmas(); }

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

◆ sigmaUU()

double HGCalEgammaIDHelper::sigmaUU ( ) const
inline

Definition at line 44 of file HGCalEgammaIDHelper.h.

44 { return pcaHelper_.sigmaUU(); }

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

◆ sigmaVV()

double HGCalEgammaIDHelper::sigmaVV ( ) const
inline

Definition at line 45 of file HGCalEgammaIDHelper.h.

45 { return pcaHelper_.sigmaVV(); }

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

Member Data Documentation

◆ bhRecHitInputTag_

edm::InputTag HGCalEgammaIDHelper::bhRecHitInputTag_
private

Definition at line 73 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ debug_

bool HGCalEgammaIDHelper::debug_
private

Definition at line 82 of file HGCalEgammaIDHelper.h.

Referenced by computeHGCAL(), and HGCalEgammaIDHelper().

◆ dEdXWeights_

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

Definition at line 75 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ eeRecHitInputTag_

edm::InputTag HGCalEgammaIDHelper::eeRecHitInputTag_
private

Definition at line 71 of file HGCalEgammaIDHelper.h.

Referenced by HGCalEgammaIDHelper().

◆ fhRecHitInputTag_

edm::InputTag HGCalEgammaIDHelper::fhRecHitInputTag_
private

Definition at line 72 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 80 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ recHitsEE_

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

Definition at line 78 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ recHitsFH_

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

Definition at line 79 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

◆ recHitTools_

hgcal::RecHitTools HGCalEgammaIDHelper::recHitTools_
private

Definition at line 81 of file HGCalEgammaIDHelper.h.

Referenced by eventInit().

hgcal::EGammaPCAHelper::clusterDepthCompatibility
float clusterDepthCompatibility(const LongDeps &, float &measuredDepth, float &expectedDepth, float &expectedSigma)
Definition: EgammaPCAHelper.cc:333
reco::GsfElectron::isEB
bool isEB() const
Definition: GsfElectron.h:336
reco::Photon::superCluster
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
hgcal::EGammaPCAHelper::fillHitMap
void fillHitMap(const HGCRecHitCollection &HGCEERecHits, const HGCRecHitCollection &HGCFHRecHits, const HGCRecHitCollection &HGCBHRecHits)
to compute from inside - once per event
Definition: EgammaPCAHelper.cc:43
hgcal::EGammaPCAHelper::sigmas
const TVectorD & sigmas() const
Definition: EgammaPCAHelper.h:73
HGCalEgammaIDHelper::isoHelper_
HGCalIsoCalculator isoHelper_
Definition: HGCalEgammaIDHelper.h:77
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:307
HGCalEgammaIDHelper::recHitTools_
hgcal::RecHitTools recHitTools_
Definition: HGCalEgammaIDHelper.h:81
hgcal::EGammaPCAHelper::sigmaEE
double sigmaEE() const
Definition: EgammaPCAHelper.h:69
hgcal::EGammaPCAHelper::setRecHitTools
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
Definition: EgammaPCAHelper.cc:38
edm::SortedCollection
Definition: SortedCollection.h:49
hgcal::EGammaPCAHelper::pcaInitialComputation
void pcaInitialComputation()
Definition: EgammaPCAHelper.h:59
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
hgcal::EGammaPCAHelper::eigenValues
const TVectorD & eigenValues() const
Definition: EgammaPCAHelper.h:72
hgcal::EGammaPCAHelper::setdEdXWeights
void setdEdXWeights(const std::vector< double > &dEdX)
Definition: EgammaPCAHelper.h:57
HGCalIsoCalculator::setDeltaR
void setDeltaR(const float dr)
Definition: HGCalIsoCalculator.h:52
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
HGCalIsoCalculator::setNRings
void setNRings(const size_t nrings)
Definition: HGCalIsoCalculator.cc:96
HGCalEgammaIDHelper::recHitsFH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
Definition: HGCalEgammaIDHelper.h:79
HGCalEgammaIDHelper::fhRecHitInputTag_
edm::InputTag fhRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:72
hgcal::EGammaPCAHelper::storeRecHits
void storeRecHits(const reco::CaloCluster &theCluster)
Definition: EgammaPCAHelper.cc:73
HGCalEgammaIDHelper::debug_
bool debug_
Definition: HGCalEgammaIDHelper.h:82
HGCalEgammaIDHelper::dEdXWeights_
std::vector< double > dEdXWeights_
Definition: HGCalEgammaIDHelper.h:75
hgcal::EGammaPCAHelper::axis
const math::XYZVector & axis() const
Definition: EgammaPCAHelper.h:63
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:258
HGCalEgammaIDHelper::eeRecHitInputTag_
edm::InputTag eeRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:71
HGCalEgammaIDHelper::recHitsEE_
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
Definition: HGCalEgammaIDHelper.h:78
HGCalEgammaIDHelper::bhRecHitInputTag_
edm::InputTag bhRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:73
hgcal::RecHitTools::getEventSetup
void getEventSetup(const edm::EventSetup &)
Definition: RecHitTools.cc:70
hgcal::EGammaPCAHelper::sigmaPP
double sigmaPP() const
Definition: EgammaPCAHelper.h:70
hgcal::EGammaPCAHelper::computeShowerWidth
void computeShowerWidth(float radius, bool withHalo=true)
Definition: EgammaPCAHelper.cc:199
hgcal::EGammaPCAHelper::sigmaUU
double sigmaUU() const
Definition: EgammaPCAHelper.h:67
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
hgcal::EGammaPCAHelper::computePCA
void computePCA(float radius, bool withHalo=true)
Definition: EgammaPCAHelper.cc:132
reco::GsfElectron::electronCluster
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:228
HGCalIsoCalculator::produceHGCalIso
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
Definition: HGCalIsoCalculator.cc:48
HGCalEgammaIDHelper::pcaHelper_
hgcal::EGammaPCAHelper pcaHelper_
Definition: HGCalEgammaIDHelper.h:76
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
hgcal::EGammaPCAHelper::sigmaVV
double sigmaVV() const
Definition: EgammaPCAHelper.h:68
hgcal::EGammaPCAHelper::energyPerLayer
LongDeps energyPerLayer(float radius, bool withHalo=true)
Definition: EgammaPCAHelper.cc:267
HGCalEgammaIDHelper::recHitsBH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
Definition: HGCalEgammaIDHelper.h:80
hgcal::EGammaPCAHelper::barycenter
const math::XYZPoint & barycenter() const
Definition: EgammaPCAHelper.h:62
edm::InputTag
Definition: InputTag.h:15