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_
 
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 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_, debug_, dEdXWeights_, eeRecHitInputTag_, fhRecHitInputTag_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), isoHelper_, pcaHelper_, recHitsBH_, recHitsEE_, recHitsFH_, hgcal::EGammaPCAHelper::setdEdXWeights(), HGCalIsoCalculator::setDeltaR(), HGCalIsoCalculator::setMinDeltaR(), and HGCalIsoCalculator::setNRings().

5  :
6  eeRecHitInputTag_(iConfig.getParameter<edm::InputTag> ("EERecHits") ),
7  fhRecHitInputTag_(iConfig.getParameter<edm::InputTag> ("FHRecHits") ),
8  bhRecHitInputTag_(iConfig.getParameter<edm::InputTag> ("BHRecHits") ),
9  dEdXWeights_(iConfig.getParameter<std::vector<double> >("dEdXWeights"))
10 {
11  isoHelper_.setDeltaR(iConfig.getParameter<double>("isoDeltaR"));
12  isoHelper_.setNRings(iConfig.getParameter<unsigned int>("isoNRings"));
13  isoHelper_.setMinDeltaR(iConfig.getParameter<double>("isoDeltaRmin"));
14 
19  debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
20 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
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_
std::vector< double > dEdXWeights_
hgcal::EGammaPCAHelper pcaHelper_
HGCalIsoCalculator isoHelper_
edm::InputTag eeRecHitInputTag_
HGCalEgammaIDHelper::~HGCalEgammaIDHelper ( )
inline

Definition at line 35 of file HGCalEgammaIDHelper.h.

References computeHGCAL(), eventInit(), iEvent, and TCMET_cfi::radius.

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

61  { return pcaHelper_.clusterDepthCompatibility(ld,measDepth,expDepth,expSigma);}
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 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(), hgcal::EGammaPCAHelper::storeRecHits(), and reco::Photon::superCluster().

Referenced by ~HGCalEgammaIDHelper().

37  {
38  if (thePhoton.isEB()) {
39  if (debug_) 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)
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
void storeRecHits(const reco::CaloCluster &theCluster)
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
hgcal::EGammaPCAHelper pcaHelper_
bool isEB() const
Definition: Photon.h:121
HGCalIsoCalculator isoHelper_
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_) std::cout << "The electron is in the barrel" <<std::endl;
65  pcaHelper_.clear();
66  return;
67  }
68 
69  pcaHelper_.storeRecHits(*theElectron.electronCluster());
70  if (debug_)
71  std::cout << " Stored the hits belonging to the electronCluster " << std::endl;
72 
73  // initial computation, no radius cut, but halo hits not taken
74  if (debug_)
75  std::cout << " Calling PCA initial computation" << std::endl;
77  // first computation within cylinder, halo hits included
79  // second computation within cylinder, halo hits included
83 }
void computeShowerWidth(float radius, bool withHalo=true)
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:244
void computePCA(float radius, bool withHalo=true)
bool isEB() const
Definition: GsfElectron.h:352
void storeRecHits(const reco::CaloCluster &theCluster)
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
hgcal::EGammaPCAHelper pcaHelper_
HGCalIsoCalculator isoHelper_
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 22 of file HGCalEgammaIDHelper.cc.

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

Referenced by ~HGCalEgammaIDHelper().

22  {
23  edm::Handle<HGCRecHitCollection> recHitHandleEE;
24  iEvent.getByToken(recHitsEE_, recHitHandleEE);
25  edm::Handle<HGCRecHitCollection> recHitHandleFH;
26  iEvent.getByToken(recHitsFH_, recHitHandleFH);
27  edm::Handle<HGCRecHitCollection> recHitHandleBH;
28  iEvent.getByToken(recHitsBH_, recHitHandleBH);
29 
33  pcaHelper_.fillHitMap(*recHitHandleEE,*recHitHandleFH,*recHitHandleBH);
34  isoHelper_.setRecHits(recHitHandleEE, recHitHandleFH, recHitHandleBH);
35 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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_
void getEventSetup(const edm::EventSetup &)
Definition: RecHitTools.cc:79
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
hgcal::EGammaPCAHelper pcaHelper_
HGCalIsoCalculator isoHelper_
void fillHitMap(const HGCRecHitCollection &HGCEERecHits, const HGCRecHitCollection &HGCFHRecHits, const HGCRecHitCollection &HGCBHRecHits)
to compute from inside - once per event
float HGCalEgammaIDHelper::getIsolationRing ( unsigned int  ring) const
inline

Definition at line 64 of file HGCalEgammaIDHelper.h.

References HGCalIsoCalculator::getIso(), and isoHelper_.

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

bool HGCalEgammaIDHelper::debug_
private

Definition at line 83 of file HGCalEgammaIDHelper.h.

Referenced by computeHGCAL(), and HGCalEgammaIDHelper().

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

Definition at line 76 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().

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

Definition at line 81 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

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

Definition at line 79 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

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

Definition at line 80 of file HGCalEgammaIDHelper.h.

Referenced by eventInit(), and HGCalEgammaIDHelper().

hgcal::RecHitTools HGCalEgammaIDHelper::recHitTools_
private

Definition at line 82 of file HGCalEgammaIDHelper.h.

Referenced by eventInit().