CMS 3D CMS Logo

EcalRegressionData.h
Go to the documentation of this file.
1 #ifndef EgammaElectronAlgos_EcalRegressionData_h
2 #define EgammaElectronAlgos_EcalRegressionData_h
3 
7 #include <vector>
8 #include <cmath>
9 
10 class CaloGeometry;
11 class CaloTopology;
12 
13 namespace reco {
14  class SuperCluster;
15 }
16 
18 public:
20 
21  //this exists due to concerns that sub-cluster 1 is actually accessed
22  //by subClusRawE_[0] and could potentially cause bugs
23  //this although slightly wordy, makes it absolutely clear
24  enum class SubClusNr { C1 = 0, C2 = 1, C3 = 2 };
25 
26  //direct accessors
27  bool isEB() const { return isEB_; }
28  float scRawEnergy() const { return scRawEnergy_; }
29  float scCalibEnergy() const { return scCalibEnergy_; }
30  float scPreShowerEnergy() const { return scPreShowerEnergy_; }
31  float scEta() const { return scEta_; }
32  float scPhi() const { return scPhi_; }
33  float scEtaWidth() const { return scEtaWidth_; }
34  float scPhiWidth() const { return scPhiWidth_; }
36  float seedClusEnergy() const { return seedClusEnergy_; }
37  float eMax() const { return eMax_; }
38  float e2nd() const { return e2nd_; }
39  float e3x3() const { return e3x3_; }
40  float eTop() const { return eTop_; }
41  float eBottom() const { return eBottom_; }
42  float eLeft() const { return eLeft_; }
43  float eRight() const { return eRight_; }
44  float sigmaIEtaIEta() const { return sigmaIEtaIEta_; }
45  float sigmaIEtaIPhi() const { return sigmaIEtaIPhi_; }
46  float sigmaIPhiIPhi() const { return sigmaIPhiIPhi_; }
47 
48  float seedCrysPhiOrY() const { return seedCrysPhiOrY_; }
49  float seedCrysEtaOrX() const { return seedCrysEtaOrX_; }
50  float seedCrysIEtaOrIX() const { return seedCrysIEtaOrIX_; }
51  float seedCrysIPhiOrIY() const { return seedCrysIPhiOrIY_; }
52  float maxSubClusDR() const { return std::sqrt(maxSubClusDR2_); }
53  float maxSubClusDRDPhi() const { return maxSubClusDRDPhi_; }
54  float maxSubClusDRDEta() const { return maxSubClusDRDEta_; }
56  const std::vector<float>& subClusRawEnergy() const { return subClusRawEnergy_; }
57  const std::vector<float>& subClusDPhi() const { return subClusDPhi_; }
58  const std::vector<float>& subClusDEta() const { return subClusDEta_; }
59  int nrVtx() const { return nrVtx_; }
60 
61  //indirect accessors
63  float scSeedR9() const { return divideBySCRawEnergy_(e3x3()); }
65  float eMaxOverSCRawEnergy() const { return divideBySCRawEnergy_(eMax()); }
66  float e2ndOverSCRawEnergy() const { return divideBySCRawEnergy_(e2nd()); }
67  float seedLeftRightAsym() const;
68  float seedTopBottomAsym() const;
70  float subClusRawEnergyOverSCRawEnergy(size_t clusNr) const { return divideBySCRawEnergy_(subClusRawEnergy(clusNr)); }
71  float subClusRawEnergy(size_t clusNr) const;
72  float subClusDPhi(size_t clusNr) const;
73  float subClusDEta(size_t clusNr) const;
75  return subClusRawEnergyOverSCRawEnergy(static_cast<int>(clusNr));
76  }
77  float subClusRawEnergy(SubClusNr clusNr) const { return subClusRawEnergy(static_cast<int>(clusNr)); }
78  float subClusDPhi(SubClusNr clusNr) const { return subClusDPhi(static_cast<int>(clusNr)); }
79  float subClusDEta(SubClusNr clusNr) const { return subClusDEta(static_cast<int>(clusNr)); }
80 
81  //modifiers
82  void fill(const reco::SuperCluster& superClus,
83  const EcalRecHitCollection* ebRecHits,
84  const EcalRecHitCollection* eeRecHits,
85  const CaloGeometry* geom,
86  const CaloTopology* topology,
88  fill(superClus, ebRecHits, eeRecHits, geom, topology, vertices->size());
89  }
90  void fill(const reco::SuperCluster& superClus,
91  const EcalRecHitCollection* ebRecHits,
92  const EcalRecHitCollection* eeRecHits,
93  const CaloGeometry* geom,
94  const CaloTopology* topology,
95  int nrVertices);
96  void clear();
97 
98  //converts output to single vector for use in training
99  void fillVec(std::vector<float>& inputVec) const;
100 
101 private:
102  //0 is obviously not a sensible energy for a supercluster so just return zero if this is the case
103  float divideBySCRawEnergy_(float numer) const { return scRawEnergy() != 0 ? numer / scRawEnergy() : 0.; }
104  void fillVecEB_(std::vector<float>& inputVec) const;
105  void fillVecEE_(std::vector<float>& inputVec) const;
106 
107 private:
108  bool isEB_;
109 
110  //supercluster quantities
114  float scEta_;
115  float scPhi_;
116  float scEtaWidth_;
117  float scPhiWidth_;
118  int scNrAdditionalClusters_; //excludes seed cluster
119 
120  //seed cluster quantities
122  float eMax_;
123  float e2nd_;
124  float e3x3_;
125  float eTop_;
126  float eBottom_;
127  float eLeft_;
128  float eRight_;
132 
133  //seed crystal quantities
138 
139  //sub cluster (non-seed) quantities
144  std::vector<float> subClusRawEnergy_;
145  std::vector<float> subClusDPhi_;
146  std::vector<float> subClusDEta_;
147 
148  //event quantities
149  int nrVtx_;
150 };
151 
152 #endif
EcalRegressionData::seedCrysIPhiOrIY
float seedCrysIPhiOrIY() const
Definition: EcalRegressionData.h:51
EcalRegressionData::eMaxOverSCRawEnergy
float eMaxOverSCRawEnergy() const
Definition: EcalRegressionData.h:65
EcalRegressionData::eTop
float eTop() const
Definition: EcalRegressionData.h:40
EcalRegressionData::seedClusEnergy
float seedClusEnergy() const
Definition: EcalRegressionData.h:36
EcalRegressionData::eBottom_
float eBottom_
Definition: EcalRegressionData.h:126
EcalRegressionData::SubClusNr
SubClusNr
Definition: EcalRegressionData.h:24
EcalRegressionData::sigmaIEtaIEta
float sigmaIEtaIEta() const
Definition: EcalRegressionData.h:44
EcalRegressionData::eRight
float eRight() const
Definition: EcalRegressionData.h:43
EcalRegressionData::scRawEnergy
float scRawEnergy() const
Definition: EcalRegressionData.h:28
EcalRegressionData::seedCrysPhiOrY
float seedCrysPhiOrY() const
Definition: EcalRegressionData.h:48
EcalRegressionData::maxSubClusDRRawEnergy
float maxSubClusDRRawEnergy() const
Definition: EcalRegressionData.h:55
reco::SuperCluster
Definition: SuperCluster.h:18
EcalRegressionData::eLeft_
float eLeft_
Definition: EcalRegressionData.h:127
EcalRegressionData::seedTopBottomAsym
float seedTopBottomAsym() const
Definition: EcalRegressionData.cc:22
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
EcalRegressionData::fillVecEE_
void fillVecEE_(std::vector< float > &inputVec) const
Definition: EcalRegressionData.cc:205
EcalRegressionData::sigmaIEtaIEta_
float sigmaIEtaIEta_
Definition: EcalRegressionData.h:129
EcalRegressionData::clear
void clear()
Definition: EcalRegressionData.cc:118
EcalRegressionData::subClusDPhi
float subClusDPhi(SubClusNr clusNr) const
Definition: EcalRegressionData.h:78
edm::SortedCollection< EcalRecHit >
EcalRegressionData
Definition: EcalRegressionData.h:17
EcalRegressionData::e2ndOverSCRawEnergy
float e2ndOverSCRawEnergy() const
Definition: EcalRegressionData.h:66
EcalRegressionData::seedLeftRightAsym
float seedLeftRightAsym() const
Definition: EcalRegressionData.cc:16
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
EcalRegressionData::maxSubClusDRDPhi
float maxSubClusDRDPhi() const
Definition: EcalRegressionData.h:53
EcalRegressionData::maxSubClusDRDEta
float maxSubClusDRDEta() const
Definition: EcalRegressionData.h:54
EcalRegressionData::scCalibEnergy_
float scCalibEnergy_
Definition: EcalRegressionData.h:112
EcalRegressionData::maxSubClusDRDEta_
float maxSubClusDRDEta_
Definition: EcalRegressionData.h:142
EcalRegressionData::eLeft
float eLeft() const
Definition: EcalRegressionData.h:42
CaloTopology
Definition: CaloTopology.h:19
EcalRegressionData::SubClusNr::C1
EcalRegressionData::subClusDEta
const std::vector< float > & subClusDEta() const
Definition: EcalRegressionData.h:58
EcalRegressionData::e2nd
float e2nd() const
Definition: EcalRegressionData.h:38
EcalRecHitCollections.h
EcalRegressionData::seedCrysIEtaOrIX
float seedCrysIEtaOrIX() const
Definition: EcalRegressionData.h:50
EcalRegressionData::subClusDPhi_
std::vector< float > subClusDPhi_
Definition: EcalRegressionData.h:145
EcalRegressionData::seedCrysIEtaOrIX_
int seedCrysIEtaOrIX_
Definition: EcalRegressionData.h:136
EcalRegressionData::eRight_
float eRight_
Definition: EcalRegressionData.h:128
EcalRegressionData::eMax
float eMax() const
Definition: EcalRegressionData.h:37
EcalRegressionData::sigmaIPhiIPhi_
float sigmaIPhiIPhi_
Definition: EcalRegressionData.h:131
CaloGeometry
Definition: CaloGeometry.h:21
EcalRegressionData::fill
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
Definition: EcalRegressionData.h:82
EcalRegressionData::subClusRawEnergyOverSCRawEnergy
float subClusRawEnergyOverSCRawEnergy(SubClusNr clusNr) const
Definition: EcalRegressionData.h:74
EcalRegressionData::e3x3_
float e3x3_
Definition: EcalRegressionData.h:124
ecaldqm::topology
const CaloTopology * topology(nullptr)
EcalRegressionData::scPreShowerEnergy_
float scPreShowerEnergy_
Definition: EcalRegressionData.h:113
EcalRegressionData::isEB
bool isEB() const
Definition: EcalRegressionData.h:27
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalRegressionData::seedCrysIPhiOrIY_
int seedCrysIPhiOrIY_
Definition: EcalRegressionData.h:137
EcalRegressionData::maxSubClusDRDPhi_
float maxSubClusDRDPhi_
Definition: EcalRegressionData.h:141
EcalRegressionData::SubClusNr::C3
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
EcalRegressionData::scPhiWidth_
float scPhiWidth_
Definition: EcalRegressionData.h:117
EcalRegressionData::sigmaIEtaIPhi_
float sigmaIEtaIPhi_
Definition: EcalRegressionData.h:130
EcalRegressionData::subClusDEta
float subClusDEta(SubClusNr clusNr) const
Definition: EcalRegressionData.h:79
EcalRegressionData::SubClusNr::C2
EcalRegressionData::EcalRegressionData
EcalRegressionData()
Definition: EcalRegressionData.h:19
Vertex.h
EcalRegressionData::scNrAdditionalClusters
int scNrAdditionalClusters() const
Definition: EcalRegressionData.h:35
EcalRegressionData::maxSubClusDR
float maxSubClusDR() const
Definition: EcalRegressionData.h:52
EcalRegressionData::nrVtx_
int nrVtx_
Definition: EcalRegressionData.h:149
EcalRegressionData::scEtaWidth_
float scEtaWidth_
Definition: EcalRegressionData.h:116
EcalRegressionData::subClusRawEnergy
float subClusRawEnergy(SubClusNr clusNr) const
Definition: EcalRegressionData.h:77
EcalRegressionData::scEtaWidth
float scEtaWidth() const
Definition: EcalRegressionData.h:33
EcalRegressionData::maxSubClusDR2_
float maxSubClusDR2_
Definition: EcalRegressionData.h:140
EcalRegressionData::fillVec
void fillVec(std::vector< float > &inputVec) const
Definition: EcalRegressionData.cc:158
EcalRegressionData::subClusDPhi
const std::vector< float > & subClusDPhi() const
Definition: EcalRegressionData.h:57
EcalRegressionData::e3x3
float e3x3() const
Definition: EcalRegressionData.h:39
EcalRegressionData::nrVtx
int nrVtx() const
Definition: EcalRegressionData.h:59
EcalRegressionData::seedCrysEtaOrX
float seedCrysEtaOrX() const
Definition: EcalRegressionData.h:49
EcalRegressionData::scCalibEnergy
float scCalibEnergy() const
Definition: EcalRegressionData.h:29
EcalRegressionData::scRawEnergy_
float scRawEnergy_
Definition: EcalRegressionData.h:111
VertexFwd.h
EcalRegressionData::eTop_
float eTop_
Definition: EcalRegressionData.h:125
EcalRegressionData::seedCrysPhiOrY_
float seedCrysPhiOrY_
Definition: EcalRegressionData.h:134
EcalRegressionData::scPreShowerEnergy
float scPreShowerEnergy() const
Definition: EcalRegressionData.h:30
EcalRegressionData::eBottom
float eBottom() const
Definition: EcalRegressionData.h:41
EcalRegressionData::subClusRawEnergy
const std::vector< float > & subClusRawEnergy() const
Definition: EcalRegressionData.h:56
EcalRegressionData::eMax_
float eMax_
Definition: EcalRegressionData.h:122
EcalRegressionData::scSeedR9
float scSeedR9() const
Definition: EcalRegressionData.h:63
EcalRegressionData::maxSubClusDRRawEnergy_
float maxSubClusDRRawEnergy_
Definition: EcalRegressionData.h:143
EcalRegressionData::sigmaIEtaIPhi
float sigmaIEtaIPhi() const
Definition: EcalRegressionData.h:45
EcalRegressionData::scPhi
float scPhi() const
Definition: EcalRegressionData.h:32
EcalRegressionData::fillVecEB_
void fillVecEB_(std::vector< float > &inputVec) const
Definition: EcalRegressionData.cc:165
EcalRegressionData::seedClusEnergy_
float seedClusEnergy_
Definition: EcalRegressionData.h:121
EcalRegressionData::isEB_
bool isEB_
Definition: EcalRegressionData.h:108
EcalRegressionData::subClusDEta_
std::vector< float > subClusDEta_
Definition: EcalRegressionData.h:146
EcalRegressionData::scNrAdditionalClusters_
int scNrAdditionalClusters_
Definition: EcalRegressionData.h:118
EcalRegressionData::scPhiWidth
float scPhiWidth() const
Definition: EcalRegressionData.h:34
EcalRegressionData::seedCrysEtaOrX_
float seedCrysEtaOrX_
Definition: EcalRegressionData.h:135
EcalRegressionData::subClusRawEnergyOverSCRawEnergy
float subClusRawEnergyOverSCRawEnergy(size_t clusNr) const
Definition: EcalRegressionData.h:70
EcalRegressionData::scEta_
float scEta_
Definition: EcalRegressionData.h:114
EcalRegressionData::maxSubClusDRRawEnergyOverSCRawEnergy
float maxSubClusDRRawEnergyOverSCRawEnergy() const
Definition: EcalRegressionData.h:69
EcalRegressionData::scPreShowerEnergyOverSCRawEnergy
float scPreShowerEnergyOverSCRawEnergy() const
Definition: EcalRegressionData.h:62
EcalRegressionData::scEta
float scEta() const
Definition: EcalRegressionData.h:31
EcalRegressionData::e2nd_
float e2nd_
Definition: EcalRegressionData.h:123
EcalRegressionData::seedClusEnergyOverSCRawEnergy
float seedClusEnergyOverSCRawEnergy() const
Definition: EcalRegressionData.h:64
EcalRegressionData::subClusRawEnergy_
std::vector< float > subClusRawEnergy_
Definition: EcalRegressionData.h:144
EcalRegressionData::sigmaIPhiIPhi
float sigmaIPhiIPhi() const
Definition: EcalRegressionData.h:46
EcalRegressionData::scPhi_
float scPhi_
Definition: EcalRegressionData.h:115
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
EcalRegressionData::divideBySCRawEnergy_
float divideBySCRawEnergy_(float numer) const
Definition: EcalRegressionData.h:103