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::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, CaloGeometryRecordcaloGeometry_
 
bool debug_
 
std::vector< double > dEdXWeights_
 
edm::InputTag eeRecHitInputTag_
 
edm::InputTag fhRecHitInputTag_
 
edm::EDGetTokenT< std::unordered_map< DetId, const unsigned int > > 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.

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 unsigned int>>(hitMapInputTag_);
21  debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
22 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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_
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag bhRecHitInputTag_
edm::EDGetTokenT< std::unordered_map< DetId, const unsigned int > > hitMap_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
edm::InputTag hitMapInputTag_
std::vector< double > dEdXWeights_
hgcal::EGammaPCAHelper pcaHelper_
HGCalIsoCalculator isoHelper_
edm::InputTag eeRecHitInputTag_

◆ ~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.

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

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

◆ barycenter()

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_

◆ clusterDepthCompatibility()

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)

◆ computeHGCAL() [1/2]

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

Definition at line 37 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(), CosmicsPD_Skims::radius, hgcal::EGammaPCAHelper::storeRecHits(), and reco::Photon::superCluster().

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

◆ computeHGCAL() [2/2]

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

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

63  {
64  if (theElectron.isEB()) {
65  if (debug_)
66  std::cout << "The electron is in the barrel" << std::endl;
67  pcaHelper_.clear();
68  return;
69  }
70 
71  pcaHelper_.storeRecHits(*theElectron.electronCluster());
72  if (debug_)
73  std::cout << " Stored the hits belonging to the electronCluster " << std::endl;
74 
75  // initial computation, no radius cut, but halo hits not taken
76  if (debug_)
77  std::cout << " Calling PCA initial computation" << std::endl;
79  // first computation within cylinder, halo hits included
81  // second computation within cylinder, halo hits included
85 }
void computeShowerWidth(float radius, bool withHalo=true)
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_
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:220
HGCalIsoCalculator isoHelper_

◆ eigenValues()

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_

◆ energyPerLayer()

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

Definition at line 55 of file HGCalEgammaIDHelper.h.

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

55  {
56  return pcaHelper_.energyPerLayer(radius, withHalo);
57  }
LongDeps energyPerLayer(float radius, bool withHalo=true)
hgcal::EGammaPCAHelper pcaHelper_

◆ eventInit()

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

Definition at line 24 of file HGCalEgammaIDHelper.cc.

References caloGeometry_, edm::EventSetup::getData(), hitMap_, iEvent, isoHelper_, pcaHelper_, recHitsBH_, recHitsEE_, recHitsFH_, recHitTools_, hgcal::RecHitTools::setGeometry(), hgcal::EGammaPCAHelper::setHitMap(), hgcal::EGammaPCAHelper::setRecHits(), 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 
33  pcaHelper_.setRecHits(recHitHandleEE, recHitHandleFH, recHitHandleBH);
34  isoHelper_.setRecHits(recHitHandleEE, recHitHandleFH, recHitHandleBH);
35 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
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_
int iEvent
Definition: GenABIO.cc:224
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
edm::EDGetTokenT< std::unordered_map< DetId, const unsigned int > > hitMap_
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
hgcal::EGammaPCAHelper pcaHelper_
void setHitMap(const std::unordered_map< DetId, const unsigned int > *hitMap)
to set once per event
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:79
HGCalIsoCalculator isoHelper_
void setRecHits(edm::Handle< HGCRecHitCollection > recHitHandleEE, edm::Handle< HGCRecHitCollection > recHitHandleFH, edm::Handle< HGCRecHitCollection > recHitHandleBH)

◆ getIsolationRing()

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

Definition at line 65 of file HGCalEgammaIDHelper.h.

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

65 { return isoHelper_.getIso(ring); };
const float getIso(const unsigned int ring) const
HGCalIsoCalculator isoHelper_

◆ pcaHelper()

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

Definition at line 69 of file HGCalEgammaIDHelper.h.

References pcaHelper_.

69 { return &pcaHelper_; }
hgcal::EGammaPCAHelper pcaHelper_

◆ printHits()

void HGCalEgammaIDHelper::printHits ( float  radius) const
inline

◆ sigmaEE()

double HGCalEgammaIDHelper::sigmaEE ( ) const
inline

Definition at line 47 of file HGCalEgammaIDHelper.h.

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

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

◆ sigmaPP()

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_

◆ sigmas()

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_

◆ sigmaUU()

double HGCalEgammaIDHelper::sigmaUU ( ) const
inline

Definition at line 45 of file HGCalEgammaIDHelper.h.

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

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

◆ sigmaVV()

double HGCalEgammaIDHelper::sigmaVV ( ) const
inline

Definition at line 46 of file HGCalEgammaIDHelper.h.

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

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

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