ATLAS Offline Software
TileDetDescriptor.cxx
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 
11 
13 
14 #include <iostream>
15 #include <iomanip>
16 #include <cstring>
17 
18 using std::memset;
19 
21  :
22  m_phi_min(0),
23  m_phi_max(0),
24  m_dphi(0),
25  m_zshift(0),
26  m_n_samp(0),
27  m_n_phi(0),
28  m_sign_eta(0)
29 {
30  AtlasDetectorID atlas;
31  m_id = atlas.tile();
32  memset(m_eta_min, 0, MAX_N_SAMP_TILEDD*sizeof(float));
33  memset(m_eta_max, 0, MAX_N_SAMP_TILEDD*sizeof(float));
34  memset(m_deta, 0, MAX_N_SAMP_TILEDD*sizeof(float));
35  memset(m_rcenter, 0, MAX_N_SAMP_TILEDD*sizeof(float));
36  memset(m_dr, 0, MAX_N_SAMP_TILEDD*sizeof(float));
37  memset(m_zcenter, 0, MAX_N_SAMP_TILEDD*sizeof(float));
38  memset(m_dz, 0, MAX_N_SAMP_TILEDD*sizeof(float));
39  memset(m_n_eta, 0, MAX_N_SAMP_TILEDD*sizeof(int));
40 }
41 
43  const float eta_max[],
44  const float deta[],
45  const float phi_min,
46  const float phi_max,
47  const float dphi,
48  const float zshift,
49  const float rcenter[],
50  const float dr[],
51  const float zcenter[],
52  const float dz[],
53  const unsigned int n_samp,
54  const int sign_eta)
55  : m_phi_min(phi_min)
56  , m_phi_max(phi_max)
57  , m_dphi(dphi)
58  , m_zshift(zshift)
59  , m_n_samp(n_samp)
60  , m_n_phi((unsigned int) ((phi_max - phi_min)/dphi + 0.5))
61  , m_sign_eta(sign_eta)
62 {
63  AtlasDetectorID atlas;
64  m_id = atlas.tile();
65  for (unsigned int i=0; i<n_samp; ++i) {
66  m_eta_min[i] = eta_min[i];
67  m_eta_max[i] = eta_max[i];
68  m_deta[i] = deta[i];
69  m_rcenter[i] = rcenter[i];
70  m_dr[i] = dr[i];
71  m_zcenter[i] = zcenter[i];
72  m_dz[i] = dz[i];
73  m_n_eta[i] = ((unsigned int) ((eta_max[i] - eta_min[i])/deta[i] + 0.5));
74  }
75  for (unsigned int i=n_samp; i<MAX_N_SAMP_TILEDD; ++i) {
76  m_eta_min[i] = 0;
77  m_eta_max[i] = 0;
78  m_deta[i] = 0;
79  m_rcenter[i] = 0;
80  m_dr[i] = 0;
81  m_zcenter[i] = 0;
82  m_dz[i] = 0;
83  m_n_eta[i] = 0;
84  }
85 }
86 
87 void
88 TileDetDescriptor::set(const float eta_min[],
89  const float eta_max[],
90  const float deta[],
91  const float phi_min,
92  const float phi_max,
93  const float dphi,
94  const float zshift,
95  const float rcenter[],
96  const float dr[],
97  const float zcenter[],
98  const float dz[],
99  const unsigned int n_samp,
100  const unsigned int n_eta[],
101  const unsigned int n_phi,
102  const int sign_eta)
103 {
104  m_phi_min = phi_min;
105  m_phi_max = phi_max;
106  m_dphi = dphi;
107  m_zshift = zshift;
108  m_n_samp = n_samp;
109  m_n_phi = n_phi;
111 
112  for (unsigned int i=0; i<n_samp; ++i) {
113  m_eta_min[i] = eta_min[i];
114  m_eta_max[i] = eta_max[i];
115  m_deta[i] = deta[i];
116  m_rcenter[i] = rcenter[i];
117  m_dr[i] = dr[i];
118  m_zcenter[i] = zcenter[i];
119  m_dz[i] = dz[i];
120  m_n_eta[i] = n_eta[i];
121  }
122 }
123 
124 
126 {
127  std::cout << std::endl << " TileDetDescriptor print: "
128  << std::endl << std::endl;
129 
130  std::cout << " phi min phi max dphi nphi zshift sign_eta nsamp"
131  << std::endl;
132  std::cout << std::setiosflags(std::ios::fixed);
133  std::cout
134  << std::setw(9) << std::setprecision(4) << m_phi_min << " "
135  << std::setw(9) << std::setprecision(4) << m_phi_max << " "
136  << std::setw(9) << std::setprecision(4) << m_dphi << " "
137  << std::setw(6) << std::setprecision(4) << m_n_phi << " "
138  << std::setw(8) << std::setprecision(2) << m_zshift << " "
139  << std::setw(7) << std::setprecision(4) << m_sign_eta<< " "
140  << std::setw(7) << std::setprecision(4) << m_n_samp << " "
141  << std::endl;
142 
143  std::cout << " eta min eta max deta neta radius dR Z dZ"
144  << std::endl;
145 
146  for (unsigned int i=0; i<m_n_samp; ++i) {
147  std::cout
148  << std::setw(9) << std::setprecision(4) << m_eta_min[i] << " "
149  << std::setw(9) << std::setprecision(4) << m_eta_max[i] << " "
150  << std::setw(9) << std::setprecision(4) << m_deta[i] << " "
151  << std::setw(6) << std::setprecision(4) << m_n_eta[i] << " "
152  << std::setw(9) << std::setprecision(2) << m_rcenter[i] << " "
153  << std::setw(9) << std::setprecision(2) << m_dr[i] << " "
154  << std::setw(9) << std::setprecision(2) << m_zcenter[i] << " "
155  << std::setw(9) << std::setprecision(2) << m_dz[i] << " "
156  << std::endl;
157  }
158 
159  std::cout << std::resetiosflags(std::ios::fixed);
160 }
161 
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TileDetDescriptor::phi_min
float phi_min() const
Definition: TileDetDescriptor.h:166
TileDetDescriptor::dphi
float dphi() const
Definition: TileDetDescriptor.h:176
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
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
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
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
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
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
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileDetDescriptor::zcenter
float zcenter(unsigned int samp) const
Definition: TileDetDescriptor.h:205
TileDetDescriptor::n_samp
int n_samp() const
Definition: TileDetDescriptor.h:219
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
AtlasDetectorID::tile
Identifier tile(void) const
Definition: AtlasDetectorID.cxx:45
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
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.h
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
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
TileDetDescriptor::m_phi_max
float m_phi_max
Definition: TileDetDescriptor.h:122