ATLAS Offline Software
LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ***************************************************************************
6 // Liquid Argon FCAL detector description package
7 // -----------------------------------------
8 //
9 //
10 // 10-Sep-2000 S.Simion Handling of the FCAL read-out identifiers
11 // Jan-2001 R.Sobie Modify for persistency
12 // Feb-2002 R.Sobie Use same FCAL geometry files as simulation
13 // ***************************************************************************
14 
15 #ifndef LARREADOUTGEOMETRY_FCAL_CHANNELMAP_H
16 #define LARREADOUTGEOMETRY_FCAL_CHANNELMAP_H
17 
18 
19 //<<<<<< INCLUDES >>>>>>
20 
21 
22 #include <math.h>
23 #include <vector>
24 #include <functional>
25 #include <map>
26 #include <string>
27 #include <stdexcept>
28 
29 
34 {
35 public:
36 
37 
38 
39  //
40  // Typedefs:
41  //
42  typedef unsigned int tileName_t;
43  typedef unsigned int tubeID_t;
44 
45  //------------ TubePosition: X,Y Position of an FCAL Tube---- //
46  // //
47  class TubePosition { //
48  public: //
49  TubePosition(); //
50  TubePosition(tileName_t name, float x, float y, const std::string& hvFT);//
51  tileName_t get_tileName() const; //
52  float x() const; //
53  float y() const; //
54  std::string getHVft() const; //Gabe
55  private: //
57  float m_x; //
58  float m_y; //
59  std::string m_hvFT; // Gabe
60  }; //
61  //-------------------------------------------------------------//
62 
63 
64 
66  FCAL_ChannelMap( int itemp);
67 
68  typedef std::map<tubeID_t, TubePosition > tubeMap_t;
69  typedef tubeMap_t::size_type tubemap_sizetype;
70  typedef tubeMap_t::value_type tubemap_valuetype;
71  typedef tubeMap_t::const_iterator tubemap_const_iterator;
72 
74  tubemap_const_iterator tubemap_begin (int isam) const;
75  tubemap_const_iterator tubemap_end (int isam) const;
76  tubemap_sizetype tubemap_size (int isam) const;
77 
78 
79  // Get the tube by copy number:
80  tubemap_const_iterator getTubeByCopyNumber ( int isam, int copyNo) const;
81 
82 
86  bool getTileID(int isam,
87  float x,
88  float y,
89  int& eta,
90  int& phi) const;
91 
93  float x(int isam,
94  int eta,
95  int phi) const;
96  float y(int isam,
97  int eta,
98  int phi) const;
99 
100  void tileSize(int sam, int eta, int phi,
101  float& dx, float& dy) const;
102 
103  void tileSize(int isam, int ntubes, float& dx, float& dy) const;
104 
105 
107  void print_tubemap (int isam) const;
108 
112  bool invert_x() const;
113  bool invert_xy() const ;
114  void set_invert_x(bool );
115  void set_invert_xy(bool );
116 
117 
118  // Fill this. The information comes from the database.
119  void add_tube (const std::string & tileName, int mod, int id, int i, int j, double xCm, double yCm);//original
120  void add_tube (const std::string & tileName, int mod, int id, int i, int j, double xCm, double yCm, std::string hvFT);//29-03-07 include HV
121 
122 
123  // Finish the job. Create the tile map.
124  void finish();
125 
126 
127  class TilePosition {
128  public:
129  TilePosition();
130  TilePosition(float x, float y, int ntubes);
131  float x() const;
132  float y() const;
133  unsigned int ntubes() const;
134  private:
135  float m_x;
136  float m_y;
137  unsigned int m_ntubes;
138  };
139 
141  typedef std::map<tileName_t, TilePosition > tileMap_t;
142  typedef tileMap_t::size_type tileMap_sizetype;
143  typedef tileMap_t::value_type tileMap_valuetype;
144  typedef tileMap_t::const_iterator tileMap_const_iterator;
145 
146  // Methods to iterate over the tile map:
147  tileMap_const_iterator begin(int isam) const {return m_tileMap[isam-1].begin();}
148  tileMap_const_iterator end(int isam) const {return m_tileMap[isam-1].end(); };
149 
150 
151 private:
152  float x1(int isam,
153  int eta,
154  int phi) const;
155  float y1(int isam,
156  int eta,
157  int phi) const;
158 
160  static const double m_tubeSpacing[];
161  double m_tubeDx[3]{};
162  double m_tubeDy[3]{};
163  double m_tileDx[3]{};
164  double m_tileDy[3]{};
165  bool m_invert_x; // Some geometry need x inverted
166  bool m_invert_xy; // Some geometry need xy crossed
167 
169  void create_tileMap( int isam );
170 
173  std::vector<tubemap_const_iterator> m_tubeIndex[3];
174 };
175 
176 
177 // Tube Position functions
178 
179 inline
181  :
182  m_tileName(0),
183  m_x(0),
184  m_y(0),
185  m_hvFT("")
186 {}
187 
188 inline
189 FCAL_ChannelMap::TubePosition::TubePosition(tileName_t name, float x, float y, const std::string& hvFT)
190  :
191  m_tileName(name),
192  m_x(x),
193  m_y(y),
194  m_hvFT(hvFT)
195 {}
196 
197 
200 {
201  return m_tileName;
202 }
203 
204 
205 inline float
207 {
208  return m_x;
209 }
210 
211 inline float
213 {
214  return m_y;
215 }
216 
217 
218 inline std::string
220 {
221  return m_hvFT;
222 }
223 
224 
225 // Tile Position functions
226 
227 inline
229  :
230  m_x(0),
231  m_y(0),
232  m_ntubes(0)
233 {}
234 
235 inline
237  :
238  m_x(x),
239  m_y(y),
240  m_ntubes(ntubes)
241 {}
242 
243 
244 inline float
246 {
247  return m_x;
248 }
249 
250 inline float
252 {
253  return m_y;
254 }
255 
256 inline unsigned int
258 {
259  return m_ntubes;
260 }
261 
262 inline
264 return m_invert_x;
265 }
266 
267 inline
269 return m_invert_xy;
270 }
271 
272 inline
274 m_invert_x = flag;
275 return ;
276 }
277 
278 inline
280 m_invert_xy = flag;
281 return ;
282 }
283 
284 #include "AthenaKernel/CLASS_DEF.h"
285 CLASS_DEF(FCAL_ChannelMap, 74242524, 1)
286 
287 #endif // LARDETDESCR_FCAL_CHANNELMAP_H
288 
289 
290 
291 
292 
293 
FCAL_ChannelMap::TubePosition::get_tileName
tileName_t get_tileName() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:199
FCAL_ChannelMap::m_tileDx
double m_tileDx[3]
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:163
FCAL_ChannelMap::m_invert_xy
bool m_invert_xy
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:166
FCAL_ChannelMap::x1
float x1(int isam, int eta, int phi) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:320
FCAL_ChannelMap::getTubeByCopyNumber
tubemap_const_iterator getTubeByCopyNumber(int isam, int copyNo) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:119
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
FCAL_ChannelMap::TubePosition::TubePosition
TubePosition()
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:180
FCAL_ChannelMap::end
tileMap_const_iterator end(int isam) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:148
FCAL_ChannelMap::TubePosition::m_x
float m_x
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:57
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
FCAL_ChannelMap::tileMap_t
std::map< tileName_t, TilePosition > tileMap_t
TileMap.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:141
FCAL_ChannelMap::tileName_t
unsigned int tileName_t
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:42
FCAL_ChannelMap
This class contains the tube and tile maps for the FCAL A tile is of a set of FCAL tubes.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:34
FCAL_ChannelMap::create_tileMap
void create_tileMap(int isam)
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:130
FCAL_ChannelMap::TubePosition::m_y
float m_y
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:58
FCAL_ChannelMap::TilePosition::ntubes
unsigned int ntubes() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:257
FCAL_ChannelMap::TubePosition
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:47
FCAL_ChannelMap::FCAL_ChannelMap
FCAL_ChannelMap(int itemp)
Constructors:
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:27
FCAL_ChannelMap::tileMap_valuetype
tileMap_t::value_type tileMap_valuetype
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:143
FCAL_ChannelMap::add_tube
void add_tube(const std::string &tileName, int mod, int id, int i, int j, double xCm, double yCm)
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:69
FCAL_ChannelMap::TilePosition::y
float y() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:251
FCAL_ChannelMap::m_tubeSpacing
static const double m_tubeSpacing[]
Geometrical parameters here, in CLHEP::cm please to be compatible with G3.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:160
FCAL_ChannelMap::TilePosition::x
float x() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:245
FCAL_ChannelMap::m_tubeIndex
std::vector< tubemap_const_iterator > m_tubeIndex[3]
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:173
FCAL_ChannelMap::set_invert_xy
void set_invert_xy(bool)
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:279
FCAL_ChannelMap::TubePosition::getHVft
std::string getHVft() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:219
FCAL_ChannelMap::m_tubeDx
double m_tubeDx[3]
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:161
FCAL_ChannelMap::tileMap_sizetype
tileMap_t::size_type tileMap_sizetype
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:142
FCAL_ChannelMap::TilePosition::TilePosition
TilePosition()
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:228
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
FCAL_ChannelMap::m_tubeDy
double m_tubeDy[3]
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:162
lumiFormat.i
int i
Definition: lumiFormat.py:92
FCAL_ChannelMap::x
float x(int isam, int eta, int phi) const
For reconstruction, decoding of tile identifiers.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:311
master.flag
bool flag
Definition: master.py:29
FCAL_ChannelMap::getTileID
bool getTileID(int isam, float x, float y, int &eta, int &phi) const
-— For the new LArFCAL_ID Identifier
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:212
FCAL_ChannelMap::TilePosition::m_y
float m_y
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:136
FCAL_ChannelMap::tubemap_size
tubemap_sizetype tubemap_size(int isam) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:487
FCAL_ChannelMap::tubemap_sizetype
tubeMap_t::size_type tubemap_sizetype
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:69
FCAL_ChannelMap::set_invert_x
void set_invert_x(bool)
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:273
FCAL_ChannelMap::tubemap_valuetype
tubeMap_t::value_type tubemap_valuetype
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:70
FCAL_ChannelMap::TubePosition::y
float y() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:212
FCAL_ChannelMap::finish
void finish()
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
FCAL_ChannelMap::TilePosition
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:127
FCAL_ChannelMap::m_tileMap
tileMap_t m_tileMap[3]
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:168
FCAL_ChannelMap::TilePosition::m_x
float m_x
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:135
FCAL_ChannelMap::invert_x
bool invert_x() const
set and get for the inversion flags
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:263
FCAL_ChannelMap::TubePosition::m_hvFT
std::string m_hvFT
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:59
FCAL_ChannelMap::y
float y(int isam, int eta, int phi) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:355
FCAL_ChannelMap::m_tileDy
double m_tileDy[3]
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:164
FCAL_ChannelMap::invert_xy
bool invert_xy() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:268
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
FCAL_ChannelMap::tileMap_const_iterator
tileMap_t::const_iterator tileMap_const_iterator
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:144
FCAL_ChannelMap::y1
float y1(int isam, int eta, int phi) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:364
FCAL_ChannelMap::tubemap_const_iterator
tubeMap_t::const_iterator tubemap_const_iterator
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:71
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
FCAL_ChannelMap::TubePosition::m_tileName
tileName_t m_tileName
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:56
FCAL_ChannelMap::begin
tileMap_const_iterator begin(int isam) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:147
FCAL_ChannelMap::tubeMap_t
std::map< tubeID_t, TubePosition > tubeMap_t
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:68
FCAL_ChannelMap::TubePosition::x
float x() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:206
FCAL_ChannelMap::tileSize
void tileSize(int sam, int eta, int phi, float &dx, float &dy) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:429
FCAL_ChannelMap::tubemap_end
tubemap_const_iterator tubemap_end(int isam) const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:480
FCAL_ChannelMap::TilePosition::m_ntubes
unsigned int m_ntubes
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:137
FCAL_ChannelMap::tubeID_t
unsigned int tubeID_t
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:43
CLASS_DEF.h
macros to associate a CLID to a type
FCAL_ChannelMap::tubemap_begin
tubemap_const_iterator tubemap_begin(int isam) const
tubeMap access functions
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:472
FCAL_ChannelMap::m_tubeMap
tubeMap_t m_tubeMap[3]
TubeMap.
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:172
FCAL_ChannelMap::m_invert_x
bool m_invert_x
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:165
FCAL_ChannelMap::print_tubemap
void print_tubemap(int isam) const
print functions
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:454