ATLAS Offline Software
TRT_DetectorManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRT_READOUTGEOMETRY_TRT_DETECTORMANAGER_H
6 #define TRT_READOUTGEOMETRY_TRT_DETECTORMANAGER_H
7 
13 
21 #include "GeoModelKernel/GeoVPhysVol.h"
22 #include "InDetIdentifier/TRT_ID.h"
23 #include "GeoModelKernel/GeoXF.h"
24 
26 
27 #include <map>
28 #include <set>
29 #include <string>
30 #include <vector>
31 
32 class Identifier;
33 class GeoAlignableTransform;
34 class GeoVAlignmentStore;
35 class StoreGateSvc;
37 
38 namespace InDetDD {
39 
40  class ExtendedAlignableTransform;
41  class TRT_BarrelDescriptor;
42  class TRT_EndcapDescriptor;
43  class TRT_Numerology;
44 
61  : public InDetDetectorManager,
62  public TRT_Conditions
63  {
64  public:
65 
66  // Constructor
68 
69  // Destructor
71 
73  virtual unsigned int getNumTreeTops() const override; //
74  virtual PVConstLink getTreeTop(unsigned int i) const override; //
75  //-----------------------------------------------------------------------------//
76 
78  void setIdHelper(const TRT_ID * idHelper, bool owns=true); //
79  //-----------------------------------------------------------------------------//
80 
81 
82  //** Get and set information about gasType. -----------------------------------*/
84  ActiveGasType gasType() const; //
85  void setGasType(const ActiveGasType &); //
86  //-----------------------------------------------------------------------------//
87 
90  const TRT_Numerology * getNumerology() const; //
91  //-----------------------------------------------------------------------------//
92 
93 
95  const TRT_BaseElement *getElement(Identifier id) const; // Slow //
96  const TRT_BaseElement *getElement(IdentifierHash id) const; // Fast //
97  //-----------------------------------------------------------------------------//
98 
101 
108 
109 
110  //-----------------------------------------------------------------------------//
111 
112 
114  const TRT_BarrelElement *getBarrelElement(unsigned int positive //
115  , unsigned int moduleIndex //
116  , unsigned int phiIndex //
117  , unsigned int strawLayerIndex) const;
118 
119  TRT_BarrelElement *getBarrelElement(unsigned int positive //
120  , unsigned int moduleIndex //
121  , unsigned int phiIndex //
122  , unsigned int strawLayerIndex); //
123  // //
124  //-----------------------------------------------------------------------------//
125 
126 
128  const TRT_EndcapElement *getEndcapElement(unsigned int positive //
129  , unsigned int wheelIndex //
130  , unsigned int strawLayerIndex //
131  , unsigned int phiIndex) const; //
132  TRT_EndcapElement *getEndcapElement(unsigned int positive //
133  , unsigned int wheelIndex //
134  , unsigned int strawLayerIndex //
135  , unsigned int phiIndex); //
136  // //
137  //------------------------------------------------------------------------------//
138 
140  const TRT_Conditions * conditions() const; //
141  //-----------------------------------------------------------------------------//
142 
143 
144  // This is for Detector Descriptors -------------------------------------------//
145  void addTreeTop(const PVLink&); //
146  // //
147  // Manage the barrel elements: //
148  void manageBarrelElement(TRT_BarrelElement *barrel); //
149  // //
150  // Manage the endcap elements: //
151  void manageEndcapElement(TRT_EndcapElement *endcap); //
152  // //
153  //-----------------------------------------------------------------------------//
154 
155  //-----------------------------------------------------------------------------//
156  // //
157  // Transform of straw relative to module. Stored as a tranformation field //
158  // to make this compact. Note , GeoXF::Function * is a pointer to a so- //
159  // called "TRANSFUNCTION". Functions are delete when the manager is deleted. //
160  // //
161  void setBarrelTransformField(size_t i, const GeoXF::Function *field); //
162  const GeoXF::Function *barrelTransformField(size_t i) const; //
163  void setEndcapTransformField(size_t i, const GeoXF::Function *field); //
164  const GeoXF::Function *endcapTransformField(size_t i) const; //
165  // //
166  //-----------------------------------------------------------------------------//
167 
168  // Alignment stuff
169  // DEPRECATED - kept for compatibilty with Lisbon CondDB
170  void addKey ATLAS_NOT_THREAD_SAFE (const std::string & key, int level);
171  // DEPRECATED use addChannel
172  void addKey(const std::string & key, int level, FrameType frame);
173 
174 
175 
177  void addAlignableTransform (int level,
178  const Identifier &id,
179  GeoAlignableTransform *transform,
180  const GeoVFullPhysVol * child = 0,
181  const GeoVFullPhysVol * frameVol = 0);
182 
184  void addAlignableTransform (int level,
185  const Identifier &id,
186  GeoAlignableTransform *transform,
187  const GeoVPhysVol * child = 0,
188  const GeoVPhysVol * frameVol = 0);
189 
191  virtual bool setAlignableTransformDelta(int level,
192  const Identifier & id,
193  const Amg::Transform3D & delta,
194  FrameType frame,
195  GeoVAlignmentStore* alignStore) const override;
196 
199  const Amg::Transform3D & delta,
200  FrameType frame,
201  GeoVAlignmentStore* alignStore) const;
202 
203 
205  virtual void invalidateAll() override;
206 
208  virtual void updateAll() const override;
209 
210 
212  virtual bool identifierBelongs(const Identifier & id) const override;
213 
216 
218  virtual
219  bool processGlobalAlignment(const std::string &, int level, FrameType frame,
221  GeoVAlignmentStore* alignStore) const override;
222 
223  bool processSpecialAlignment(const std::string & key, InDetDD::AlignFolderType dummy) override;
224 
225  bool processSpecialAlignment(const std::string& key,
226  const CondAttrListCollection* obj=nullptr,
227  GeoVAlignmentStore* alignStore=nullptr) const override;
228 
230  void setBarrelDescriptor(const TRT_BarrelDescriptor* barrelDescriptor);
231  void setEndcapDescriptor(const TRT_EndcapDescriptor* endcapDescriptor);
232 
233  private:
234 
235 
236  // Illegal operations:---------------------------------------------------------//
237  // //
240  // //
241  //-----------------------------------------------------------------------------//
242 
243 
244  // Private member data:--------------------------------------------------------//
245  std::vector<PVLink> m_volume; //
246  // //
248  // //
250  const TRT_ID *m_idHelper; //
251  bool m_ownsIdHelper; //
252  const GeoXF::Function *m_barrelXF[3]{}; //
253  const GeoXF::Function *m_endcapXF[3]{}; //
254  // //
256  unsigned int m_digvers; //
257  std::string m_digversname; //
258 
259  // Alignment stuff
260  typedef std::map<Identifier, ExtendedAlignableTransform *> AlignableTransformMap;
261  std::vector< AlignableTransformMap > m_alignableTransforms;
262 
263  // Descriptors are owned by TRT_DetectorManager.
264  std::set<const TRT_BarrelDescriptor*> m_barrelDescriptors;
265  std::set<const TRT_EndcapDescriptor*> m_endcapDescriptors;
266 
267  // here temporarily
268  virtual const TRT_ID *getIdHelper() const override; //
269 
270  //-----------------------------------------------------------------------------//
271  };
272 }
273 #ifndef GAUDI_NEUTRAL
274 #include "AthenaKernel/CLASS_DEF.h"
276 #endif
277 #endif
278 
279 
InDetDD::FrameType
FrameType
Definition: InDetDD_Defs.h:16
InDetDD::TRT_DetectorManager::invalidateAll
virtual void invalidateAll() override
Invalidate cache for all detector elements.
Definition: TRT_DetectorManager.cxx:427
InDetDD::TRT_DetectorManager::manageBarrelElement
void manageBarrelElement(TRT_BarrelElement *barrel)
Definition: TRT_DetectorManager.cxx:89
InDetDD::TRT_DetectorManager::conditions
const TRT_Conditions * conditions() const
Conditions interface (mostly for internal use):-------------------------—.
Definition: TRT_DetectorManager.cxx:486
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
InDetDD::TRT_DetectorManager::addAlignableTransform
void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *transform, const GeoVFullPhysVol *child=0, const GeoVFullPhysVol *frameVol=0)
Add alignable transforms: GeoModel/CLHEP based.
Definition: TRT_DetectorManager.cxx:273
InDetDD::TRT_BarrelElement
Definition: TRT_BarrelElement.h:43
InDetDD::TRT_DetectorManager::getDetectorElementCollection
const TRT_DetElementCollection * getDetectorElementCollection() const
Access to Whole Collection of Elements ---------------------------------—.
Definition: TRT_DetectorManager.cxx:167
InDetDD::TRT_DetectorManager::setEndcapDescriptor
void setEndcapDescriptor(const TRT_EndcapDescriptor *endcapDescriptor)
Definition: TRT_DetectorManager.cxx:568
TRT_DetElementCollection.h
InDetDD::TRT_DetectorManager::m_ownsIdHelper
bool m_ownsIdHelper
Definition: TRT_DetectorManager.h:251
InDetDD::TRT_DetectorManager::m_idHelper
const TRT_ID * m_idHelper
Definition: TRT_DetectorManager.h:250
InDetDD::TRT_DetElementContainer
Class to hold different TRT detector elements structures.
Definition: TRT_DetElementContainer.h:25
InDetDD::TRT_DetectorManager::getBarrelElement
const TRT_BarrelElement * getBarrelElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
Access Barrel Elements:---------------—(Fast)-------------------------—.
Definition: TRT_DetectorManager.cxx:100
TRT_DetElementContainer.h
InDetDD::TRT_DetectorManager::setBarrelTransformField
void setBarrelTransformField(size_t i, const GeoXF::Function *field)
Definition: TRT_DetectorManager.cxx:192
InDetDD::TRT_BarrelDescriptor
Definition: TRT_BarrelDescriptor.h:40
InDetDD::TRT_DetectorManager::m_barrelXF
const GeoXF::Function * m_barrelXF[3]
Definition: TRT_DetectorManager.h:252
InDetDD::TRT_DetectorManager::m_digversname
std::string m_digversname
Definition: TRT_DetectorManager.h:257
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
InDetDD::TRT_EndcapElement
Definition: TRT_EndcapElement.h:43
InDetDD::TRT_DetectorManager::setAlignableTransformDelta
virtual bool setAlignableTransformDelta(int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const override
Set alignable transforms: Amg based.
Definition: TRT_DetectorManager.cxx:304
InDetDD::TRT_DetectorManager::m_endcapDescriptors
std::set< const TRT_EndcapDescriptor * > m_endcapDescriptors
Definition: TRT_DetectorManager.h:265
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
InDetDD::TRT_DetectorManager::barrelTransformField
const GeoXF::Function * barrelTransformField(size_t i) const
Definition: TRT_DetectorManager.cxx:197
InDetDD::TRT_Conditions
Definition: TRT_Conditions.h:28
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:51
IOVSVC_CALLBACK_ARGS
#define IOVSVC_CALLBACK_ARGS
short hand for IOVSvc call back argument list, to be used when no access to formal arguments is neede...
Definition: IOVSvcDefs.h:24
InDetDD::TRT_DetectorManager::TRT_DetectorManager
TRT_DetectorManager(StoreGateSvc *detStore)
Definition: TRT_DetectorManager.cxx:26
InDetDD::TRT_DetectorManager::getIdHelper
virtual const TRT_ID * getIdHelper() const override
Definition: TRT_DetectorManager.cxx:132
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
InDetDD::TRT_EndcapDescriptor
class TRT_EndcapDescriptor
Definition: TRT_EndcapDescriptor.h:30
InDetDD::TRT_DetectorManager::TRT_DetectorManager
TRT_DetectorManager(const TRT_DetectorManager &right)
InDetDD::TRT_DetectorManager::addTreeTop
void addTreeTop(const PVLink &)
Definition: TRT_DetectorManager.cxx:84
InDetDD::TRT_DetectorManager::manageEndcapElement
void manageEndcapElement(TRT_EndcapElement *endcap)
Definition: TRT_DetectorManager.cxx:95
GeoPrimitives.h
TRT_EndcapElement.h
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:122
InDetDD::TRT_DetectorManager::getTreeTop
virtual PVConstLink getTreeTop(unsigned int i) const override
Definition: TRT_DetectorManager.cxx:79
InDetDD::TRT_DetectorManager::getNumerology
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
Definition: TRT_DetectorManager.cxx:43
InDetDD::TRT_DetectorManager::m_endcapXF
const GeoXF::Function * m_endcapXF[3]
Definition: TRT_DetectorManager.h:253
InDetDD::TRT_Numerology
Definition: TRT_Numerology.h:22
InDetDD::TRT_DetectorManager::ATLAS_NOT_THREAD_SAFE
void addKey ATLAS_NOT_THREAD_SAFE(const std::string &key, int level)
InDetDD_Defs.h
InDetDD::TRT_DetectorManager::endcapTransformField
const GeoXF::Function * endcapTransformField(size_t i) const
Definition: TRT_DetectorManager.cxx:206
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDetDD::TRT_DetectorManager::getNumTreeTops
virtual unsigned int getNumTreeTops() const override
Access Raw Geometry:----------------------------------------------------—.
Definition: TRT_DetectorManager.cxx:74
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDetDD::TRT_DetectorManager::m_digvers
unsigned int m_digvers
Definition: TRT_DetectorManager.h:256
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetDD::TRT_DetectorManager::m_alignableTransforms
std::vector< AlignableTransformMap > m_alignableTransforms
Definition: TRT_DetectorManager.h:261
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
InDetDD::TRT_DetectorManager::m_volume
std::vector< PVLink > m_volume
Definition: TRT_DetectorManager.h:245
InDetDD::InDetDetectorManager
Definition: InDetDetectorManager.h:60
InDetDD::TRT_DetectorManager::m_numerology
TRT_Numerology * m_numerology
Definition: TRT_DetectorManager.h:249
InDetDD::TRT_DetectorManager::setAlignableTransformAnyFrameDelta
bool setAlignableTransformAnyFrameDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const
Set alignable transforms: Amg based.
Definition: TRT_DetectorManager.cxx:328
TRT_BarrelElement.h
InDetDD::TRT_DetectorManager::m_elementContainer
TRT_DetElementContainer m_elementContainer
Definition: TRT_DetectorManager.h:247
InDetDD::TRT_DetectorManager::alignmentCallback
StatusCode alignmentCallback(IOVSVC_CALLBACK_ARGS)
Call back for alignment updates, DEPRECATED.
Definition: TRT_DetectorManager.cxx:420
InDetDD::TRT_DetectorManager::getDetectorElementBegin
TRT_DetElementCollection::const_iterator getDetectorElementBegin() const
Definition: TRT_DetectorManager.cxx:172
InDetDD::TRT_DetectorManager::getDetectorElementEnd
TRT_DetElementCollection::const_iterator getDetectorElementEnd() const
Definition: TRT_DetectorManager.cxx:177
InDetDD::TRT_DetectorManager::getEndcapElement
const TRT_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
Definition: TRT_DetectorManager.cxx:116
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::TRT_DetectorManager::identifierBelongs
virtual bool identifierBelongs(const Identifier &id) const override
Check identifier is for this detector.
Definition: TRT_DetectorManager.cxx:451
InDetDD::TRT_DetectorManager::processSpecialAlignment
bool processSpecialAlignment(const std::string &key, InDetDD::AlignFolderType dummy) override
Definition: TRT_DetectorManager.cxx:457
InDetDD::TRT_DetectorManager::setGasType
void setGasType(const ActiveGasType &)
Definition: TRT_DetectorManager.cxx:216
InDetDD::TRT_DetectorManager::getElement
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
Definition: TRT_DetectorManager.cxx:145
InDetDD::TRT_DetectorManager::m_barrelDescriptors
std::set< const TRT_BarrelDescriptor * > m_barrelDescriptors
Definition: TRT_DetectorManager.h:264
InDetDetectorManager.h
InDetDD::ExtendedAlignableTransform
Definition: ExtendedAlignableTransform.h:31
InDetDD::TRT_DetectorManager::setIdHelper
void setIdHelper(const TRT_ID *idHelper, bool owns=true)
Get the ID helper: -----------------------------------------------------—.
Definition: TRT_DetectorManager.cxx:137
InDetDD::TRT_DetectorManager::getDetectorElementContainer
const TRT_DetElementContainer * getDetectorElementContainer() const
Access the element container -------------------------------------------—.
Definition: TRT_DetectorManager.cxx:162
InDetDD::TRT_DetectorManager::oldgas
@ oldgas
Definition: TRT_DetectorManager.h:83
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
TRT_ID
Definition: TRT_ID.h:82
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition: TRT_DetectorManager.h:63
InDetDD::TRT_DetectorManager::addKey
void addKey(const std::string &key, int level, FrameType frame)
Definition: TRT_DetectorManager.cxx:237
InDetDD::TRT_DetectorManager::m_gasType
ActiveGasType m_gasType
Definition: TRT_DetectorManager.h:255
InDetDD::TRT_DetectorManager::newgas
@ newgas
Definition: TRT_DetectorManager.h:83
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::TRT_DetectorManager::unknown
@ unknown
Definition: TRT_DetectorManager.h:83
InDetDD::TRT_DetectorManager::gasType
ActiveGasType gasType() const
Definition: TRT_DetectorManager.cxx:211
InDetDD::TRT_DetectorManager::~TRT_DetectorManager
~TRT_DetectorManager()
Definition: TRT_DetectorManager.cxx:51
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:67
InDetDD::TRT_DetectorManager::setEndcapTransformField
void setEndcapTransformField(size_t i, const GeoXF::Function *field)
Definition: TRT_DetectorManager.cxx:201
InDetDD::TRT_DetectorManager::updateAll
virtual void updateAll() const override
Update all caches.
Definition: TRT_DetectorManager.cxx:438
InDetDD::TRT_DetectorManager::ActiveGasType
ActiveGasType
Definition: TRT_DetectorManager.h:83
InDetDD::TRT_DetElementCollection
Class to hold collection of TRT detector elements.
Definition: TRT_DetElementCollection.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
checker_macros.h
Define macros for attributes used to control the static checker.
python.PyAthena.obj
obj
Definition: PyAthena.py:132
TRT_Conditions.h
CLASS_DEF.h
macros to associate a CLID to a type
InDetDD::TRT_DetectorManager::AlignableTransformMap
std::map< Identifier, ExtendedAlignableTransform * > AlignableTransformMap
Definition: TRT_DetectorManager.h:260
InDetDD::AlignFolderType
AlignFolderType
Definition: InDetDD_Defs.h:19
InDetDD::TRT_DetectorManager::processGlobalAlignment
virtual bool processGlobalAlignment(const std::string &, int level, FrameType frame, const CondAttrListCollection *obj, GeoVAlignmentStore *alignStore) const override
Process new global DB folders for L1 and L2.
Definition: TRT_DetectorManager.cxx:492
InDetDD::TRT_DetectorManager::setBarrelDescriptor
void setBarrelDescriptor(const TRT_BarrelDescriptor *barrelDescriptor)
Set TRT_Barrel/EndcapDescriptor pointer to the internal sets to delete them in the destructor.
Definition: TRT_DetectorManager.cxx:563
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:52
InDetDD::TRT_DetectorManager::operator=
const TRT_DetectorManager & operator=(const TRT_DetectorManager &right)
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14