CMS 3D CMS Logo

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
33 
40 
42 
43 namespace spr {
44 
45  // Energy in NxN crystal matrix
46  template <typename T>
47  double eECALmatrix(const DetId& detId,
48  edm::Handle<T>& hitsEB,
49  edm::Handle<T>& hitsEE,
50  const CaloGeometry* geo,
51  const CaloTopology* caloTopology,
52  int ieta,
53  int iphi,
54  double ebThr = -100,
55  double eeThr = -100,
56  double tMin = -500,
57  double tMax = 500,
58  bool debug = false);
59 
60  template <typename T>
61  double eECALmatrix(const DetId& detId,
62  edm::Handle<T>& hitsEB,
63  edm::Handle<T>& hitsEE,
64  const CaloGeometry* geo,
65  const CaloTopology* caloTopology,
66  const EcalTrigTowerConstituentsMap& ttMap,
67  int ieta,
68  int iphi,
69  double ebThr = -100,
70  double eeThr = -100,
71  double tMin = -500,
72  double tMax = 500,
73  bool debug = false);
74 
75  template <typename T>
76  double eECALmatrix(const DetId& detId,
77  edm::Handle<T>& hitsEB,
78  edm::Handle<T>& hitsEE,
79  const CaloGeometry* geo,
80  const CaloTopology* caloTopology,
81  int ietaE,
82  int ietaW,
83  int iphiN,
84  int iphiS,
85  double ebThr = -100,
86  double eeThr = -100,
87  double tMin = -500,
88  double tMax = 500,
89  bool debug = false);
90 
91  std::pair<double, bool> eECALmatrix(const DetId& detId,
94  const EcalChannelStatus& chStatus,
95  const CaloGeometry* geo,
96  const CaloTopology* caloTopology,
97  const EcalSeverityLevelAlgo* sevlv,
98  int ieta,
99  int iphi,
100  double ebThr = -100,
101  double eeThr = -100,
102  double tMin = -500,
103  double tMax = 500,
104  bool debug = false);
105 
106  std::pair<double, bool> eECALmatrix(const DetId& detId,
109  const EcalChannelStatus& chStatus,
110  const CaloGeometry* geo,
111  const CaloTopology* caloTopology,
112  const EcalSeverityLevelAlgo* sevlv,
113  const EcalTrigTowerConstituentsMap& ttMap,
114  int ieta,
115  int iphi,
116  double ebThr = -100,
117  double eeThr = -100,
118  double tMin = -500,
119  double tMax = 500,
120  bool debug = false);
121 
122  std::pair<double, bool> eECALmatrix(const HcalDetId& detId,
125  const CaloGeometry* geo,
126  const CaloTowerConstituentsMap* ctmap,
127  const EcalSeverityLevelAlgo* sevlv,
128  double ebThr = -100,
129  double eeThr = -100,
130  double tMin = -500,
131  double tMax = 500,
132  bool debug = false);
133 
134  std::pair<double, bool> eECALmatrix(const DetId& detId,
137  const EcalChannelStatus& chStatus,
138  const CaloGeometry* geo,
139  const CaloTopology* caloTopology,
140  const EcalSeverityLevelAlgo* sevlv,
141  const EcalPFRecHitThresholds* eThr,
142  int ieta,
143  int iphi,
144  bool debug = false);
145 
146  // returns vector of hits in NxN matrix
147  template <typename T>
150  int ieta,
151  int iphi,
152  std::vector<typename T::const_iterator>& hitlist,
153  bool debug = false);
154 
155  // returns energy deposited from the vector of hits
156  template <typename T>
157  double energyECAL(std::vector<DetId>& vdets,
158  edm::Handle<T>& hitsEB,
159  edm::Handle<T>& hitsEE,
160  double ebThr = -100,
161  double eeThr = -100,
162  double tMin = -500,
163  double tMax = 500,
164  bool debug = false);
165 
166  template <typename T>
167  double energyECAL(std::vector<DetId>& vdets,
168  edm::Handle<T>& hitsEB,
169  edm::Handle<T>& hitsEE,
170  const EcalTrigTowerConstituentsMap& ttMap,
171  double ebThr = -100,
172  double eeThr = -100,
173  double tMin = -500,
174  double tMax = 500,
175  bool debug = false);
176 
177  // returns energy in the EB/EE tower
178  template <typename T>
179  double energyECALTower(const DetId& detId,
180  edm::Handle<T>& hitsEB,
181  edm::Handle<T>& hitsEE,
182  const EcalTrigTowerConstituentsMap& ttMap,
183  bool debug = false);
184 
185  // Hot Crystal
186  template <typename T>
187  DetId hotCrystal(const DetId& detId,
188  edm::Handle<T>& hitsEB,
189  edm::Handle<T>& hitsEE,
190  const CaloGeometry* geo,
191  const CaloTopology* caloTopology,
192  int ieta,
193  int iphi,
194  double tMin = -500,
195  double tMax = 500,
196  bool debug = false);
197 
198  template <typename T>
199  DetId hotCrystal(std::vector<DetId>& detId,
200  edm::Handle<T>& hitsEB,
201  edm::Handle<T>& hitsEE,
202  double tMin = -500,
203  double tMax = 500,
204  bool debug = false);
205 
206  // Energy in NxN crystal matrix
207  template <typename T>
208  double eECALmatrix(CaloNavigator<DetId>& navigator, edm::Handle<T>& hits, int ieta, int iphi, bool debug = false);
209 
210  template <typename T>
211  std::vector<std::pair<DetId, double> > eECALmatrixCell(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  // Energy in ietaXiphi crystal matrix
223  template <typename T>
224  std::pair<double, int> eECALmatrixTotal(const DetId& detId,
225  edm::Handle<T>& hitsEB,
226  edm::Handle<T>& hitsEE,
227  const CaloGeometry* geo,
228  const CaloTopology* caloTopology,
229  int ieta,
230  int iphi,
231  double ebThr = -100,
232  double eeThr = -100,
233  bool debug = false);
234 
235  // returns vector of hits in NxN matrix
236  template <typename T>
237  std::vector<std::pair<DetId, double> > energyECALCell(std::vector<DetId>& vdets,
238  edm::Handle<T>& hitsEB,
239  edm::Handle<T>& hitsEE,
240  double ebThr = -100,
241  double eeThr = -100,
242  bool debug = false);
243 
244 } // namespace spr
245 
246 #include "Calibration/IsolatedParticles/interface/eECALMatrix.icc"
247 
248 #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)