CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
eECALMatrix.h
Go to the documentation of this file.
1 // -*- C++ -*
2 /*
3 The function eECALmatrix returns total energy contained in
4 NxN crystal matrix for EcalRecHits or PCaloSimHits.
5 
6 Inputs :
7 1. CaloNavigator at the DetId around which NxN has to be formed
8 2. The EcalRecHitCollection and
9 3. Number of crystals to be navigated along eta and phi along
10  one direction (navigation is done alone +-deta and +-dphi).
11 
12 Authors: Seema Sharma, Sunanda Banerjee
13 Created: August 2009
14 */
15 
16 #ifndef CalibrationIsolatedParticleseECALMatrix_h
17 #define CalibrationIsolatedParticleseECALMatrix_h
18 
19 // system include files
20 #include <memory>
21 #include <map>
22 #include <vector>
23 
24 // user include files
32 
39 
41 
42 namespace spr {
43 
44  // Energy in NxN crystal matrix
45  template <typename T>
46  double eECALmatrix(const DetId& detId,
47  edm::Handle<T>& hitsEB,
48  edm::Handle<T>& hitsEE,
49  const CaloGeometry* geo,
50  const CaloTopology* caloTopology,
51  int ieta,
52  int iphi,
53  double ebThr = -100,
54  double eeThr = -100,
55  double tMin = -500,
56  double tMax = 500,
57  bool debug = false);
58 
59  template <typename T>
60  double eECALmatrix(const DetId& detId,
61  edm::Handle<T>& hitsEB,
62  edm::Handle<T>& hitsEE,
63  const CaloGeometry* geo,
64  const CaloTopology* caloTopology,
65  const EcalTrigTowerConstituentsMap& ttMap,
66  int ieta,
67  int iphi,
68  double ebThr = -100,
69  double eeThr = -100,
70  double tMin = -500,
71  double tMax = 500,
72  bool debug = false);
73 
74  template <typename T>
75  double eECALmatrix(const DetId& detId,
76  edm::Handle<T>& hitsEB,
77  edm::Handle<T>& hitsEE,
78  const CaloGeometry* geo,
79  const CaloTopology* caloTopology,
80  int ietaE,
81  int ietaW,
82  int iphiN,
83  int iphiS,
84  double ebThr = -100,
85  double eeThr = -100,
86  double tMin = -500,
87  double tMax = 500,
88  bool debug = false);
89 
90  std::pair<double, bool> eECALmatrix(const DetId& detId,
93  const EcalChannelStatus& chStatus,
94  const CaloGeometry* geo,
95  const CaloTopology* caloTopology,
96  const EcalSeverityLevelAlgo* sevlv,
97  int ieta,
98  int iphi,
99  double ebThr = -100,
100  double eeThr = -100,
101  double tMin = -500,
102  double tMax = 500,
103  bool debug = false);
104 
105  std::pair<double, bool> eECALmatrix(const DetId& detId,
108  const EcalChannelStatus& chStatus,
109  const CaloGeometry* geo,
110  const CaloTopology* caloTopology,
111  const EcalSeverityLevelAlgo* sevlv,
112  const EcalTrigTowerConstituentsMap& ttMap,
113  int ieta,
114  int iphi,
115  double ebThr = -100,
116  double eeThr = -100,
117  double tMin = -500,
118  double tMax = 500,
119  bool debug = false);
120 
121  std::pair<double, bool> eECALmatrix(const HcalDetId& detId,
124  const CaloGeometry* geo,
125  const CaloTowerConstituentsMap* ctmap,
126  const EcalSeverityLevelAlgo* sevlv,
127  double ebThr = -100,
128  double eeThr = -100,
129  double tMin = -500,
130  double tMax = 500,
131  bool debug = false);
132 
133  // returns vector of hits in NxN matrix
134  template <typename T>
136  edm::Handle<T>& hits,
137  int ieta,
138  int iphi,
139  std::vector<typename T::const_iterator>& hitlist,
140  bool debug = false);
141 
142  // returns energy deposited from the vector of hits
143  template <typename T>
144  double energyECAL(std::vector<DetId>& vdets,
145  edm::Handle<T>& hitsEB,
146  edm::Handle<T>& hitsEE,
147  double ebThr = -100,
148  double eeThr = -100,
149  double tMin = -500,
150  double tMax = 500,
151  bool debug = false);
152 
153  template <typename T>
154  double energyECAL(std::vector<DetId>& vdets,
155  edm::Handle<T>& hitsEB,
156  edm::Handle<T>& hitsEE,
157  const EcalTrigTowerConstituentsMap& ttMap,
158  double ebThr = -100,
159  double eeThr = -100,
160  double tMin = -500,
161  double tMax = 500,
162  bool debug = false);
163 
164  // returns energy in the EB/EE tower
165  template <typename T>
166  double energyECALTower(const DetId& detId,
167  edm::Handle<T>& hitsEB,
168  edm::Handle<T>& hitsEE,
169  const EcalTrigTowerConstituentsMap& ttMap,
170  bool debug = false);
171 
172  // Hot Crystal
173  template <typename T>
174  DetId hotCrystal(const DetId& detId,
175  edm::Handle<T>& hitsEB,
176  edm::Handle<T>& hitsEE,
177  const CaloGeometry* geo,
178  const CaloTopology* caloTopology,
179  int ieta,
180  int iphi,
181  double tMin = -500,
182  double tMax = 500,
183  bool debug = false);
184 
185  template <typename T>
186  DetId hotCrystal(std::vector<DetId>& detId,
187  edm::Handle<T>& hitsEB,
188  edm::Handle<T>& hitsEE,
189  double tMin = -500,
190  double tMax = 500,
191  bool debug = false);
192 
193  // Energy in NxN crystal matrix
194  template <typename T>
195  double eECALmatrix(CaloNavigator<DetId>& navigator, edm::Handle<T>& hits, int ieta, int iphi, bool debug = false);
196 
197  template <typename T>
198  std::vector<std::pair<DetId, double> > eECALmatrixCell(const DetId& detId,
199  edm::Handle<T>& hitsEB,
200  edm::Handle<T>& hitsEE,
201  const CaloGeometry* geo,
202  const CaloTopology* caloTopology,
203  int ieta,
204  int iphi,
205  double ebThr = -100,
206  double eeThr = -100,
207  bool debug = false);
208 
209  // Energy in ietaXiphi crystal matrix
210  template <typename T>
211  std::pair<double, int> eECALmatrixTotal(const DetId& detId,
212  edm::Handle<T>& hitsEB,
213  edm::Handle<T>& hitsEE,
214  const CaloGeometry* geo,
215  const CaloTopology* caloTopology,
216  int ieta,
217  int iphi,
218  double ebThr = -100,
219  double eeThr = -100,
220  bool debug = false);
221 
222  // returns vector of hits in NxN matrix
223  template <typename T>
224  std::vector<std::pair<DetId, double> > energyECALCell(std::vector<DetId>& vdets,
225  edm::Handle<T>& hitsEB,
226  edm::Handle<T>& hitsEE,
227  double ebThr = -100,
228  double eeThr = -100,
229  bool debug = false);
230 
231 } // namespace spr
232 
233 #include "Calibration/IsolatedParticles/interface/eECALMatrix.icc"
234 
235 #endif
double energyECAL(std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
std::vector< std::pair< DetId, double > > energyECALCell(std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, bool debug=false)
std::vector< std::pair< DetId, double > > eECALmatrixCell(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
std::pair< double, int > eECALmatrixTotal(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
DetId hotCrystal(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double tMin=-500, double tMax=500, bool debug=false)
double energyECALTower(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
void hitECALmatrix(CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, std::vector< typename T::const_iterator > &hitlist, bool debug=false)
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)