ATLAS Offline Software
Loading...
Searching...
No Matches
TileDetDescrManager.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#ifndef TILEDETDESCR_TILEDETDESCRMANAGER_H
6#define TILEDETDESCR_TILEDETDESCRMANAGER_H
7
8#include "GeoModelKernel/GeoVDetectorManager.h"
13
14#include <vector>
15#include <map>
16#include <cmath>
17#include <memory>
18
19// fwd
20class TileDddbManager;
23class TileID;
24class TileHWID;
27class TileCellDim;
28class MsgStream;
29
30typedef std::shared_ptr<TileDddbManager> TileDddbManager_ptr;
31
32class TileDetDescrManager : public GeoVDetectorManager, public AthMessaging
33{
34public:
35 // Temporary solution for cell volumes
36 // these numbers are normally overwritten by numbers from GeoModel in releases after 12.0.0
37 static const double vBarrelCells[23];
38 static const double vExtendedCells[12];
39 static const double vItcGapCells[6];
40
41 // TYPEDEFS
42 typedef std::vector <TileDetDescrRegion*> tile_region_vec;
43 typedef tile_region_vec::size_type tile_region_vec_size;
44 typedef tile_region_vec::const_iterator tile_region_const_iterator;
45
46 typedef std::vector <TileDetDescriptor*> tile_descr_vec;
47 typedef tile_descr_vec::size_type tile_descr_vec_size;
48 typedef tile_descr_vec::const_iterator tile_descr_const_iterator;
49
50 typedef std::vector <CaloDetDescriptor*> calo_descr_vec;
51 typedef calo_descr_vec::size_type calo_descr_vec_size;
52 typedef calo_descr_vec::const_iterator calo_descr_const_iterator;
53
54 typedef std::vector <CaloDetDescrElement*> calo_element_vec;
55 typedef calo_element_vec::size_type calo_element_vec_size;
56 typedef calo_element_vec::const_iterator calo_element_const_iterator;
57
58 typedef std::map <unsigned int, TileDetDescrRegion*, std::less<unsigned int> > tile_region_map;
59 typedef std::map <unsigned int, CaloDetDescriptor*, std::less<int> > scalo_descr_map;
60 typedef std::map <unsigned int, CaloDetDescriptor*, std::less<unsigned int> > calo_descr_map;
61 typedef std::map <unsigned int, CaloDetDescrElement*, std::less<unsigned int> > calo_element_map;
62 typedef std::map <unsigned int, TileCellDim*, std::less<unsigned int> > cell_dim_map;
63
64 // --------------- TYPEDEFS
65
68
69 // Access to raw geometry:
70 virtual unsigned int getNumTreeTops() const override;
71 virtual PVConstLink getTreeTop(unsigned int i) const override;
72
73 void addTreeTop(PVConstLink); // Add a Tree top:
74
75 // ---------------- Access to raw geometry:
76
77 // Access to TileDddbManager object
79 // Release Db manager
80 void releaseDbManager();
81
82 // -------------- Readout geometry ---------------------
83
84 // Access to Tile Regions
85 TileDetDescrRegion* find_tile_region(const Identifier& region_id) const // Region find()
86 { tile_region_map::const_iterator it = m_tile_region_map.find(region_id.get_identifier32().get_compact());
87 if (it != m_tile_region_map.end() ) return (*it).second; else return NULL;
88 }
89
91 { return m_tile_region_vec.begin(); }
92
94 { return m_tile_region_vec.end(); }
95
97 { return m_tile_region_vec.size(); }
98
99
100 // Access to Tile Descriptors
102 { return m_tile_descr_vec.begin(); }
103
105 { return m_tile_descr_vec.end(); }
106
108 { return m_tile_descr_vec.size(); }
109
110
111 // Access to Calo Descriptors
113 { return m_calo_descr_vec.begin(); }
114
116 { return m_calo_descr_vec.end(); }
117
119 { return m_calo_descr_vec.size(); }
120
122 { scalo_descr_map::const_iterator it = m_calo_descr_map.find((int)sample*side);
123 if (it != m_calo_descr_map.end() ) return (*it).second; else return NULL;
124 }
125
126
127 // Access to Tile Modules
129 { return m_tile_module_vec.begin(); }
130
132 { return m_tile_module_vec.end(); }
133
135 { return m_tile_module_vec.size(); }
136
137 CaloDetDescriptor* get_module_element(const IdentifierHash module_hash) const // GetElement (Hash)
138 { return m_tile_module_vec[(unsigned int)module_hash]; }
139
140 CaloDetDescriptor* get_module_element(const Identifier& module_id) const // GetElement (ID)
141 { calo_descr_map::const_iterator it = m_tile_module_map.find(module_id.get_identifier32().get_compact());
142 if (it != m_tile_module_map.end() ) return (*it).second; else return NULL;
143 }
144
145
146 // Access to Tile Cells
148 { return m_tile_cell_vec.begin(); }
149
151 { return m_tile_cell_vec.end(); }
152
154 { return m_tile_cell_vec.size(); }
155
156 CaloDetDescrElement* get_cell_element(unsigned int cell_hash) const // GetCell (CellHash)
157 { return m_tile_cell_vec[cell_hash]; }
158
159 CaloDetDescrElement* get_cell_element(const IdentifierHash cell_hash) const // GetCell (Hash)
160 { return m_tile_cell_vec[(unsigned int)cell_hash]; }
161
162 CaloDetDescrElement* get_cell_element(const Identifier& cell_id) const // GetCell (ID)
163 { calo_element_map::const_iterator it = m_tile_cell_map.find(cell_id.get_identifier32().get_compact());
164 if (it != m_tile_cell_map.end() ) return (*it).second; else return NULL;
165 }
166
167
168 // Access TileCellDim-s
169 TileCellDim* get_cell_dim(const Identifier& cell_id) const;
170
171 // Access to IdHelpers
172 const TileID* get_id() const { return m_tile_id;}
173 const TileHWID* get_hwid() const { return m_tile_hwid;}
174
175 // Print
176 void print() const;
177
178 // Create elements
179 void create_elements();
180 void create_elements(bool checks);
181
182 // Insertion
183 void add(TileDetDescrRegion* region);
184 void add(TileDetDescriptor* descriptor);
185 void add_calodescr(CaloDetDescriptor* descriptor);
186 void add_module(IdentifierHash idhash, CaloDetDescriptor* module);
187 void add_cell(CaloDetDescrElement* cell);
188 void add_cellDim(int section, int side, int tower, int sample, TileCellDim* cellDim);
189
190 void set_helper(const TileID* id){ m_tile_id = id; }
191 void set_helper(const CaloCell_ID* id){ m_cell_id = id; }
192 void set_helper(const TileHWID* id){ m_tile_hwid = id; }
193
194private:
197
198 // Delete regions and descriptors
199 void clear();
200
201 // ----------- Data members -------------
202
203 // Tree Tops
204 std::vector<PVConstLink> m_treeTops;
205
206 // DB Manager
208
210
214
218
219 // calo descriptors : 1 map for CaloSample*sign and one unsorted vector
222
223 // modules : 1 map for compact id, 1 vector for hashed
226
227 // cells : 1 map for compact id, 1 vector for hashed
230
232
233 // z-shift operator-function definitions:
234 inline double shiftEta(double eta, double Rcen, double zshift) {
235 return eta + zshift * tanh(eta) * tan(2 * atan(exp(-eta))) / Rcen;
236 }
237};
238
239#ifndef GAUDI_NEUTRAL
242#endif
243
244
245#endif
246
Scalar eta() const
pseudorapidity method
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
void section(const std::string &sec)
std::shared_ptr< TileDddbManager > TileDddbManager_ptr
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
This class groups all DetDescr information related to a CaloCell.
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
This is a "hash" representation of an Identifier.
This class provides access to constants in the Geometry DB.
void add_calodescr(CaloDetDescriptor *descriptor)
calo_descr_map m_tile_module_map
std::vector< PVConstLink > m_treeTops
std::map< unsigned int, CaloDetDescriptor *, std::less< int > > scalo_descr_map
calo_element_map m_tile_cell_map
calo_descr_vec::size_type calo_descr_vec_size
tile_region_const_iterator tile_region_begin() const
virtual PVConstLink getTreeTop(unsigned int i) const override
calo_element_const_iterator tile_cell_end() const
tile_region_map m_tile_region_map
calo_element_vec::const_iterator calo_element_const_iterator
virtual unsigned int getNumTreeTops() const override
tile_region_vec::size_type tile_region_vec_size
CaloDetDescriptor * get_module_element(const IdentifierHash module_hash) const
const TileID * get_id() const
calo_element_const_iterator tile_cell_begin() const
calo_element_vec_size tile_cell_size() const
scalo_descr_map m_calo_descr_map
void add_cellDim(int section, int side, int tower, int sample, TileCellDim *cellDim)
double shiftEta(double eta, double Rcen, double zshift)
tile_descr_const_iterator tile_descriptors_begin() const
calo_descr_const_iterator tile_module_end() const
tile_descr_vec_size tile_descriptors_size() const
tile_descr_const_iterator tile_descriptors_end() const
std::vector< TileDetDescriptor * > tile_descr_vec
std::map< unsigned int, CaloDetDescriptor *, std::less< unsigned int > > calo_descr_map
std::vector< CaloDetDescriptor * > calo_descr_vec
TileDddbManager * getDbManager() const
TileDetDescrManager(const TileDetDescrManager &right)
calo_descr_const_iterator tile_module_begin() const
void set_helper(const TileID *id)
const TileDetDescrManager & operator=(const TileDetDescrManager &right)
const CaloCell_ID * m_cell_id
tile_descr_vec m_tile_descr_vec
CaloDetDescriptor * get_module_element(const Identifier &module_id) const
const TileHWID * m_tile_hwid
void add_module(IdentifierHash idhash, CaloDetDescriptor *module)
calo_descr_const_iterator calo_descriptors_end() const
tile_region_vec_size tile_region_size() const
calo_element_vec m_tile_cell_vec
CaloDetDescrElement * get_cell_element(unsigned int cell_hash) const
void add(TileDetDescrRegion *region)
calo_descr_vec m_calo_descr_vec
CaloDetDescriptor * get_calo_descriptor(CaloCell_ID::CaloSample sample, int side) const
tile_region_vec m_tile_region_vec
TileDddbManager_ptr m_dbManager
std::vector< CaloDetDescrElement * > calo_element_vec
tile_descr_vec::const_iterator tile_descr_const_iterator
void add_cell(CaloDetDescrElement *cell)
calo_element_vec::size_type calo_element_vec_size
std::map< unsigned int, TileDetDescrRegion *, std::less< unsigned int > > tile_region_map
CaloDetDescrElement * get_cell_element(const Identifier &cell_id) const
void set_helper(const CaloCell_ID *id)
calo_descr_vec_size tile_module_size() const
void set_helper(const TileHWID *id)
calo_descr_vec_size calo_descriptors_size() const
tile_region_vec::const_iterator tile_region_const_iterator
static const double vBarrelCells[23]
std::map< unsigned int, CaloDetDescrElement *, std::less< unsigned int > > calo_element_map
std::vector< TileDetDescrRegion * > tile_region_vec
tile_region_const_iterator tile_region_end() const
static const double vItcGapCells[6]
calo_descr_vec::const_iterator calo_descr_const_iterator
calo_descr_const_iterator calo_descriptors_begin() const
static const double vExtendedCells[12]
TileDetDescrRegion * find_tile_region(const Identifier &region_id) const
const TileHWID * get_hwid() const
TileDetDescrManager(TileDddbManager_ptr dbManager)
Z-shift for ext.barrel introduced with Z-shift > 0, eta coordinate of the cell is shifted by Deta = t...
void addTreeTop(PVConstLink)
calo_descr_vec m_tile_module_vec
TileCellDim * get_cell_dim(const Identifier &cell_id) const
tile_descr_vec::size_type tile_descr_vec_size
std::map< unsigned int, TileCellDim *, std::less< unsigned int > > cell_dim_map
CaloDetDescrElement * get_cell_element(const IdentifierHash cell_hash) const
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
Helper class for TileCal offline identifiers.
Definition TileID.h:67