ATLAS Offline Software
TRT_DetectorManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
22 #include "GeoModelKernel/GeoVPhysVol.h"
23 #include "InDetIdentifier/TRT_ID.h"
24 #include "GeoModelKernel/GeoXF.h"
25 #include "AthenaKernel/IIOVSvc.h"
27 
28 #include "CLHEP/Geometry/Transform3D.h"
29 
31 
32 #include <map>
33 #include <memory>
34 #include <set>
35 #include <string>
36 #include <vector>
37 
38 class Identifier;
39 class GeoAlignableTransform;
40 class GeoVAlignmentStore;
41 class StoreGateSvc;
43 
44 namespace InDetDD {
45 
46  class ExtendedAlignableTransform;
47  class TRT_BarrelDescriptor;
48  class TRT_EndcapDescriptor;
49  class TRT_Numerology;
50 
67  : public InDetDetectorManager,
68  public TRT_Conditions
69  {
70  public:
71 
72  // Constructor
74 
75  // Destructor
77 
79  virtual unsigned int getNumTreeTops() const override; //
80  virtual PVConstLink getTreeTop(unsigned int i) const override; //
81  //-----------------------------------------------------------------------------//
82 
84  void setIdHelper(const TRT_ID * idHelper, bool owns=true); //
85  //-----------------------------------------------------------------------------//
86 
87 
88  //** Get and set information about gasType. -----------------------------------*/
90  ActiveGasType gasType() const; //
91  void setGasType(const ActiveGasType &); //
92  //-----------------------------------------------------------------------------//
93 
95  unsigned int digitizationVersion() const; //
96  std::string digitizationVersionName() const; //
97  void setDigitizationVersion(const unsigned int &, const std::string& name ); //
98  //-----------------------------------------------------------------------------//
99 
102  const TRT_Numerology * getNumerology() const; //
103  //-----------------------------------------------------------------------------//
104 
105 
107  const TRT_BaseElement *getElement(Identifier id) const; // Slow //
108  const TRT_BaseElement *getElement(IdentifierHash id) const; // Fast //
109  //-----------------------------------------------------------------------------//
110 
113 
116  TRT_DetElementCollection::const_iterator getDetectorElementBegin() const;
117  TRT_DetElementCollection::const_iterator getDetectorElementEnd() const;
118 
119  //-----------------------------------------------------------------------------//
120 
121 
123  const TRT_BarrelElement *getBarrelElement(unsigned int positive //
124  , unsigned int moduleIndex //
125  , unsigned int phiIndex //
126  , unsigned int strawLayerIndex) const;
127 
128  TRT_BarrelElement *getBarrelElement(unsigned int positive //
129  , unsigned int moduleIndex //
130  , unsigned int phiIndex //
131  , unsigned int strawLayerIndex); //
132  // //
133  //-----------------------------------------------------------------------------//
134 
135 
137  const TRT_EndcapElement *getEndcapElement(unsigned int positive //
138  , unsigned int wheelIndex //
139  , unsigned int strawLayerIndex //
140  , unsigned int phiIndex) const; //
141  TRT_EndcapElement *getEndcapElement(unsigned int positive //
142  , unsigned int wheelIndex //
143  , unsigned int strawLayerIndex //
144  , unsigned int phiIndex); //
145  // //
146  //------------------------------------------------------------------------------//
147 
149  const TRT_Conditions * conditions() const; //
150  //-----------------------------------------------------------------------------//
151 
152 
153  // This is for Detector Descriptors -------------------------------------------//
154  void addTreeTop(PVLink); //
155  // //
156  // Manage the barrel elements: //
157  void manageBarrelElement(TRT_BarrelElement *barrel); //
158  // //
159  // Manage the endcap elements: //
160  void manageEndcapElement(TRT_EndcapElement *endcap); //
161  // //
162  //-----------------------------------------------------------------------------//
163 
164  //-----------------------------------------------------------------------------//
165  // //
166  // Transform of straw relative to module. Stored as a tranformation field //
167  // to make this compact. Note , GeoXF::Function * is a pointer to a so- //
168  // called "TRANSFUNCTION". Functions are delete when the manager is deleted. //
169  // //
170  void setBarrelTransformField(size_t i, const GeoXF::Function *field); //
171  const GeoXF::Function *barrelTransformField(size_t i) const; //
172  void setEndcapTransformField(size_t i, const GeoXF::Function *field); //
173  const GeoXF::Function *endcapTransformField(size_t i) const; //
174  // //
175  //-----------------------------------------------------------------------------//
176 
177  // Alignment stuff
178  // DEPRECATED - kept for compatibilty with Lisbon CondDB
179  void addKey ATLAS_NOT_THREAD_SAFE (const std::string & key, int level);
180  // DEPRECATED use addChannel
181  void addKey(const std::string & key, int level, FrameType frame);
182 
183 
184 
186  void addAlignableTransform (int level,
187  const Identifier &id,
188  GeoAlignableTransform *transform,
189  const GeoVFullPhysVol * child = 0,
190  const GeoVFullPhysVol * frameVol = 0);
191 
193  void addAlignableTransform (int level,
194  const Identifier &id,
195  GeoAlignableTransform *transform,
196  const GeoVPhysVol * child = 0,
197  const GeoVPhysVol * frameVol = 0);
198 
200  virtual bool setAlignableTransformDelta(int level,
201  const Identifier & id,
202  const Amg::Transform3D & delta,
203  FrameType frame,
204  GeoVAlignmentStore* alignStore) const override;
205 
208  const Amg::Transform3D & delta,
209  FrameType frame,
210  GeoVAlignmentStore* alignStore) const;
211 
212 
214  virtual void invalidateAll() const override;
215 
217  virtual void updateAll() const override;
218 
219 
221  virtual bool identifierBelongs(const Identifier & id) const override;
222 
225 
227  virtual
228  bool processGlobalAlignment(const std::string &, int level, FrameType frame,
230  GeoVAlignmentStore* alignStore) const override;
231 
232  bool processSpecialAlignment(const std::string & key, InDetDD::AlignFolderType dummy) const override;
233 
234  bool processSpecialAlignment(const std::string& key,
235  const CondAttrListCollection* obj=nullptr,
236  GeoVAlignmentStore* alignStore=nullptr) const override;
237 
239  void setBarrelDescriptor(const TRT_BarrelDescriptor* barrelDescriptor);
240  void setEndcapDescriptor(const TRT_EndcapDescriptor* endcapDescriptor);
241 
242  private:
243 
244 
245  // Illegal operations:---------------------------------------------------------//
246  // //
249  // //
250  //-----------------------------------------------------------------------------//
251 
252 
253  // Private member data:--------------------------------------------------------//
254  std::vector<PVLink> m_volume; //
255  // //
257  // //
259  const TRT_ID *m_idHelper; //
260  bool m_ownsIdHelper; //
261  const GeoXF::Function *m_barrelXF[3]{}; //
262  const GeoXF::Function *m_endcapXF[3]{}; //
263  // //
265  unsigned int m_digvers; //
266  std::string m_digversname; //
267 
268  // Alignment stuff
269  typedef std::map<Identifier, ExtendedAlignableTransform *> AlignableTransformMap;
270  std::vector< AlignableTransformMap > m_alignableTransforms;
271 
272  // Descriptors are owned by TRT_DetectorManager.
273  std::set<const TRT_BarrelDescriptor*> m_barrelDescriptors;
274  std::set<const TRT_EndcapDescriptor*> m_endcapDescriptors;
275 
276  // here temporarily
277  virtual const TRT_ID *getIdHelper() const override; //
278 
279  //-----------------------------------------------------------------------------//
280  };
281 }
282 #ifndef GAUDI_NEUTRAL
283 #include "AthenaKernel/CLASS_DEF.h"
285 #endif
286 #endif
287 
288 
InDetDD::FrameType
FrameType
Definition: InDetDD_Defs.h:16
InDetDD::TRT_DetectorManager::manageBarrelElement
void manageBarrelElement(TRT_BarrelElement *barrel)
Definition: TRT_DetectorManager.cxx:102
InDetDD::TRT_DetectorManager::conditions
const TRT_Conditions * conditions() const
Conditions interface (mostly for internal use):-------------------------—.
Definition: TRT_DetectorManager.cxx:519
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:292
InDetDD::TRT_BarrelElement
Definition: TRT_BarrelElement.h:44
InDetDD::TRT_DetectorManager::getDetectorElementCollection
const TRT_DetElementCollection * getDetectorElementCollection() const
Access to Whole Collection of Elements ---------------------------------—.
Definition: TRT_DetectorManager.cxx:180
InDetDD::TRT_DetectorManager::setEndcapDescriptor
void setEndcapDescriptor(const TRT_EndcapDescriptor *endcapDescriptor)
Definition: TRT_DetectorManager.cxx:601
AthMsgStreamMacros.h
TRT_DetElementCollection.h
InDetDD::TRT_DetectorManager::m_ownsIdHelper
bool m_ownsIdHelper
Definition: TRT_DetectorManager.h:260
InDetDD::TRT_DetectorManager::m_idHelper
const TRT_ID * m_idHelper
Definition: TRT_DetectorManager.h:259
InDetDD::TRT_DetectorManager::invalidateAll
virtual void invalidateAll() const override
Invalidate cache for all detector elements.
Definition: TRT_DetectorManager.cxx:446
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:113
TRT_DetElementContainer.h
InDetDD::TRT_DetectorManager::setBarrelTransformField
void setBarrelTransformField(size_t i, const GeoXF::Function *field)
Definition: TRT_DetectorManager.cxx:196
InDetDD::TRT_BarrelDescriptor
Definition: TRT_BarrelDescriptor.h:40
InDetDD::TRT_DetectorManager::m_barrelXF
const GeoXF::Function * m_barrelXF[3]
Definition: TRT_DetectorManager.h:261
InDetDD::TRT_DetectorManager::m_digversname
std::string m_digversname
Definition: TRT_DetectorManager.h:266
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:44
InDetDD::TRT_DetectorManager::processSpecialAlignment
bool processSpecialAlignment(const std::string &key, InDetDD::AlignFolderType dummy) const override
Definition: TRT_DetectorManager.cxx:477
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:323
InDetDD::TRT_DetectorManager::m_endcapDescriptors
std::set< const TRT_EndcapDescriptor * > m_endcapDescriptors
Definition: TRT_DetectorManager.h:274
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
InDetDD::TRT_DetectorManager::barrelTransformField
const GeoXF::Function * barrelTransformField(size_t i) const
Definition: TRT_DetectorManager.cxx:201
InDetDD::TRT_Conditions
Definition: TRT_Conditions.h:30
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
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::getIdHelper
virtual const TRT_ID * getIdHelper() const override
Definition: TRT_DetectorManager.cxx:145
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::manageEndcapElement
void manageEndcapElement(TRT_EndcapElement *endcap)
Definition: TRT_DetectorManager.cxx:108
Version.h
GeoPrimitives.h
InDetDD::TRT_DetectorManager::TRT_DetectorManager
TRT_DetectorManager(StoreGateSvc *detStore=0)
Definition: TRT_DetectorManager.cxx:33
TRT_EndcapElement.h
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
InDetDD::TRT_DetectorManager::getTreeTop
virtual PVConstLink getTreeTop(unsigned int i) const override
Definition: TRT_DetectorManager.cxx:92
InDetDD::TRT_DetectorManager::getNumerology
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
Definition: TRT_DetectorManager.cxx:56
InDetDD::TRT_DetectorManager::m_endcapXF
const GeoXF::Function * m_endcapXF[3]
Definition: TRT_DetectorManager.h:262
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:210
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
InDetDD::TRT_DetectorManager::getNumTreeTops
virtual unsigned int getNumTreeTops() const override
Access Raw Geometry:----------------------------------------------------—.
Definition: TRT_DetectorManager.cxx:87
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:265
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetDD::TRT_DetectorManager::m_alignableTransforms
std::vector< AlignableTransformMap > m_alignableTransforms
Definition: TRT_DetectorManager.h:270
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
InDetDD::TRT_DetectorManager::m_volume
std::vector< PVLink > m_volume
Definition: TRT_DetectorManager.h:254
InDetDD::InDetDetectorManager
Definition: InDetDetectorManager.h:60
python.xAODType.dummy
dummy
Definition: xAODType.py:4
InDetDD::TRT_DetectorManager::m_numerology
TRT_Numerology * m_numerology
Definition: TRT_DetectorManager.h:258
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:347
TRT_BarrelElement.h
InDetDD::TRT_DetectorManager::m_elementContainer
TRT_DetElementContainer m_elementContainer
Definition: TRT_DetectorManager.h:256
InDetDD::TRT_DetectorManager::alignmentCallback
StatusCode alignmentCallback(IOVSVC_CALLBACK_ARGS)
Call back for alignment updates, DEPRECATED.
Definition: TRT_DetectorManager.cxx:439
InDetDD::TRT_DetectorManager::getDetectorElementBegin
TRT_DetElementCollection::const_iterator getDetectorElementBegin() const
Definition: TRT_DetectorManager.cxx:185
InDetDD::TRT_DetectorManager::getDetectorElementEnd
TRT_DetElementCollection::const_iterator getDetectorElementEnd() const
Definition: TRT_DetectorManager.cxx:190
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:129
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::TRT_DetectorManager::digitizationVersionName
std::string digitizationVersionName() const
Definition: TRT_DetectorManager.cxx:230
InDetDD::TRT_DetectorManager::identifierBelongs
virtual bool identifierBelongs(const Identifier &id) const override
Check identifier is for this detector.
Definition: TRT_DetectorManager.cxx:471
InDetDD::TRT_DetectorManager::setGasType
void setGasType(const ActiveGasType &)
Definition: TRT_DetectorManager.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
InDetDD::TRT_DetectorManager::getElement
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
Definition: TRT_DetectorManager.cxx:158
InDetDD::TRT_DetectorManager::m_barrelDescriptors
std::set< const TRT_BarrelDescriptor * > m_barrelDescriptors
Definition: TRT_DetectorManager.h:273
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:150
IIOVSvc.h
InDetDD::TRT_DetectorManager::getDetectorElementContainer
const TRT_DetElementContainer * getDetectorElementContainer() const
Access the element container -------------------------------------------—.
Definition: TRT_DetectorManager.cxx:175
InDetDD::TRT_DetectorManager::oldgas
@ oldgas
Definition: TRT_DetectorManager.h:89
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:84
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition: TRT_DetectorManager.h:69
InDetDD::TRT_DetectorManager::addKey
void addKey(const std::string &key, int level, FrameType frame)
Definition: TRT_DetectorManager.cxx:256
InDetDD::TRT_DetectorManager::m_gasType
ActiveGasType m_gasType
Definition: TRT_DetectorManager.h:264
InDetDD::TRT_DetectorManager::newgas
@ newgas
Definition: TRT_DetectorManager.h:89
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::TRT_DetectorManager::unknown
@ unknown
Definition: TRT_DetectorManager.h:89
InDetDD::TRT_DetectorManager::gasType
ActiveGasType gasType() const
Definition: TRT_DetectorManager.cxx:215
InDetDD::TRT_DetectorManager::~TRT_DetectorManager
~TRT_DetectorManager()
Definition: TRT_DetectorManager.cxx:64
InDetDD::TRT_DetectorManager::digitizationVersion
unsigned int digitizationVersion() const
Get and set information about digitization version ---------------------—.
Definition: TRT_DetectorManager.cxx:225
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
InDetDD::TRT_DetectorManager::setEndcapTransformField
void setEndcapTransformField(size_t i, const GeoXF::Function *field)
Definition: TRT_DetectorManager.cxx:205
InDetDD::TRT_DetectorManager::updateAll
virtual void updateAll() const override
Update all caches.
Definition: TRT_DetectorManager.cxx:458
InDetDD::TRT_DetectorManager::setDigitizationVersion
void setDigitizationVersion(const unsigned int &, const std::string &name)
Definition: TRT_DetectorManager.cxx:235
InDetDD::TRT_DetectorManager::ActiveGasType
ActiveGasType
Definition: TRT_DetectorManager.h:89
InDetDD::TRT_DetectorManager::addTreeTop
void addTreeTop(PVLink)
Definition: TRT_DetectorManager.cxx:97
InDetDD::TRT_DetElementCollection
Class to hold collection of TRT detector elements.
Definition: TRT_DetElementCollection.h:28
IdentifierHash
Definition: IdentifierHash.h:38
checker_macros.h
Define macros for attributes used to control the static checker.
python.PyAthena.obj
obj
Definition: PyAthena.py:135
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:269
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:525
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:596
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57
InDetDD::TRT_DetectorManager::operator=
const TRT_DetectorManager & operator=(const TRT_DetectorManager &right)
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37