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

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 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::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
edm::InputTag hitMapInputTag_
std::vector< double > dEdXWeights_
hgcal::EGammaPCAHelper pcaHelper_
HGCalIsoCalculator isoHelper_
edm::EDGetTokenT< std::unordered_map< DetId, const HGCRecHit * > > hitMap_
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 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(), CosmicsPD_Skims::radius, 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)
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 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(), CosmicsPD_Skims::radius, 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)
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(), 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  isoHelper_.setRecHits(recHitHandleEE, recHitHandleFH, recHitHandleBH);
34 }
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)
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry_
hgcal::EGammaPCAHelper pcaHelper_
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:79
HGCalIsoCalculator isoHelper_
void setHitMap(const std::unordered_map< DetId, const HGCRecHit *> *hitMap)
to set once per event
edm::EDGetTokenT< std::unordered_map< DetId, const HGCRecHit * > > hitMap_

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