CMS 3D CMS Logo

HGCalEgammaIDHelper.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
2 //
3 // EGammaID Helper
4 //
5 // Helper Class to compute HGCal Egamma cluster ID observables
6 //
7 // Authors: F. Beaudette, A. Lobanov, N. Smith
8 //--------------------------------------------------------------------------------------------------
9 
10 #ifndef RecoEgamma_EgammaTools_HGCalEgammaIDHelper_h
11 #define RecoEgamma_EgammaTools_HGCalEgammaIDHelper_h
12 
20 
25 
28 #include <vector>
29 #include "HGCalIsoCalculator.h"
30 
32 public:
36 
37  // Use eventInit once per event
38  void eventInit(const edm::Event& iEvent, const edm::EventSetup& iSetup);
39 
40  // Call computeHGCAL before accessing results below
41  void computeHGCAL(const reco::Photon& thePhoton, float radius);
42  void computeHGCAL(const reco::GsfElectron& theElectron, float radius);
43 
44  // PCA results
45  double sigmaUU() const { return pcaHelper_.sigmaUU(); }
46  double sigmaVV() const { return pcaHelper_.sigmaVV(); }
47  double sigmaEE() const { return pcaHelper_.sigmaEE(); }
48  double sigmaPP() const { return pcaHelper_.sigmaPP(); }
49  const TVectorD& eigenValues() const { return pcaHelper_.eigenValues(); }
50  const TVectorD& sigmas() const { return pcaHelper_.sigmas(); }
51  const math::XYZPoint& barycenter() const { return pcaHelper_.barycenter(); }
52  const math::XYZVector& axis() const { return pcaHelper_.axis(); }
53 
54  // longitudinal energy deposits and energy per subdetector as well as layers crossed
55  hgcal::LongDeps energyPerLayer(float radius, bool withHalo = true) {
56  return pcaHelper_.energyPerLayer(radius, withHalo);
57  }
58 
59  // shower depth (distance between start and shower max) from ShowerDepth tool
60  float clusterDepthCompatibility(const hgcal::LongDeps& ld, float& measDepth, float& expDepth, float& expSigma) {
61  return pcaHelper_.clusterDepthCompatibility(ld, measDepth, expDepth, expSigma);
62  }
63 
64  // projective calo isolation
65  inline float getIsolationRing(unsigned int ring) const { return isoHelper_.getIso(ring); };
66 
67  // for debugging purposes
68  void printHits(float radius) const { pcaHelper_.printHits(radius); }
69  const hgcal::EGammaPCAHelper* pcaHelper() const { return &pcaHelper_; }
70 
71 private:
76 
77  std::vector<double> dEdXWeights_;
86  bool debug_;
87 };
88 
89 #endif
HGCalEgammaIDHelper::pcaHelper
const hgcal::EGammaPCAHelper * pcaHelper() const
Definition: HGCalEgammaIDHelper.h:69
hgcal::EGammaPCAHelper::clusterDepthCompatibility
float clusterDepthCompatibility(const LongDeps &, float &measuredDepth, float &expectedDepth, float &expectedSigma)
Definition: EgammaPCAHelper.cc:307
hgcal::RecHitTools
Definition: RecHitTools.h:23
HGCalEgammaIDHelper::computeHGCAL
void computeHGCAL(const reco::Photon &thePhoton, float radius)
Definition: HGCalEgammaIDHelper.cc:36
HGCalEgammaIDHelper
Definition: HGCalEgammaIDHelper.h:31
HGCalEgammaIDHelper::eventInit
void eventInit(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: HGCalEgammaIDHelper.cc:24
ESHandle.h
hgcal::EGammaPCAHelper::sigmas
const TVectorD & sigmas() const
Definition: EgammaPCAHelper.h:67
HGCalEgammaIDHelper::axis
const math::XYZVector & axis() const
Definition: HGCalEgammaIDHelper.h:52
edm::EDGetTokenT
Definition: EDGetToken.h:33
HGCalEgammaIDHelper::isoHelper_
HGCalIsoCalculator isoHelper_
Definition: HGCalEgammaIDHelper.h:79
HGCalIsoCalculator::getIso
const float getIso(const unsigned int ring) const
Definition: HGCalIsoCalculator.cc:114
HGCalEgammaIDHelper::printHits
void printHits(float radius) const
Definition: HGCalEgammaIDHelper.h:68
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
LongDeps.h
HGCalEgammaIDHelper::sigmaUU
double sigmaUU() const
Definition: HGCalEgammaIDHelper.h:45
hgcal::EGammaPCAHelper::eigenValues
const TVectorD & eigenValues() const
Definition: EgammaPCAHelper.h:66
ESGetToken.h
HGCalEgammaIDHelper::sigmaPP
double sigmaPP() const
Definition: HGCalEgammaIDHelper.h:48
Photon.h
HGCalIsoCalculator
Definition: HGCalIsoCalculator.h:46
hgcal::EGammaPCAHelper
Definition: EgammaPCAHelper.h:33
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
HGCalEgammaIDHelper::clusterDepthCompatibility
float clusterDepthCompatibility(const hgcal::LongDeps &ld, float &measDepth, float &expDepth, float &expSigma)
Definition: HGCalEgammaIDHelper.h:60
HGCalEgammaIDHelper::eigenValues
const TVectorD & eigenValues() const
Definition: HGCalEgammaIDHelper.h:49
reco::GsfElectron
Definition: GsfElectron.h:35
HGCalEgammaIDHelper::HGCalEgammaIDHelper
HGCalEgammaIDHelper()
Definition: HGCalEgammaIDHelper.h:33
HGCalEgammaIDHelper::recHitsFH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
Definition: HGCalEgammaIDHelper.h:81
HGCalEgammaIDHelper::fhRecHitInputTag_
edm::InputTag fhRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:73
GsfElectronFwd.h
HGCRecHitCollections.h
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Event.h
HGCalEgammaIDHelper::debug_
bool debug_
Definition: HGCalEgammaIDHelper.h:86
HGCalEgammaIDHelper::dEdXWeights_
std::vector< double > dEdXWeights_
Definition: HGCalEgammaIDHelper.h:77
hgcal::LongDeps
Definition: LongDeps.h:14
hgcal::EGammaPCAHelper::axis
const math::XYZVector & axis() const
Definition: EgammaPCAHelper.h:57
HGCalEgammaIDHelper::~HGCalEgammaIDHelper
~HGCalEgammaIDHelper()
Definition: HGCalEgammaIDHelper.h:35
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
iEvent
int iEvent
Definition: GenABIO.cc:224
HGCalEgammaIDHelper::eeRecHitInputTag_
edm::InputTag eeRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:72
HGCalEgammaIDHelper::sigmaVV
double sigmaVV() const
Definition: HGCalEgammaIDHelper.h:46
HGCalEgammaIDHelper::recHitsEE_
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
Definition: HGCalEgammaIDHelper.h:80
edm::EventSetup
Definition: EventSetup.h:57
HGCalEgammaIDHelper::bhRecHitInputTag_
edm::InputTag bhRecHitInputTag_
Definition: HGCalEgammaIDHelper.h:74
hgcal::EGammaPCAHelper::sigmaPP
double sigmaPP() const
Definition: EgammaPCAHelper.h:64
edm::ESGetToken< CaloGeometry, CaloGeometryRecord >
hgcal::EGammaPCAHelper::sigmaUU
double sigmaUU() const
Definition: EgammaPCAHelper.h:61
InputTag.h
reco::Photon
Definition: Photon.h:21
Frameworkfwd.h
HGCalEgammaIDHelper::pcaHelper_
hgcal::EGammaPCAHelper pcaHelper_
Definition: HGCalEgammaIDHelper.h:78
HGCalEgammaIDHelper::barycenter
const math::XYZPoint & barycenter() const
Definition: HGCalEgammaIDHelper.h:51
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
HGCalIsoCalculator.h
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
EgammaPCAHelper.h
ConsumesCollector.h
ParameterSet.h
hgcal::EGammaPCAHelper::barycenter
const math::XYZPoint & barycenter() const
Definition: EgammaPCAHelper.h:56
edm::Event
Definition: Event.h:73
HGCalEgammaIDHelper::getIsolationRing
float getIsolationRing(unsigned int ring) const
Definition: HGCalEgammaIDHelper.h:65
HGCalEgammaIDHelper::energyPerLayer
hgcal::LongDeps energyPerLayer(float radius, bool withHalo=true)
Definition: HGCalEgammaIDHelper.h:55
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
HGCalEgammaIDHelper::sigmas
const TVectorD & sigmas() const
Definition: HGCalEgammaIDHelper.h:50
CaloCluster.h
HGCalEgammaIDHelper::sigmaEE
double sigmaEE() const
Definition: HGCalEgammaIDHelper.h:47