ATLAS Offline Software
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/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 FCAL_CHANNELMAP_H
16 #define FCAL_CHANNELMAP_H
17 
18 
19 #include <vector>
20 #include <map>
21 #include <string>
22 
23 
27 class FCAL_ChannelMap
28 {
29 public:
30 
31 
32 
33  //
34  // Typedefs:
35  //
36  typedef unsigned int tileName_t;
37  typedef unsigned int tubeID_t;
38 
39  //------------ TubePosition: X,Y Position of an FCAL Tube---- //
40  // //
41  class TubePosition { //
42  public: //
44  TubePosition(tileName_t name, float x, float y, const std::string & hvFT);//
46  float x() const; //
47  float y() const; //
48  const std::string& getHVft() const; //Gabe
49  private: //
51  float m_x; //
52  float m_y; //
53  std::string m_hvFT; // Gabe
54  }; //
55  //-------------------------------------------------------------//
56 
57 
58 
60  FCAL_ChannelMap( int itemp);
61 
62  typedef std::map<tubeID_t, TubePosition > tubeMap_t;
63  typedef tubeMap_t::size_type tubemap_sizetype;
64  typedef tubeMap_t::value_type tubemap_valuetype;
65  typedef tubeMap_t::const_iterator tubemap_const_iterator;
66 
70  tubemap_sizetype tubemap_size (int isam) const;
71 
72 
73  // Get the tube by copy number:
74  tubemap_const_iterator getTubeByCopyNumber ( int isam, int copyNo) const;
75 
76 
80  bool getTileID(int isam,
81  float x,
82  float y,
83  int& eta,
84  int& phi) const;
85 
87  float x(int isam,
88  int eta,
89  int phi) const;
90  float y(int isam,
91  int eta,
92  int phi) const;
93 
94  void tileSize(int sam, int eta, int phi,
95  float& dx, float& dy) const;
96 
97  void tileSize(int isam, int ntubes, float& dx, float& dy) const;
98 
99 
101  void print_tubemap (int isam) const;
102 
106  bool invert_x() const;
107  bool invert_xy() const ;
108  void set_invert_x(bool );
109  void set_invert_xy(bool );
110 
111 
112  // Fill this. The information comes from the database.
113  void add_tube (const std::string & tileName, int mod, int id, int i, int j, double xCm, double yCm);//original
114  void add_tube (const std::string & tileName, int mod, int id, int i, int j, double xCm, double yCm, const std::string & hvFT);//29-03-07 include HV
115 
116 
117  // Finish the job. Create the tile map.
118  void finish();
119 
120 
121  class TilePosition {
122  public:
124  TilePosition(float x, float y, int ntubes);
125  float x() const;
126  float y() const;
127  unsigned int ntubes() const;
128  private:
129  float m_x;
130  float m_y;
131  unsigned int m_ntubes;
132  };
133 
135  typedef std::map<tileName_t, TilePosition > tileMap_t;
136  typedef tileMap_t::size_type tileMap_sizetype;
137  typedef tileMap_t::value_type tileMap_valuetype;
138  typedef tileMap_t::const_iterator tileMap_const_iterator;
139 
140  // Methods to iterate over the tile map:
141  tileMap_const_iterator begin(int isam) const {return m_tileMap[isam-1].begin();}
142  tileMap_const_iterator end(int isam) const {return m_tileMap[isam-1].end(); };
143 
144 
145 private:
147  static const double m_tubeSpacing[];
148  double m_tubeDx[3];
149  double m_tubeDy[3];
150  double m_tileDx[3];
151  double m_tileDy[3];
152  mutable bool m_invert_x; // Some geometry need x inverted
153  mutable bool m_invert_xy; // Some geometry need xy crossed
154 
155  tileMap_t m_tileMap[3];
156  void create_tileMap( int isam );
157 
159  tubeMap_t m_tubeMap[3];
160  std::vector<tubemap_const_iterator> m_tubeIndex[3];
161 };
162 
163 
164 // Tube Position functions
165 
166 inline
168  :
169  m_tileName(0),
170  m_x(0),
171  m_y(0),
172  m_hvFT("")
173 {}
174 
175 inline
176 FCAL_ChannelMap::TubePosition::TubePosition(tileName_t name, float x, float y, const std::string & hvFT)
177  :
178  m_tileName(name),
179  m_x(x),
180  m_y(y),
181  m_hvFT(hvFT)
182 {}
183 
184 
187 {
188  return m_tileName;
189 }
190 
191 
192 inline float
194 {
195  return m_x;
196 }
197 
198 inline float
200 {
201  return m_y;
202 }
203 
204 
205 inline const std::string&
207 {
208  return m_hvFT;
209 }
210 
211 
212 // Tile Position functions
213 
214 inline
216  :
217  m_x(0),
218  m_y(0),
219  m_ntubes(0)
220 {}
221 
222 inline
223 FCAL_ChannelMap::TilePosition::TilePosition(float x, float y, int ntubes)
224  :
225  m_x(x),
226  m_y(y),
227  m_ntubes(ntubes)
228 {}
229 
230 
231 inline float
233 {
234  return m_x;
235 }
236 
237 inline float
239 {
240  return m_y;
241 }
242 
243 inline unsigned int
245 {
246  return m_ntubes;
247 }
248 
249 inline
250 bool FCAL_ChannelMap::invert_x() const {
251 return m_invert_x;
252 }
253 
254 inline
255 bool FCAL_ChannelMap::invert_xy() const {
256 return m_invert_xy;
257 }
258 
259 inline
261 m_invert_x = flag;
262 return ;
263 }
264 
265 inline
267 m_invert_xy = flag;
268 return ;
269 }
270 
271 //#include "CLIDSvc/CLASS_DEF.h"
272 //CLASS_DEF(FCAL_ChannelMap, 74242524, 1)
273 
274 #endif // LARDETDESCR_FCAL_CHANNELMAP_H
275 
276 
277 
278 
279 
280 
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::TubePosition::get_tileName
tileName_t get_tileName() const
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
FCAL_ChannelMap::TubePosition::TubePosition
TubePosition()
FCAL_ChannelMap::end
tileMap_const_iterator end(int isam) const
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:142
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::tubemap_size
tubemap_sizetype tubemap_size(int isam) const
FCAL_ChannelMap::tileMap_t
std::map< tileName_t, TilePosition > tileMap_t
TileMap.
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:135
FCAL_ChannelMap::tileName_t
unsigned int tileName_t
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:36
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)
FCAL_ChannelMap::TubePosition::TubePosition
TubePosition(tileName_t name, float x, float y, const std::string &hvFT)
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:
FCAL_ChannelMap::tileMap_valuetype
tileMap_t::value_type tileMap_valuetype
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:137
FCAL_ChannelMap::add_tube
void add_tube(const std::string &tileName, int mod, int id, int i, int j, double xCm, double yCm)
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::getTubeByCopyNumber
tubemap_const_iterator getTubeByCopyNumber(int isam, int copyNo) const
FCAL_ChannelMap::TilePosition::x
float x() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:245
x
#define x
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)
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: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:136
FCAL_ChannelMap::TilePosition::TilePosition
TilePosition()
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
FCAL_ChannelMap::TilePosition::m_y
float m_y
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:136
FCAL_ChannelMap::tubemap_sizetype
tubeMap_t::size_type tubemap_sizetype
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:63
FCAL_ChannelMap::tubemap_end
tubemap_const_iterator tubemap_end(int isam) const
FCAL_ChannelMap::set_invert_x
void set_invert_x(bool)
FCAL_ChannelMap::tubemap_valuetype
tubeMap_t::value_type tubemap_valuetype
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:64
FCAL_ChannelMap::TubePosition::y
float y() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:212
FCAL_ChannelMap::finish
void finish()
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
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
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
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
FCAL_ChannelMap::tileMap_const_iterator
tileMap_t::const_iterator tileMap_const_iterator
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:138
y
#define y
FCAL_ChannelMap::tubemap_const_iterator
tubeMap_t::const_iterator tubemap_const_iterator
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:65
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::TilePosition::TilePosition
TilePosition(float x, float y, int ntubes)
FCAL_ChannelMap::begin
tileMap_const_iterator begin(int isam) const
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:141
FCAL_ChannelMap::tubeMap_t
std::map< tubeID_t, TubePosition > tubeMap_t
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:62
FCAL_ChannelMap::TubePosition::x
float x() const
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:206
FCAL_ChannelMap::tubemap_begin
tubemap_const_iterator tubemap_begin(int isam) const
tubeMap access functions
FCAL_ChannelMap::tileSize
void tileSize(int sam, int eta, int phi, float &dx, float &dy) const
FCAL_ChannelMap::TilePosition::m_ntubes
unsigned int m_ntubes
Definition: LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:137
FCAL_ChannelMap::TubePosition::getHVft
const std::string & getHVft() const
FCAL_ChannelMap::tubeID_t
unsigned int tubeID_t
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/LArReadoutGeometry/FCAL_ChannelMap.h:37
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::tileSize
void tileSize(int isam, int ntubes, float &dx, float &dy) const
FCAL_ChannelMap::print_tubemap
void print_tubemap(int isam) const
print functions