ATLAS Offline Software
Loading...
Searching...
No Matches
MuidCaloEnergyMeas.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// MuidCaloEnergyMeas
7// AlgTool to access the energy deposited by a muon in the
8// calorimeters. The energy deposit is estimated according to
9// the active measurements in the traversed calorimeter cells.
10//
12
13//<<<<<< INCLUDES >>>>>>
14
15#include "MuidCaloEnergyMeas.h"
16
17#include "AthenaKernel/Units.h"
18#include "CLHEP/Geometry/Vector3D.h"
19#include "CaloEvent/CaloCell.h"
27#include "MuidEvent/CaloMeas.h"
29//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>>
30
31namespace Units = Athena::Units;
32
33namespace Rec {
34
35 MuidCaloEnergyMeas::MuidCaloEnergyMeas(const std::string& type, const std::string& name, const IInterface* parent) :
36 AthAlgTool(type, name, parent),
37 m_tileID(nullptr),
38 m_emID(nullptr),
39 m_hecID(nullptr),
42 declareInterface<IMuidCaloEnergyMeas>(this);
43 declareProperty("NoiseThresInSigmas", m_sigmasAboveNoise);
44 declareProperty("NoiseThresInSigmasCore", m_sigmasAboveNoiseCore);
45
52 }
53
55
56 //<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS >>>>>>
57
59 ATH_MSG_INFO("Initializing MuidCaloEnergyMeas AlgTool");
60
61 // retrieve TileID helper and TileIfno from det store
62 ATH_CHECK(detStore()->retrieve(m_tileID));
63 ATH_MSG_VERBOSE("Accessed TileID helper");
64
65 // retrieve LArEM helper
66 ATH_CHECK(detStore()->retrieve(m_emID, "LArEM_ID"));
67 ATH_MSG_VERBOSE("Accessed LArEM helper");
68
69 // retrieve LArHEC helper
70 ATH_CHECK(detStore()->retrieve(m_hecID, "LArHEC_ID"));
71 ATH_MSG_VERBOSE("Accessed LArHEC helper");
72
73 ATH_CHECK(m_caloParamTool.retrieve());
74 ATH_CHECK(m_noiseCDOKey.initialize());
76 ATH_CHECK(m_caloMgrKey.initialize());
77 return StatusCode::SUCCESS;
78 }
79
81 ATH_MSG_INFO("Finalizing MuidCaloEnergyMeas Tool");
82 ATH_MSG_INFO(" EM: selected " << m_totalSelectedEM << " from " << m_totalCoreCellsEM << " cells in core");
83 ATH_MSG_INFO(" Tile: selected " << m_totalSelectedTile << " from " << m_totalCoreCellsTile << " cells in core");
84 ATH_MSG_INFO(" HEC: selected " << m_totalSelectedHEC << " from " << m_totalCoreCellsHEC << " cells in core");
85 return StatusCode::SUCCESS;
86 }
87 std::unique_ptr<CaloMeas> MuidCaloEnergyMeas::energyMeasurement(const EventContext& ctx, double etaEM, double phiEM, double etaHad,
88 double phiHad) const {
90 if (!cellContainer.isPresent()) {
91 ATH_MSG_DEBUG("No calo cell container " << m_cellContainerLocation.key() << ", energy measurement is 0");
92 return nullptr;
93 }
94 if (!cellContainer.isValid()) {
95 ATH_MSG_WARNING("Calo cell container " << m_cellContainerLocation.key() << " not valid!");
96 return nullptr;
97 }
98
100 if (!noiseHdl.isValid()) {
101 ATH_MSG_WARNING("Calo cell container " << m_noiseCDOKey.key() << " not valid!");
102 return nullptr;
103 }
104
105 const CaloNoise* noiseCDO = *noiseHdl;
107 const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
108
109 // set measured tile energy, measured sampling fraction and isolation energy into CaloMeas
110 std::unique_ptr<CaloMeas> caloMeas = std::make_unique<CaloMeas>();
111 energyInCalo(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaHad, phiHad, SubCaloId::TILE);
112 isolationEnergy(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaHad, phiHad, SubCaloId::TILE);
113
114 // similar for LArHEC
115 energyInCalo(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaHad, phiHad, SubCaloId::LARHEC);
116 isolationEnergy(*caloMeas, cellContainer.cptr(), caloDDMgr,noiseCDO, etaHad, phiHad, SubCaloId::LARHEC);
117
118 // and for the em calo
119 energyInCalo(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaEM, phiEM, SubCaloId::LAREM);
120 isolationEnergy(*caloMeas, cellContainer.cptr(), caloDDMgr, noiseCDO, etaEM, phiEM, SubCaloId::LAREM);
121
122 ATH_MSG_DEBUG(std::setiosflags(std::ios::fixed)
123 << " Tile energy (GeV) :" << std::setw(8) << std::setprecision(3) << caloMeas->Tile_EnergyMeasured() / Units::GeV
124 << " Material percent:" << std::setw(4) << std::setprecision(0) << 100. * caloMeas->Tile_SamplingFraction()
125 << " ISO :" << std::setw(8) << std::setprecision(3) << caloMeas->Tile_Isolation() / Units::GeV << endmsg
126 << " LArHEC energy (GeV):" << std::setw(8) << std::setprecision(3) << caloMeas->LArHEC_EnergyMeasured() / Units::GeV
127 << " Material percent:" << std::setw(4) << std::setprecision(0) << 100. * caloMeas->LArHEC_SamplingFraction()
128 << " ISO :" << std::setw(8) << std::setprecision(3) << caloMeas->LArHEC_Isolation() / Units::GeV << endmsg
129 << " EM energy :" << std::setw(8) << std::setprecision(3) << caloMeas->LArEM_EnergyMeasured() / Units::GeV
130 << " first compartment:" << std::setw(8) << std::setprecision(3)
131 << caloMeas->LArEM_FirstCompartmentEnergy() / Units::GeV << " Material percent:" << std::setw(4)
132 << std::setprecision(0) << 100. * caloMeas->LArEM_SamplingFraction() << " ISO :" << std::setw(8)
133 << std::setprecision(3) << caloMeas->LArEM_Isolation() / Units::GeV);
134
135 return caloMeas;
136 }
137
138 //<<<<<< PRIVATE MEMBER FUNCTION DEFINITIONS >>>>>>
139
141 const CaloNoise* noiseCDO, double mu_eta, double mu_phi) const {
142 // int isubcalo = 2;
143 constexpr double lowest_threshold = 4 * 50.;
144
146 CaloCellList myList(detMgr,cellContainer, iCalo); // Construct the list
147 myList.select(mu_eta, mu_phi, 0.2, 0.2);
148
149 int count = 0;
150 for (const CaloCell* cell : myList) {
151 const double cellEnergy = cell->energy();
152 const double noise_rms = noiseCDO->getNoise(cell->ID(), cell->gain());
153
154 if (cellEnergy > lowest_threshold && cellEnergy > noise_rms * m_sigmasAboveNoise) { count += 1; }
155 }
156
157 ATH_MSG_DEBUG(" counted " << count << " cells over threshold out of a total of " << myList.ncells() << " cells");
158
159 return count;
160 }
161
162 int MuidCaloEnergyMeas::samplingID(const CaloCell* cell, int isubcalo) const {
163 if (isubcalo == SubCaloId::TILE) {
164 return m_tileID->sample(cell->ID());
165 } else if (isubcalo == SubCaloId::LARHEC) {
166 return m_hecID->sampling(cell->ID());
167 } else if (isubcalo == SubCaloId::LAREM) {
168 return m_emID->sampling(cell->ID());
169 }
170
171 return -1;
172 }
173
174 void MuidCaloEnergyMeas::energyInCalo(CaloMeas& caloMeas, const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr,
175 const CaloNoise* noiseCDO, double muEta, double muPhi, int isubcalo) const {
176 /* -------------------------------------------
177 Tile Cal
178 sample_number
179 0 --> Sampling 1
180 1 --> Sampling 2
181 2 --> Sampling 3
182 3 --> ITC
183 ===========================================
184 LarHEC calorimeter
185 sample_number
186 0 --> Sampling 1
187 1 --> Sampling 2
188 2 --> Sampling 3
189 3 --> Sampling 4
190 ===========================================
191 LarEM calorimeter
192 sample_number
193 0 --> Presampler
194 1 --> Sampling 1
195 2 --> Sampling 2
196 3 --> Sampling 3
197 leadingEnergy is contribution from presampler and first compartment
198 -------------------------------------------*/
199
200 double totalEnergy = 0.;
201 double leadingEnergy = 0.;
202 std::unique_ptr<CaloCellList> myList = nullptr;
203
204 if (isubcalo == SubCaloId::TILE) {
206 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
207 myList->select(muEta, muPhi, m_measurementConeTile, m_measurementConeTile);
208 } else if (isubcalo == SubCaloId::LARHEC) {
210 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
211 myList->select(muEta, muPhi, m_measurementConeLArHEC, m_measurementConeLArHEC);
212 } else if (isubcalo == SubCaloId::LAREM) {
214 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
215 myList->select(muEta, muPhi, m_measurementConeLArEM, m_measurementConeLArEM);
216 }
217
218 int countCoreCells = 0;
219 int countSelected = 0;
220 bool compartment[4] = {false, false, false, false};
221 double measuredSamplings = 0.;
222
223 if (myList && myList->ncells()) {
224 // get last cell (as CaloCellList->back() method doesn't work)
225 const CaloCell* lastCell = *(myList->end() - 1);
226
227 // flag core in each sampling
228 for (int coreSampling = 0; coreSampling != 4; ++coreSampling) {
229 const CaloCell* coreCell = nullptr;
230 double coreRadius = 0.;
231 for (const CaloCell* cell : *myList) {
232 int sampling = samplingID(cell, isubcalo);
233
234 if (cell != lastCell && sampling != coreSampling) continue;
235
236 const double deltaEta = cell->eta() - muEta;
237 const double deltaPhi = xAOD::P4Helpers::deltaPhi(cell->phi(), muPhi);
238 const double radius = deltaEta * deltaEta + deltaPhi * deltaPhi;
239
240 if (sampling == coreSampling) {
241 if (!coreCell || radius < coreRadius) {
242 coreCell = cell;
243 coreRadius = radius;
244 }
245 }
246
247 if (cell != lastCell || !coreCell) continue;
248
249 for (const CaloCell* cell2 : *myList) {
250 sampling = samplingID(cell2, isubcalo);
251 if (sampling != coreSampling) continue;
252
253 double cellEnergy = cell2->energy();
254 double noiseRms = noiseCDO->getNoise(cell2->ID(), cell2->gain());
255
256 // looser selection for core cell where at least mip is expected
257 bool cellSelected = cellEnergy > m_sigmasAboveNoise * noiseRms;
258 if (cell2 == coreCell && cellEnergy > m_sigmasAboveNoiseCore * noiseRms) cellSelected = true;
259
260 if (cellSelected) {
261 ++countSelected;
262 totalEnergy += cellEnergy;
263 compartment[coreSampling] = true;
264 if (coreSampling < 2) leadingEnergy += cellEnergy;
265 }
266 if (cell2 == coreCell) {
267 ++countCoreCells;
268 if (isubcalo == SubCaloId::TILE) {
270 if (cellSelected) ++m_totalSelectedTile;
271 } else if (isubcalo == SubCaloId::LARHEC) {
273 if (cellSelected) ++m_totalSelectedHEC;
274 } else if (isubcalo == SubCaloId::LAREM) {
276 if (cellSelected) ++m_totalSelectedEM;
277 }
278 }
279 if (msgLvl(MSG::DEBUG)) {
280 std::string info = "";
281 std::string type = " Tile ";
282 if (isubcalo == SubCaloId::LARHEC) {
283 type = " LArHEC";
284 } else if (isubcalo == SubCaloId::LAREM) {
285 type = " EM ";
286 }
287 if (cellSelected && cell2 == coreCell) {
288 info = " selected core cell# ";
289 } else if (cellSelected) {
290 info = " selected cell# ";
291 } else if (cell2 == coreCell) {
292 info = " cell in core NOT selected";
293 }
294
295 if (info.empty()) {
296 ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed)
297 << type << " Sampling: " << std::setw(1) << coreSampling << " Radius :" << std::setw(6)
298 << std::setprecision(0) << cell2->caloDDE()->r() << " Eta : " << std::setw(6)
299 << std::setprecision(2) << cell2->eta() << " Phi : " << std::setw(6) << std::setprecision(2)
300 << cell2->phi() << " Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
301 << " Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() << info);
302 } else if (cellSelected) {
303 ATH_MSG_DEBUG(std::setiosflags(std::ios::fixed)
304 << type << " Sampling: " << std::setw(1) << coreSampling << " Radius :" << std::setw(6)
305 << std::setprecision(0) << cell2->caloDDE()->r() << " Eta : " << std::setw(6)
306 << std::setprecision(2) << cell2->eta() << " Phi : " << std::setw(6) << std::setprecision(2)
307 << cell2->phi() << " Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
308 << " Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() << info
309 << countSelected);
310 } else {
311 ATH_MSG_DEBUG(std::setiosflags(std::ios::fixed)
312 << type << " Sampling: " << std::setw(1) << coreSampling << " Radius :" << std::setw(6)
313 << std::setprecision(0) << cell2->caloDDE()->r() << " Eta : " << std::setw(6)
314 << std::setprecision(2) << cell2->eta() << " Phi : " << std::setw(6) << std::setprecision(2)
315 << cell2->phi() << " Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
316 << " Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() << info);
317 }
318 }
319 }
320 }
321 }
322
323 if (msgLvl(MSG::DEBUG)) {
324 std::string info = "";
325 std::string type = " Tile ";
326 if (isubcalo == SubCaloId::LARHEC) {
327 type = " LArHEC";
328 } else if (isubcalo == SubCaloId::LAREM) {
329 type = " EM ";
330 }
331
332 ATH_MSG_DEBUG(type << " at eta = " << muEta << " : selected " << countSelected << " from measured cone with "
333 << countCoreCells << " cells forming core");
334 }
335
336 for (int i = 0; i < 4; ++i)
337 if (compartment[i]) measuredSamplings += m_caloParamTool->caloCompartmentDepth(isubcalo, i);
338
339 // store result in caloMeas
340 if (isubcalo == SubCaloId::TILE) {
341 caloMeas.Tile_EnergyMeasured(totalEnergy);
342 caloMeas.Tile_SamplingFraction(measuredSamplings);
343 } else if (isubcalo == SubCaloId::LARHEC) {
344 caloMeas.LArHEC_EnergyMeasured(totalEnergy);
345 caloMeas.LArHEC_SamplingFraction(measuredSamplings);
346 } else if (isubcalo == SubCaloId::LAREM) {
347 caloMeas.LArEM_EnergyMeasured(totalEnergy);
348 caloMeas.LArEM_FirstCompartmentEnergy(leadingEnergy);
349 caloMeas.LArEM_SamplingFraction(measuredSamplings);
350 }
351 }
352 }
353
354 void MuidCaloEnergyMeas::isolationEnergy(CaloMeas& caloMeas, const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr,
355 const CaloNoise* noiseCDO, double muEta, double muPhi, int isubcalo) const {
356 double totalEnergy = 0.;
357
358 // SG::ReadCondHandle<CaloNoise> noiseHdl{m_noiseCDOKey, ctx};
359 // const CaloNoise* noiseCDO = *noiseHdl;
360
361 std::unique_ptr<CaloCellList> myList;
362
363 if (isubcalo == SubCaloId::TILE) {
365 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
366 myList->select(muEta, muPhi, m_isolationConeTile, m_isolationConeTile);
367 } else if (isubcalo == SubCaloId::LARHEC) {
369 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
370 myList->select(muEta, muPhi, m_isolationConeLArHEC, m_isolationConeLArHEC);
371 } else if (isubcalo == SubCaloId::LAREM) {
373 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
374 myList->select(muEta, muPhi, m_isolationConeLArEM, m_isolationConeLArEM);
375 }
376
377 if (myList && myList->ncells()) {
378 // get last cell (as CaloCellList->back() method doesn't work)
379 const CaloCell* lastCell = *(myList->end() - 1);
380
381 // flag core in each sampling
382 for (int coreSampling = 0; coreSampling != 4; ++coreSampling) {
383 const CaloCell* coreCell = nullptr;
384 double coreRadius = 0.;
385 for (const CaloCell* cell : *myList) {
386 int sampling = samplingID(cell, isubcalo);
387
388 if (cell != lastCell && sampling != coreSampling) continue;
389
390 const double deltaEta = cell->eta() - muEta;
391 const double deltaPhi = xAOD::P4Helpers::deltaPhi(cell->phi(), muPhi);
392 const double radius = deltaEta * deltaEta + deltaPhi * deltaPhi;
393
394 if (sampling == coreSampling) {
395 if (!coreCell || radius < coreRadius) {
396 coreCell = cell;
397 coreRadius = radius;
398 }
399 }
400
401 if (cell != lastCell || !coreCell) continue;
402
403 for (const CaloCell* cell2 : *myList) {
404 sampling = samplingID(cell2, isubcalo);
405 if (sampling != coreSampling) continue;
406
407 double cellEnergy = cell2->energy();
408 double noiseRms = noiseCDO->getNoise(cell2->ID(), cell2->gain());
409 // looser selection for core cell where at least mip is expected
410 bool cellSelected = cellEnergy > m_sigmasAboveNoise * noiseRms;
411 if (cell2 == coreCell && cellEnergy > m_sigmasAboveNoiseCore * noiseRms) cellSelected = true;
412
413 if (cellSelected) totalEnergy += cellEnergy;
414 }
415 }
416 }
417
418 // store result in caloMeas
419 if (isubcalo == SubCaloId::TILE) {
420 caloMeas.Tile_Isolation(totalEnergy);
421 } else if (isubcalo == SubCaloId::LARHEC) {
422 caloMeas.LArHEC_Isolation(totalEnergy);
423 } else if (isubcalo == SubCaloId::LAREM) {
424 caloMeas.LArEM_Isolation(totalEnergy);
425 }
426 }
427 }
428
429 double MuidCaloEnergyMeas::energyInTile(const CaloCellContainer* cellContainer, const CaloDetDescrManager* detMgr,
430 const CaloNoise* noiseCDO, double mu_eta, double mu_phi, int sample, int cone) const {
431 // Tile Cal
432 // sample_number
433 // 0 --> Sampling 1
434 // 1 --> Sampling 2
435 // 2 --> Sampling 3
436 // 3 --> ITC
437
438 // int i,j,k;
439
440 double tileTotalEnergy = 0.;
441 double tileTestEnergy = 0.;
442
444 CaloCellList myList(detMgr,cellContainer, iCalo); // Construct the list
445 if (cone == SubCaloId::TILE) {
446 myList.select(mu_eta, mu_phi, 0.15, 0.15);
447 } else if (cone == SubCaloId::LARHEC) {
448 myList.select(mu_eta, mu_phi, 0.3, 0.3);
449 } else {
450 myList.select(mu_eta, mu_phi, 0., 0.);
451 }
452
453 int count = 0;
454 double lowest_threshold = 0.;
455 for (const CaloCell* cell : myList) {
456 double cellEnergy = cell->energy();
457 double noise_rms = noiseCDO->getNoise(cell->ID(), cell->gain());
458
459 if (cellEnergy > lowest_threshold && cellEnergy > noise_rms * m_sigmasAboveNoise && m_tileID->sample(cell->ID()) == sample) {
460 count += 1;
461
462 ATH_MSG_DEBUG("Energy : " << cell->energy() << " Sampling: " << m_tileID->sample(cell->ID())
463 << " Radius :" << cell->caloDDE()->r() << " Eta : " << cell->eta() << " Phi : " << cell->phi()
464 << " Noise Level : " << noise_rms);
465
466 tileTotalEnergy += cellEnergy;
467 } else {
468 tileTestEnergy += cellEnergy;
469 }
470 }
471
472 ATH_MSG_DEBUG(" counted " << count << " test energy " << tileTestEnergy);
473
474 return tileTotalEnergy;
475 }
476
478 const CaloNoise* noiseCDO, double mu_eta, double mu_phi, int sample, int cone) const {
479 // Look in the LarHEC calorimeter
480 // i.e. loop over its cells
481 /* sample_number
482 0 --> Sampling 1
483 1 --> Sampling 2
484 2 --> Sampling 3
485 3 --> Sampling 4
486 */
487
488 // int i,j,k;
489
490 // SG::ReadCondHandle<CaloNoise> noiseHdl{m_noiseCDOKey};
491 // const CaloNoise* noiseCDO = *noiseHdl;
492 double larhecTotal = 0.;
493
495 CaloCellList myList(detMgr, cellContainer, iCalo); // Construct the list
496 if (cone == SubCaloId::LARHEC) {
497 myList.select(mu_eta, mu_phi, 0.15, 0.15);
498 } else if (cone == SubCaloId::LAREM) {
499 myList.select(mu_eta, mu_phi, 0.3, 0.3);
500 } else {
501 myList.select(mu_eta, mu_phi, 0., 0.);
502 }
503
504 int count = 0;
505 constexpr double lowest_threshold = 4. * 150.;
506
507 for (const CaloCell* cell : myList) {
508 double cellEnergy = cell->energy();
509 const double noise_rms = noiseCDO->getNoise(cell->ID(), cell->gain());
510 if (cellEnergy > lowest_threshold && cellEnergy > noise_rms * m_sigmasAboveNoise && m_hecID->sampling(cell->ID()) == sample) {
511 count += 1;
512 // new_cell_list.push_backcell;
513
514 ATH_MSG_DEBUG("Energy : " << cell->energy() << " Sampling: " << m_hecID->sampling(cell->ID())
515 << " z :" << cell->caloDDE()->z() << " Eta : " << cell->eta() << " Phi : " << cell->phi()
516 << " Noise Level : " << noise_rms);
517
518 larhecTotal += cell->energy();
519 }
520 }
521
522 ATH_MSG_DEBUG("larhec counted " << count);
523
524 return larhecTotal;
525 }
526
528 const CaloNoise* noiseCDO, double mu_eta, double mu_phi, int sample, int cone) const {
529 // Look in the LarEM calorimeter
530 // i.e. loop over its cells
531 /*
532 sample_number
533 0 --> Presampler
534 1 --> Sampling 1
535 2 --> Sampling 2
536 3 --> Sampling 3
537 */
538
539 // int i,j,k;
540 double emTotalEnergy = 0.;
541
543 CaloCellList myList(detMgr, cellContainer, iCalo); // Construct the list
544 if (cone == SubCaloId::LARHEC) {
545 myList.select(mu_eta, mu_phi, 0.075, 0.075); // 0.1 0.1
546 } else if (cone == SubCaloId::LAREM) {
547 myList.select(mu_eta, mu_phi, 0.15, 0.15);
548 } else {
549 myList.select(mu_eta, mu_phi, 0., 0.);
550 }
551
552 // std::vector<const CaloCell*> new_cell_list;
553 int count = 0;
554
555 double lowest_threshold = 4. * 50.;
556
557 for (const CaloCell* cell : myList) {
558 double cellEnergy = cell->energy();
559 const double noise_rms = noiseCDO->getNoise(cell->ID(), cell->gain());
560
561 if (cellEnergy > lowest_threshold && cellEnergy > noise_rms * m_sigmasAboveNoise && m_emID->sampling(cell->ID()) == sample) {
562 count += 1;
563 // new_cell_list.push_backcell;
564
565 ATH_MSG_DEBUG("Energy : " << cell->energy() << " Sampling: " << m_emID->sampling(cell->ID())
566 << " Radius :" << cell->caloDDE()->r() << " z :" << cell->caloDDE()->z()
567 << " Eta : " << cell->eta() << " Phi : " << cell->phi() << " Noise Level : " << noise_rms);
568
569 emTotalEnergy += cell->energy();
570 }
571 }
572
573 ATH_MSG_DEBUG("larem counted " << count);
574
575 return emTotalEnergy;
576 }
577
578} // namespace Rec
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Wrapper to avoid constant divisions when using units.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Container class for CaloCell.
void select(double eta, double phi, double deta, double dphi)
int ncells() const
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class provides the client interface for accessing the detector description information common to...
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:34
double LArHEC_Isolation(void) const
Definition CaloMeas.h:73
double LArEM_Isolation(void) const
Definition CaloMeas.h:89
double LArEM_SamplingFraction(void) const
Definition CaloMeas.h:93
double LArEM_EnergyMeasured(void) const
Definition CaloMeas.h:81
double Tile_SamplingFraction(void) const
Definition CaloMeas.h:65
double Tile_Isolation(void) const
Definition CaloMeas.h:61
double LArHEC_SamplingFraction(void) const
Definition CaloMeas.h:77
double Tile_EnergyMeasured(void) const
Definition CaloMeas.h:57
double LArHEC_EnergyMeasured(void) const
Definition CaloMeas.h:69
double LArEM_FirstCompartmentEnergy(void) const
Definition CaloMeas.h:85
std::atomic_int m_totalCoreCellsEM
std::atomic_int m_totalSelectedTile
std::unique_ptr< CaloMeas > energyMeasurement(const EventContext &ctx, double etaEM, double phiEM, double etaHad, double phiHad) const override
IMuidCaloEnergyMeas interface: get the muon energy loss measurement from the calorimeter,...
MuidCaloEnergyMeas(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
std::atomic_int m_totalCoreCellsHEC
double energyInLArEM(const CaloCellContainer *cellContainer, const CaloDetDescrManager *detMgr, const CaloNoise *noiseCDO, double eta, double phi, int, int) const
SG::ReadHandleKey< CaloCellContainer > m_cellContainerLocation
std::atomic_int m_totalCoreCellsTile
void energyInCalo(CaloMeas &caloMeas, const CaloCellContainer *cellContainer, const CaloDetDescrManager *detMgr, const CaloNoise *noiseCDO, double eta, double phi, int iSubCalo) const
std::atomic_int m_totalSelectedEM
StatusCode finalize() override
double energyInTile(const CaloCellContainer *cellContainer, const CaloDetDescrManager *detMgr, const CaloNoise *noiseCDO, double eta, double phi, int, int) const
double energyInLArHEC(const CaloCellContainer *cellContainer, const CaloDetDescrManager *detMgr, const CaloNoise *noiseCDO, double eta, double phi, int, int) const
std::atomic_int m_totalSelectedHEC
ToolHandle< IMuidCaloEnergyParam > m_caloParamTool
StatusCode initialize() override
int cellCounting(const CaloCellContainer *cellContainer, const CaloDetDescrManager *detMgr, const CaloNoise *noiseCDO, double eta, double phi) const
int samplingID(const CaloCell *cell, int iSubCalo) const
void isolationEnergy(CaloMeas &caloMeas, const CaloCellContainer *cellContainer, const CaloDetDescrManager *detMgr, const CaloNoise *noiseCDO, double eta, double phi, int iSubCalo) const
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
bool isPresent() const
Is the referenced object present in SG?
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
Gaudi Tools.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[