13#include "GaudiKernel/IMessageSvc.h"
14#include "GaudiKernel/IToolSvc.h"
15#include "GaudiKernel/ServiceHandle.h"
18#include "GaudiKernel/SystemOfUnits.h"
21#include "CaloDetDescr/CaloDetDescrElement.h"
31constexpr double s_default = 0;
32const std::unordered_map<std::string, CaloDepthTool::DepthChoice>
50 const std::string& name,
51 const IInterface* parent)
55 declareInterface<CaloDepthTool>(
this);
69 if (it != s_stringToEnum.end()) {
73 return StatusCode::FAILURE;
77 return StatusCode::SUCCESS;
83 return StatusCode::SUCCESS;
90 const int sampling_or_module,
98 subcalo,
barrel, sampling_or_module, sample);
108 double radius = s_default;
134 if (std::abs(
radius) < 10.) {
143 const int sampling_or_module,
150 subcalo,
barrel, sampling_or_module, sample);
151 return deta(sample,
eta, caloDD);
159 double deta = 99999.;
170 const int sampling_or_module,
178 subcalo,
barrel, sampling_or_module, sample);
188 double radius = s_default;
194 float aeta =
static_cast<float>(std::abs(
eta));
196 if (sample == CaloCell_ID::PreSamplerB) {
197 radius = 1422.3 * Gaudi::Units::millimeter;
198 }
else if (sample == CaloCell_ID::EMB1) {
200 radius = (1567.8 - 18.975 * aeta - 17.668 * aeta * aeta) *
201 Gaudi::Units::millimeter;
203 radius = (1503.2 + 71.716 * aeta - 41.008 * aeta * aeta) *
204 Gaudi::Units::millimeter;
205 }
else if (sample == CaloCell_ID::EMB2) {
207 radius = (1697.1 - 15.311 * aeta - 64.153 * aeta * aeta) *
208 Gaudi::Units::millimeter;
210 radius = (1739.1 - 75.648 * aeta - 18.501 * aeta * aeta) *
211 Gaudi::Units::millimeter;
212 }
else if (sample == CaloCell_ID::EMB3) {
214 radius = (1833.88 - 106.25 * aeta) * Gaudi::Units::millimeter;
216 radius = (2038.40 - 286. * aeta) * Gaudi::Units::millimeter;
219 else if (sample == CaloCell_ID::PreSamplerE) {
220 radius = 3600. * Gaudi::Units::millimeter;
223 }
else if (sample == CaloCell_ID::EME1) {
224 radius = 3760. * Gaudi::Units::millimeter;
227 }
else if (sample == CaloCell_ID::EME2) {
228 radius = 3880. * Gaudi::Units::millimeter;
231 }
else if (sample == CaloCell_ID::EME3) {
232 radius = 4150. * Gaudi::Units::millimeter;
258 double radius = s_default;
260 float aeta =
static_cast<float>(std::abs(
eta));
262 if (sample == CaloCell_ID::PreSamplerB) {
263 radius = 1422.3 * Gaudi::Units::millimeter;
264 }
else if (sample == CaloCell_ID::EMB1) {
266 radius = (1558.859292 - 4.990838 * aeta - 21.144279 * aeta * aeta) *
267 Gaudi::Units::millimeter;
269 radius = (1522.775373 + 27.970192 * aeta - 21.104108 * aeta * aeta) *
270 Gaudi::Units::millimeter;
271 }
else if (sample == CaloCell_ID::EMB2) {
272 radius = (1689.621619 + 2.682993 * aeta - 70.165741 * aeta * aeta) *
273 Gaudi::Units::millimeter;
274 }
else if (sample == CaloCell_ID::EMB3) {
276 radius = (1833.88 - 106.25 * aeta) * Gaudi::Units::millimeter;
278 radius = (2038.40 - 286. * aeta) * Gaudi::Units::millimeter;
281 else if (sample == CaloCell_ID::PreSamplerE) {
282 radius = 3600. * Gaudi::Units::millimeter;
285 }
else if (sample == CaloCell_ID::EME1) {
287 radius = (12453.297448 - 5735.787116 * aeta) * Gaudi::Units::millimeter;
289 radius = 3790.671754 * Gaudi::Units::millimeter;
292 }
else if (sample == CaloCell_ID::EME2) {
294 radius = (8027.574119 - 2717.653528 * aeta) * Gaudi::Units::millimeter;
296 radius = (3473.473909 + 453.941515 * aeta - 119.101945 * aeta * aeta) *
297 Gaudi::Units::millimeter;
300 }
else if (sample == CaloCell_ID::EME3) {
301 radius = 4150. * Gaudi::Units::millimeter;
328 double radius = s_default;
330 float aeta =
static_cast<float>(std::abs(
eta));
332 if (sample == CaloCell_ID::PreSamplerB) {
333 radius = 1422.3 * Gaudi::Units::millimeter;
334 }
else if (sample == CaloCell_ID::EMB1) {
336 radius = (1558.859292 - 4.990838 * aeta - 21.144279 * aeta * aeta) *
337 Gaudi::Units::millimeter;
339 radius = (1522.775373 + 27.970192 * aeta - 21.104108 * aeta * aeta) *
340 Gaudi::Units::millimeter;
341 }
else if (sample == CaloCell_ID::EMB2) {
342 radius = (1698.990944 - 49.431767 * aeta - 24.504976 * aeta * aeta) *
343 Gaudi::Units::millimeter;
344 }
else if (sample == CaloCell_ID::EMB3) {
346 radius = (1833.88 - 106.25 * aeta) * Gaudi::Units::millimeter;
348 radius = (2038.40 - 286. * aeta) * Gaudi::Units::millimeter;
351 else if (sample == CaloCell_ID::PreSamplerE) {
352 radius = 3600. * Gaudi::Units::millimeter;
355 }
else if (sample == CaloCell_ID::EME1) {
357 radius = (12453.297448 - 5735.787116 * aeta) * Gaudi::Units::millimeter;
359 radius = 3790.671754 * Gaudi::Units::millimeter;
362 }
else if (sample == CaloCell_ID::EME2) {
364 radius = (8027.574119 - 2717.653528 * aeta) * Gaudi::Units::millimeter;
366 radius = (3473.473909 + 453.941515 * aeta - 119.101945 * aeta * aeta) *
367 Gaudi::Units::millimeter;
370 }
else if (sample == CaloCell_ID::EME3) {
371 radius = 4150. * Gaudi::Units::millimeter;
390 const int sampling_or_module,
398 subcalo,
barrel, sampling_or_module, sample);
408 double radius = s_default;
413 if (sample == CaloCell_ID::PreSamplerB) {
415 }
else if (sample == CaloCell_ID::EMB1) {
417 }
else if (sample == CaloCell_ID::EMB2) {
419 }
else if (sample == CaloCell_ID::EMB3) {
434 const int sampling_or_module,
442 subcalo,
barrel, sampling_or_module, sample);
452 double radius = s_default;
455 if (sample == CaloCell_ID::PreSamplerE || sample == CaloCell_ID::EME1 ||
456 sample == CaloCell_ID::EME2 || sample == CaloCell_ID::EME3 ||
457 sample == CaloCell_ID::HEC0 || sample == CaloCell_ID::HEC1 ||
458 sample == CaloCell_ID::HEC2 || sample == CaloCell_ID::HEC3 ||
459 sample == CaloCell_ID::FCAL0 || sample == CaloCell_ID::FCAL1 ||
460 sample == CaloCell_ID::FCAL2)
470 const int sampling_or_module,
478 subcalo,
barrel, sampling_or_module, sample);
488 double radius = s_default;
490 if (sample == CaloCell_ID::PreSamplerE || sample == CaloCell_ID::EME1 ||
491 sample == CaloCell_ID::EME2 || sample == CaloCell_ID::EME3 ||
492 sample == CaloCell_ID::HEC0 || sample == CaloCell_ID::HEC1 ||
493 sample == CaloCell_ID::HEC2 || sample == CaloCell_ID::HEC3 ||
494 sample == CaloCell_ID::FCAL0 || sample == CaloCell_ID::FCAL1 ||
495 sample == CaloCell_ID::FCAL2)
505 const int sampling_or_module,
513 subcalo,
barrel, sampling_or_module, sample);
523 double radius = s_default;
525 if (sample == CaloCell_ID::PreSamplerE || sample == CaloCell_ID::EME1 ||
526 sample == CaloCell_ID::EME2 || sample == CaloCell_ID::EME3 ||
527 sample == CaloCell_ID::HEC0 || sample == CaloCell_ID::HEC1 ||
528 sample == CaloCell_ID::HEC2 || sample == CaloCell_ID::HEC3 ||
529 sample == CaloCell_ID::FCAL0 || sample == CaloCell_ID::FCAL1 ||
530 sample == CaloCell_ID::FCAL2)
540 const int sampling_or_module,
547 subcalo,
barrel, sampling_or_module, sample);
548 return flat(sample, side, caloDD);
559 if (sample == CaloCell_ID::TileBar0)
561 if (sample == CaloCell_ID::TileBar1)
563 if (sample == CaloCell_ID::TileBar2)
565 if (sample == CaloCell_ID::TileGap1)
567 if (sample == CaloCell_ID::TileGap2)
569 if (sample == CaloCell_ID::TileExt0)
571 if (sample == CaloCell_ID::TileExt1)
573 if (sample == CaloCell_ID::TileExt2)
579 if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
580 std::vector<double>
depth;
581 reg->get_depth_in(
depth);
582 for (
unsigned int j = 0; j <
depth.size(); j++)
593 if (sample == CaloCell_ID::PreSamplerE || sample == CaloCell_ID::EME1 ||
594 sample == CaloCell_ID::EME2 || sample == CaloCell_ID::EME3 ||
595 sample == CaloCell_ID::HEC0 || sample == CaloCell_ID::HEC1 ||
596 sample == CaloCell_ID::HEC2 || sample == CaloCell_ID::HEC3 ||
597 sample == CaloCell_ID::FCAL0 || sample == CaloCell_ID::FCAL1 ||
598 sample == CaloCell_ID::FCAL2)
606 const int sampling_or_module,
613 subcalo,
barrel, sampling_or_module, sample);
614 return depth(sample, side, caloDD);
625 if (sample == CaloCell_ID::TileBar0)
627 if (sample == CaloCell_ID::TileBar1)
629 if (sample == CaloCell_ID::TileBar2)
631 if (sample == CaloCell_ID::TileGap1)
633 if (sample == CaloCell_ID::TileGap2)
635 if (sample == CaloCell_ID::TileExt0)
637 if (sample == CaloCell_ID::TileExt1)
639 if (sample == CaloCell_ID::TileExt2)
646 if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
647 std::vector<double>
depth;
648 reg->get_depth_out(
depth);
649 for (
unsigned int j = 0; j <
depth.size(); j++)
672 if (elt->
is_tile())
return (elt->
r() - elt->
dr()/2);
673 else return (elt->
r() - elt->
dr());
689 if (elt->
is_tile())
return (elt->
z() - (elt->
z() < 0 ? -elt->
dz()/2 : elt->
dz()/2));
690 else return (elt->
z() - (elt->
z() < 0 ? -elt->
dz() : elt->
dz()));
735 if (elt->
is_tile())
return (elt->
r() + elt->
dr()/2);
736 else return (elt->
r() + elt->
dr());
753 if (elt->
is_tile())
return (elt->
z() + (elt->
z() < 0 ? -elt->
dz()/2 : elt->
dz()/2));
754 else return (elt->
z() + (elt->
z() < 0 ? -elt->
dz() : elt->
dz()));
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition of CaloDetDescrManager.
Definition of CaloDetDescriptor.
const ServiceHandle< StoreGateSvc > & detStore() const
CaloCell_Base_ID::SUBCALO SUBCALO
CaloSampling::CaloSample CaloSample
This class groups all DetDescr information related to a CaloCell.
bool is_tile() const
cell belongs to Tile
static void build_sample(CaloCell_ID::SUBCALO subCalo, bool barrel, int sampling_or_module, CaloCell_ID::CaloSample &sample)
translate between the 2 ways to label a sub-detector:
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
calo_descr_range calo_descriptors_range() const
Range over descriptors.
bool is_in(double eta, double phi, CaloCell_ID::CaloSample sample, double &etadist) const
return true if direction eta,phi crosses ANY of the corresponding descriptors
This class provides the client interface for accessing the detector description information common to...
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
std::string depth
tag string for intendation