ATLAS Offline Software
TileDetDescriptor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Tile Calorimeter detector description package
7  -----------------------------------------
8 ***************************************************************************/
9 
10 #ifndef TILEDETDESCR_TILEDETDESCRIPTOR_H
11 #define TILEDETDESCR_TILEDETDESCRIPTOR_H
12 
13 #include "Identifier/Identifier.h"
14 
15 #include <assert.h>
16 
17 #define MAX_N_SAMP_TILEDD 20
18 
46 {
47 public:
48 
49  //
50  // Typedefs:
51  //
52 
54  TileDetDescriptor(const float eta_min[],
55  const float eta_max[],
56  const float deta[],
57  const float phi_min,
58  const float phi_max,
59  const float dphi,
60  const float zshift,
61  const float rcenter[],
62  const float dr[],
63  const float zcenter[],
64  const float dz[],
65  const unsigned int n_samp,
66  const int sign_eta);
68 
69  // Allow setting of some internals
70  void set(const Identifier& id);
71 
72  // Identifier - indicates which calorimeter
73  Identifier identify(void) const;
74 
75  // Region parameters for eta/phi counting
76  int sign_eta() const; // is -1 or +1
77  float eta_min (unsigned int samp) const; // is min abs(eta)
78  float eta_max (unsigned int samp) const; // is max abs(eta)
79  float deta (unsigned int samp) const;
80  int n_eta (unsigned int samp) const;
81  float phi_min () const; // phi goes from 0 to 2pi
82  float phi_max () const; // phi goes from 0 to 2pi
83  float dphi () const; // phi goes from 0 to 2pi
84  int n_phi () const;
85  float zshift () const;
86  float rcenter (unsigned int samp) const;
87  float dr (unsigned int samp) const;
88  float zcenter (unsigned int samp) const;
89  float dz (unsigned int samp) const;
90  int n_samp () const;
91 
92  // Decoding methods
93  float eta (unsigned int eta_channel, unsigned int samp) const;
94  float phi (unsigned int phi_channel) const;
95 
96  // Print
97  void print () const;
98 
99  void set ( const float eta_min[],
100  const float eta_max[],
101  const float deta[],
102  const float phi_min,
103  const float phi_max,
104  const float dphi,
105  const float zshift,
106  const float rcenter[],
107  const float dr[],
108  const float zcenter[],
109  const float dz[],
110  const unsigned int n_samp,
111  const unsigned int n_eta[],
112  const unsigned int n_phi,
113  const int sign_eta);
114 
115 private:
116 
117  Identifier m_id; // in CaloDetDescriptor now
121  float m_phi_min;
122  float m_phi_max;
123  float m_dphi;
124  float m_zshift;
129  unsigned int m_n_samp;
130  unsigned int m_n_eta[MAX_N_SAMP_TILEDD];
131  unsigned int m_n_phi;
133 };
134 
136 {}
137 
138 inline float TileDetDescriptor::eta_min(unsigned int samp) const
139 {
140  assert (samp < m_n_samp);
141 
142  return m_eta_min[samp];
143 }
144 
145 inline float TileDetDescriptor::eta_max(unsigned int samp) const
146 {
147  assert (samp < m_n_samp);
148 
149  return m_eta_max[samp];
150 }
151 
152 inline float TileDetDescriptor::deta(unsigned int samp) const
153 {
154  assert (samp < m_n_samp);
155 
156  return m_deta[samp];
157 }
158 
159 inline int TileDetDescriptor::n_eta(unsigned int samp) const
160 {
161  assert (samp < m_n_samp);
162 
163  return m_n_eta[samp];
164 }
165 
166 inline float TileDetDescriptor::phi_min() const
167 {
168  return m_phi_min;
169 }
170 
171 inline float TileDetDescriptor::phi_max() const
172 {
173  return m_phi_max;
174 }
175 
176 inline float TileDetDescriptor::dphi() const
177 {
178  return m_dphi;
179 }
180 
181 inline int TileDetDescriptor::n_phi() const
182 {
183  return m_n_phi;
184 }
185 
186 inline float TileDetDescriptor::zshift() const
187 {
188  return m_zshift;
189 }
190 
191 inline float TileDetDescriptor::rcenter(unsigned int samp) const
192 {
193  assert (samp < m_n_samp);
194 
195  return m_rcenter[samp];
196 }
197 
198 inline float TileDetDescriptor::dr(unsigned int samp) const
199 {
200  assert (samp < m_n_samp);
201 
202  return m_dr[samp];
203 }
204 
205 inline float TileDetDescriptor::zcenter(unsigned int samp) const
206 {
207  assert (samp < m_n_samp);
208 
209  return m_zcenter[samp];
210 }
211 
212 inline float TileDetDescriptor::dz(unsigned int samp) const
213 {
214  assert (samp < m_n_samp);
215 
216  return m_dz[samp];
217 }
218 
219 inline int TileDetDescriptor::n_samp() const
220 {
221  return m_n_samp;
222 }
223 
224 inline int TileDetDescriptor::sign_eta() const
225 {
226  return m_sign_eta;
227 }
228 
229 inline float TileDetDescriptor::eta(unsigned int eta_channel, unsigned int samp) const
230 {
231  assert (samp < m_n_samp);
232  assert (eta_channel < m_n_eta[samp]);
233 
234  return (m_sign_eta*(((float)eta_channel + 0.5)*m_deta[samp] + m_eta_min[samp]));
235 }
236 
237 inline float TileDetDescriptor::phi(unsigned int phi_channel) const
238 {
239  assert (phi_channel < m_n_phi);
240 
241  return (((float)phi_channel + 0.5)*m_dphi + m_phi_min);
242 }
243 
244 inline void TileDetDescriptor::set(const Identifier& id)
245 {
246  m_id = id;
247 }
248 
250 {
251  return m_id;
252 }
253 
254 #endif // TILEDETDESCR_TILEDETDESCRIPTOR_H
TileDetDescriptor::eta_max
float eta_max(unsigned int samp) const
Definition: TileDetDescriptor.h:145
TileDetDescriptor::m_phi_min
float m_phi_min
Definition: TileDetDescriptor.h:121
TileDetDescriptor::m_dphi
float m_dphi
Definition: TileDetDescriptor.h:123
TileDetDescriptor::phi_min
float phi_min() const
Definition: TileDetDescriptor.h:166
TileDetDescriptor::phi
float phi(unsigned int phi_channel) const
Definition: TileDetDescriptor.h:237
TileDetDescriptor::~TileDetDescriptor
~TileDetDescriptor()
Definition: TileDetDescriptor.h:135
TileDetDescriptor::dphi
float dphi() const
Definition: TileDetDescriptor.h:176
TileDetDescriptor::print
void print() const
Definition: TileDetDescriptor.cxx:125
TileDetDescriptor::zshift
float zshift() const
Definition: TileDetDescriptor.h:186
TileDetDescriptor::m_n_phi
unsigned int m_n_phi
Definition: TileDetDescriptor.h:131
TileDetDescriptor::dz
float dz(unsigned int samp) const
Definition: TileDetDescriptor.h:212
TileDetDescriptor::sign_eta
int sign_eta() const
Definition: TileDetDescriptor.h:224
TileDetDescriptor::phi_max
float phi_max() const
Definition: TileDetDescriptor.h:171
MAX_N_SAMP_TILEDD
#define MAX_N_SAMP_TILEDD
Definition: TileDetDescriptor.h:17
TileDetDescriptor::m_rcenter
float m_rcenter[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:125
TileDetDescriptor::n_eta
int n_eta(unsigned int samp) const
Definition: TileDetDescriptor.h:159
TileDetDescriptor::dr
float dr(unsigned int samp) const
Definition: TileDetDescriptor.h:198
TileDetDescriptor::identify
Identifier identify(void) const
Definition: TileDetDescriptor.h:249
TileDetDescriptor::rcenter
float rcenter(unsigned int samp) const
Definition: TileDetDescriptor.h:191
TileDetDescriptor::set
void set(const Identifier &id)
Definition: TileDetDescriptor.h:244
TileDetDescriptor::m_zcenter
float m_zcenter[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:127
TileDetDescriptor::m_deta
float m_deta[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:120
TileDetDescriptor::zcenter
float zcenter(unsigned int samp) const
Definition: TileDetDescriptor.h:205
TileDetDescriptor::n_samp
int n_samp() const
Definition: TileDetDescriptor.h:219
TileDetDescriptor
Definition: TileDetDescriptor.h:46
TileDetDescriptor::eta
float eta(unsigned int eta_channel, unsigned int samp) const
Definition: TileDetDescriptor.h:229
TileDetDescriptor::m_dz
float m_dz[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:128
TileDetDescriptor::eta_min
float eta_min(unsigned int samp) const
Definition: TileDetDescriptor.h:138
TileDetDescriptor::m_dr
float m_dr[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:126
TileDetDescriptor::m_eta_min
float m_eta_min[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:118
TileDetDescriptor::deta
float deta(unsigned int samp) const
Definition: TileDetDescriptor.h:152
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
TileDetDescriptor::m_eta_max
float m_eta_max[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:119
TileDetDescriptor::m_sign_eta
int m_sign_eta
Definition: TileDetDescriptor.h:132
TileDetDescriptor::m_n_samp
unsigned int m_n_samp
Definition: TileDetDescriptor.h:129
TileDetDescriptor::TileDetDescriptor
TileDetDescriptor()
Definition: TileDetDescriptor.cxx:20
TileDetDescriptor::m_n_eta
unsigned int m_n_eta[MAX_N_SAMP_TILEDD]
Definition: TileDetDescriptor.h:130
TileDetDescriptor::m_id
Identifier m_id
Definition: TileDetDescriptor.h:117
TileDetDescriptor::m_zshift
float m_zshift
Definition: TileDetDescriptor.h:124
TileDetDescriptor::n_phi
int n_phi() const
Definition: TileDetDescriptor.h:181
TileDetDescriptor::m_phi_max
float m_phi_max
Definition: TileDetDescriptor.h:122
Identifier
Definition: IdentifierFieldParser.cxx:14