ATLAS Offline Software
EMECDetDescr.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 
9 namespace {
10 
11 
16 struct Boundary {
17  double min;
18  double max;
19  unsigned int nDiv;
20 };
21 const Boundary
22 etaBoundariesEndcap[4][2][6] = {{{{1.500, 1.800, 12},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}, // presampler outer
23  {{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}, // presampler inner
24  {{{1.375, 1.425, 1},{1.425, 1.500, 3},{1.500, 1.800, 96},{1.800, 2.000, 48},{2.000, 2.400, 64},{2.400, 2.500, 4}}, // sample 1 outer
25  {{2.500, 3.200, 7},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}, // sample 1 inner
26  {{{1.375, 1.425, 1},{1.425, 2.5, 43},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}, // sample 2 outer
27  {{2.500, 3.200, 7},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}, // sample 2 inner
28  {{{1.500, 2.500, 20},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}, // sample 3 outer
29  {{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}}; // sample 3 inner
30 
31 
32 } // anonymous namespace
33 
34 
36  , unsigned int sampling
37  , unsigned int region
38  , unsigned int radialPart
39  , const CellBinning &phiBinning)
40  : m_manager(detManager)
41  , m_samplingIndex(sampling)
42  , m_regionIndex(region)
43  , m_radialIndex(radialPart)
44  , m_phiBinning(phiBinning)
45  , m_etaBinning(etaBoundariesEndcap[sampling][radialPart][region].min
46  ,etaBoundariesEndcap[sampling][radialPart][region].max
47  ,etaBoundariesEndcap[sampling][radialPart][region].nDiv)
48 {
49  // This contains some logic for decoding the sampling separation arrays:
50  if (sampling==0) {
52  m_offset.push_back (0);
53  return;
54  }
55 
56  double eta0, dEta;
57  if (m_radialIndex ==0 ) { // Outer Wheel.
58  eta0=1.4;
59  dEta=0.025;
60  }
61  else if (m_radialIndex==1) { // Inner Wheel
62  eta0=2.5;
63  dEta=0.1;
64  }
65  else {
66  throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
67  }
68 
69  const double inv_dEta = 1. / dEta;
70 
71  for (unsigned int i=0;i<m_etaBinning.getNumDivisions();i++) {
72  double eta = m_etaBinning.binCenter(i);
73  int ipad = int((eta - eta0) * inv_dEta);
74  double front,back;
75  if (m_radialIndex ==0 ) { // Outer Wheel.
76  if (sampling==1) {
77  front=0;
79  }
80  else if (sampling==2) {
81 
82  // std::min is used to max out the length to the total active length; this is for
83  // cells that spill out the side. They will have funny volumes.
84 
87  }
88  else if (sampling==3) {
90  back = m_manager->getActiveLength();
91  }
92  else {
93  throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
94  }
95 
96  }
97  else if (m_radialIndex==1) { // Inner Wheel
98  if (sampling==1) {
99  front=0;
101  }
102  else if (sampling==2) {
104  back = m_manager->getActiveLength();
105  }
106  else {
107  throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
108  }
109  }
110  else {
111  throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
112  }
113  m_offset.push_back((front+back)/2.);
114  m_halfLength.push_back((back-front)/2.);
115  }
116 }
117 
118 
120 = default;
EMECDetectorManager::getZSEP23
double getZSEP23(unsigned int i) const
This method provides access to the Array ZSEP23, which in turn comes from the database (EmecSamplingS...
Definition: EMECDetectorManager.h:355
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
EMECDetectorManager
A manager class providing access to readout geometry information for the electromagnetic endcap calor...
Definition: EMECDetectorManager.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
EMECDetectorManager.h
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
EMECDetDescr::m_offset
std::vector< double > m_offset
Vector of cell center positions for the cells, one for each eta index.
Definition: EMECDetDescr.h:116
EMECDetDescr::m_etaBinning
CellBinning m_etaBinning
Definition: EMECDetDescr.h:94
EMECDetDescr::m_halfLength
std::vector< double > m_halfLength
Vector of half-lengths for the cells, one for each eta index.
Definition: EMECDetDescr.h:100
EMECDetectorManager::getZIW
double getZIW(unsigned int i) const
This method provides access to the Array ZIW, which in turn comes from the database.
Definition: EMECDetectorManager.h:327
lumiFormat.i
int i
Definition: lumiFormat.py:85
EMECDetDescr::~EMECDetDescr
~EMECDetDescr()
Destructor
EMECDetDescr::EMECDetDescr
EMECDetDescr(const EMECDetectorManager *detManager, unsigned int sampling, unsigned int region, unsigned int radialPart, const CellBinning &phiBinning)
Constructor.
Definition: EMECDetDescr.cxx:35
EMECDetectorManager::getRefToActive
double getRefToActive() const
This provides the distance in CLHEP::mm from the Active EMEC volume to the reference plane.
Definition: EMECDetectorManager.h:292
EMECDetDescr::m_radialIndex
unsigned int m_radialIndex
Definition: EMECDetDescr.h:92
EMECDetectorManager::getActiveLength
double getActiveLength() const
Gives the overall active length of the EMEC outer and inner wheel volumes.
Definition: EMECDetectorManager.h:299
EMECDetDescr.h
EMECDetDescr::m_manager
const EMECDetectorManager * m_manager
Definition: EMECDetDescr.h:89
EMECDetectorManager::getZSEP12
double getZSEP12(unsigned int i) const
This method provides access to the Array ZSEP12, which in turn comes from the database (EmecSamplingS...
Definition: EMECDetectorManager.h:341
EMECDetectorManager::getPresamplerFullLength
double getPresamplerFullLength() const
Gives the overall active length of the presampler volume.
Definition: EMECDetectorManager.h:313
EMECDetectorManager::getFocalToRef
double getFocalToRef() const
This provides the distance in CLHEP::mm from the Focal Plane to the reference plane.
Definition: EMECDetectorManager.h:285
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:527