ATLAS Offline Software
Loading...
Searching...
No Matches
InDetDD::TRT_DetectorManager Class Reference

The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements which can be retrieved from the TRT_DetectorManager either via numerology or Identifier access. More...

#include <TRT_DetectorManager.h>

Inheritance diagram for InDetDD::TRT_DetectorManager:

Public Types

enum  ActiveGasType { unknown , oldgas , newgas }

Public Member Functions

 TRT_DetectorManager (StoreGateSvc *detStore)
 ~TRT_DetectorManager ()
virtual unsigned int getNumTreeTops () const override
 Access Raw Geometry:----------------------------------------------------—.
virtual PVConstLink getTreeTop (unsigned int i) const override
void setIdHelper (const TRT_ID *idHelper, bool owns=true)
 Get the ID helper: -----------------------------------------------------—.
ActiveGasType gasType () const
void setGasType (const ActiveGasType &)
TRT_NumerologygetNumerology ()
 Access Numerological information:---------------------------------------—.
const TRT_NumerologygetNumerology () const
const TRT_BaseElementgetElement (Identifier id) const
 Access Elements Generically---------------------------------------------—.
const TRT_BaseElementgetElement (IdentifierHash id) const
const TRT_DetElementContainergetDetectorElementContainer () const
 Access the element container -------------------------------------------—.
const TRT_DetElementCollectiongetDetectorElementCollection () const
 Access to Whole Collection of Elements ---------------------------------—.
TRT_DetElementCollection::const_iterator getDetectorElementBegin () const
TRT_DetElementCollection::const_iterator getDetectorElementEnd () const
TRT_DetElementCollection::iterator getDetectorElementBegin ()
TRT_DetElementCollection::iterator getDetectorElementEnd ()
const TRT_BarrelElementgetBarrelElement (unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
 Access Barrel Elements:---------------—(Fast)-------------------------—.
TRT_BarrelElementgetBarrelElement (unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex)
const TRT_EndcapElementgetEndcapElement (unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
 Access Endcap Elements:---------------—(Fast)--------------------------—.
TRT_EndcapElementgetEndcapElement (unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex)
const TRT_Conditionsconditions () const
 Conditions interface (mostly for internal use):-------------------------—.
void addTreeTop (const PVLink &)
void manageBarrelElement (TRT_BarrelElement *barrel)
void manageEndcapElement (TRT_EndcapElement *endcap)
void setBarrelTransformField (size_t i, const GeoXF::Function *field)
const GeoXF::Function * barrelTransformField (size_t i) const
void setEndcapTransformField (size_t i, const GeoXF::Function *field)
const GeoXF::Function * endcapTransformField (size_t i) const
void addAlignableTransform (int level, const Identifier &id, GeoAlignableTransform *transform, const GeoVFullPhysVol *child=0, const GeoVFullPhysVol *frameVol=0)
 Add alignable transforms: GeoModel/CLHEP based.
void addAlignableTransform (int level, const Identifier &id, GeoAlignableTransform *transform, const GeoVPhysVol *child=0, const GeoVPhysVol *frameVol=0)
 Add alignable transforms: GeoModel/CLHEP based.
virtual bool setAlignableTransformDelta (int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const override
 Set alignable transforms: Amg based.
bool setAlignableTransformAnyFrameDelta (ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const
 Set alignable transforms: Amg based.
virtual void invalidateAll () override
 Invalidate cache for all detector elements.
virtual void updateAll () const override
 Update all caches.
virtual bool identifierBelongs (const Identifier &id) const override
 Check identifier is for this detector.
StatusCode alignmentCallback ()
 Call back for alignment updates, DEPRECATED.
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.
bool processSpecialAlignment (const std::string &key, InDetDD::AlignFolderType dummy) override
bool processSpecialAlignment (const std::string &key, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const override
void setBarrelDescriptor (const TRT_BarrelDescriptor *barrelDescriptor)
 Set TRT_Barrel/EndcapDescriptor pointer to the internal sets to delete them in the destructor.
void setEndcapDescriptor (const TRT_EndcapDescriptor *endcapDescriptor)
const VersiongetVersion () const
 Get version information.
const std::string & getLayout () const
void setVersion (const Version &version)
void addChannel (const std::string &key, int level, FrameType frame)
 Alignment access.
void addFolder (const std::string &key)
void addSpecialFolder (const std::string &key)
void addGlobalFolder (const std::string &key)
void addAlignFolderType (const AlignFolderType alignfolder)
StatusCode align ()
StatusCode align (const RawAlignmentObjects &alignObjects, GeoVAlignmentStore *alignStore) const
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.
const TRTCond::StrawDxContainerdxContainer () const

Public Attributes

AlignFolderType m_alignfoldertype

Protected Member Functions

void setDxContainer (const TRTCond::StrawDxContainer *container)

Protected Attributes

StoreGateSvcm_detStore
std::atomic_bool m_suppressWarnings

Private Types

typedef std::map< Identifier, ExtendedAlignableTransform * > AlignableTransformMap

Private Member Functions

const TRT_DetectorManageroperator= (const TRT_DetectorManager &right)
 TRT_DetectorManager (const TRT_DetectorManager &right)
virtual const TRT_IDgetIdHelper () const override
const LevelInfogetLevel (const std::string &key) const
 Retrieve level information.
bool processAlignmentContainer (const std::string &key) const
 return align folder string to use
bool processAlignmentContainer (const AlignableTransformContainer *container, GeoVAlignmentStore *alignStore) const
bool processKey (const std::string &key, const AlignableTransform *transformCollection, GeoVAlignmentStore *alignStore=nullptr) const
 Called by processAlignmentContainer, applies only one key on the transform Collections.
bool processGlobalAlignmentContainer (const std::string &key, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::vector< PVLink > m_volume
TRT_DetElementContainer m_elementContainer
TRT_Numerologym_numerology
const TRT_IDm_idHelper
bool m_ownsIdHelper
const GeoXF::Function * m_barrelXF [3] {}
const GeoXF::Function * m_endcapXF [3] {}
ActiveGasType m_gasType
unsigned int m_digvers
std::string m_digversname
std::vector< AlignableTransformMapm_alignableTransforms
std::set< const TRT_BarrelDescriptor * > m_barrelDescriptors
std::set< const TRT_EndcapDescriptor * > m_endcapDescriptors
Version m_version
std::map< std::string, LevelInfom_keys
std::set< std::string > m_folders
std::set< std::string > m_specialFolders
std::set< std::string > m_globalFolders
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)
const TRTCond::StrawDxContainerm_dxContainer

Static Private Attributes

static const LevelInfo s_invalidLevel

Detailed Description

The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements which can be retrieved from the TRT_DetectorManager either via numerology or Identifier access.

In addition, the alignable transforms are set via Identifer and forwarded to the GeoModel class; hence, we are sitting at the interface between CLHEP and AMG.

Author
Grant Gorfine modified & maintined: Nick Styles, Andreas Salzburger

Definition at line 60 of file TRT_DetectorManager.h.

Member Typedef Documentation

◆ AlignableTransformMap

Member Enumeration Documentation

◆ ActiveGasType

Constructor & Destructor Documentation

◆ TRT_DetectorManager() [1/2]

InDetDD::TRT_DetectorManager::TRT_DetectorManager ( StoreGateSvc * detStore)

Definition at line 26 of file TRT_DetectorManager.cxx.

27 :InDetDetectorManager(detStore, "TRT"),
28 m_numerology(new TRT_Numerology()),
29 m_idHelper(nullptr),
30 m_ownsIdHelper(false),
32 m_digvers(9999),
33 m_digversname("ERROR:DIGVERSNOTSET!")
34 {
35 m_elementContainer.setNumerology(m_numerology);
36
37 m_barrelXF[0]=m_barrelXF[1]=m_barrelXF[2]=nullptr;
38 m_endcapXF[0]=m_endcapXF[1]=m_endcapXF[2]=nullptr;
39 }
InDetDetectorManager(StoreGateSvc *detStore, const std::string &name)
const GeoXF::Function * m_barrelXF[3]
TRT_DetElementContainer m_elementContainer
const GeoXF::Function * m_endcapXF[3]

◆ ~TRT_DetectorManager()

InDetDD::TRT_DetectorManager::~TRT_DetectorManager ( )

Definition at line 51 of file TRT_DetectorManager.cxx.

52 {
53 delete m_numerology;
54 if (m_ownsIdHelper) delete m_idHelper;
55 for (auto & i : m_barrelXF) delete i;
56 for (auto & i : m_endcapXF) delete i;
57
58
59 for (auto & m : m_alignableTransforms) {
60 for (auto & j : m) {
61 delete j.second;
62 }
63 }
64
65 for (const TRT_BarrelDescriptor* barrelDescriptor : m_barrelDescriptors) {
66 delete barrelDescriptor;
67 }
68 for (const TRT_EndcapDescriptor* endcapDescriptor : m_endcapDescriptors) {
69 delete endcapDescriptor;
70 }
71 }
std::set< const TRT_BarrelDescriptor * > m_barrelDescriptors
std::vector< AlignableTransformMap > m_alignableTransforms
std::set< const TRT_EndcapDescriptor * > m_endcapDescriptors

◆ TRT_DetectorManager() [2/2]

InDetDD::TRT_DetectorManager::TRT_DetectorManager ( const TRT_DetectorManager & right)
private

Member Function Documentation

◆ addAlignableTransform() [1/2]

void InDetDD::TRT_DetectorManager::addAlignableTransform ( int level,
const Identifier & id,
GeoAlignableTransform * transform,
const GeoVFullPhysVol * child = 0,
const GeoVFullPhysVol * frameVol = 0 )

Add alignable transforms: GeoModel/CLHEP based.

Definition at line 252 of file TRT_DetectorManager.cxx.

257 {
258 if (m_idHelper) {
259 if (level == 0) {
260 // Nothing implemented. Reserved in case we want alignable straws.
261 } else {
262
263 ExtendedAlignableTransform * extAlignableTransform = new ExtendedAlignableTransform(transform, child, frameVol);
264 if(msgLvl(MSG::VERBOSE)) {
265 msg(MSG::VERBOSE) << "TRT: Adding alignment at level " << level << " " << m_idHelper->show_to_string(id);
266 if (child && !frameVol) {
267 msg(MSG::VERBOSE) << " using global frame";
268 } else if (!child || child == frameVol ) {
269 msg(MSG::VERBOSE) << " using local frame";
270 } else {
271 msg(MSG::VERBOSE) << " using other frame";
272 }
273 msg(MSG::VERBOSE) << endmsg;
274 }
275 // Save in map
276 int index = level - FIRST_HIGHER_LEVEL; // level 0 treated separately.
277 if (index >= static_cast<int>(m_alignableTransforms.size())) m_alignableTransforms.resize(index+1);
278 m_alignableTransforms[index][id] = extAlignableTransform;
279 }
280 }
281 }
#define endmsg
MsgStream & msg() const
The standard message stream.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
str index
Definition DeMoScan.py:362
const int FIRST_HIGHER_LEVEL

◆ addAlignableTransform() [2/2]

void InDetDD::TRT_DetectorManager::addAlignableTransform ( int level,
const Identifier & id,
GeoAlignableTransform * transform,
const GeoVPhysVol * child = 0,
const GeoVPhysVol * frameVol = 0 )

Add alignable transforms: GeoModel/CLHEP based.

Definition at line 221 of file TRT_DetectorManager.cxx.

226 {
227 if (m_idHelper) {
228 // Check if child and frame are actually full physical volumes.
229 // if they are non zero.
230 const GeoVFullPhysVol * childFPV = nullptr;
231 if (child) {
232 childFPV = dynamic_cast<const GeoVFullPhysVol *>(child);
233 }
234 const GeoVFullPhysVol * frameFPV = nullptr;
235 if (frameVol) {
236 frameFPV = dynamic_cast<const GeoVFullPhysVol *>(frameVol);
237 }
238 if (child && !childFPV) {
239 msg(MSG::ERROR)
240 << "Child of alignable transform is not a full physical volume"
241 << endmsg;
242 } else if (frameVol && !frameFPV) {
243 msg(MSG::ERROR)
244 << "Frame for alignable transform is not a full physical volume"
245 << endmsg;
246 } else {
247 addAlignableTransform (level, id, transform, childFPV, frameFPV);
248 }
249 }
250 }
void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *transform, const GeoVFullPhysVol *child=0, const GeoVFullPhysVol *frameVol=0)
Add alignable transforms: GeoModel/CLHEP based.

◆ addAlignFolderType()

void InDetDD::InDetDetectorManager::addAlignFolderType ( const AlignFolderType alignfolder)
inherited

Definition at line 81 of file InDetDetectorManager.cxx.

82 {
83 m_alignfoldertype = alignfolder;
84 }

◆ addChannel()

void InDetDD::InDetDetectorManager::addChannel ( const std::string & key,
int level,
FrameType frame )
inherited

Alignment access.

Definition at line 56 of file InDetDetectorManager.cxx.

57 {
58 std::string frameStr = "other";
59 if (frame == InDetDD::global) frameStr = "global";
60 if (frame == InDetDD::local) frameStr = "local";
61 ATH_MSG_INFO("Registering alignment channel with key " << key << ", level " << level
62 << ", with frame " << frameStr << ".");
63 m_keys[key] = LevelInfo(level, frame);
64 }
#define ATH_MSG_INFO(x)
std::map< std::string, LevelInfo > m_keys

◆ addFolder()

void InDetDD::InDetDetectorManager::addFolder ( const std::string & key)
inherited

Definition at line 66 of file InDetDetectorManager.cxx.

67 {
68 m_folders.insert(key);
69 }
std::set< std::string > m_folders

◆ addGlobalFolder()

void InDetDD::InDetDetectorManager::addGlobalFolder ( const std::string & key)
inherited

Definition at line 76 of file InDetDetectorManager.cxx.

77 {
78 m_globalFolders.insert(key);
79 }
std::set< std::string > m_globalFolders

◆ addSpecialFolder()

void InDetDD::InDetDetectorManager::addSpecialFolder ( const std::string & key)
inherited

Definition at line 71 of file InDetDetectorManager.cxx.

72 {
73 m_specialFolders.insert(key);
74 }
std::set< std::string > m_specialFolders

◆ addTreeTop()

void InDetDD::TRT_DetectorManager::addTreeTop ( const PVLink & vol)

Definition at line 84 of file TRT_DetectorManager.cxx.

84 {
85 m_volume.push_back(vol);
86 }

◆ align() [1/2]

StatusCode InDetDD::InDetDetectorManager::align ( )
inherited

Definition at line 95 of file InDetDetectorManager.cxx.

96 {
97 ATH_MSG_DEBUG("align() called ");
98
99 if (!getIdHelper()) return StatusCode::SUCCESS;
100
101 bool alignmentChange = false;
102 const AlignInfo &aligninfo = AlignInfo(m_alignfoldertype);
103
104 // New global aligment folders should be processed first
105 for (const auto & globalFolder : m_globalFolders) {
106
107 try {
108 bool status = processGlobalAlignmentContainer(globalFolder);
109 alignmentChange = (alignmentChange || status);
110 } catch(std::runtime_error& err) {
111 // keys are empty when running simualtion. It is normal for detector specific aligments not to exist.
112 ATH_MSG_FATAL(err.what());
113 return StatusCode::FAILURE;
114 }
115 }
116
117 // Regular alignments. Loop through folder keys. Normally only one.
118 for (const auto & folder : m_folders) {
119
120 try {
121 bool status = processAlignmentContainer(folder);
122 alignmentChange = (alignmentChange || status);
123 }
124 catch(std::runtime_error& err) {
125 // alignments should always exist so we return fatal if we could not process the alignment for this key
126 ATH_MSG_FATAL(err.what());
127 return StatusCode::FAILURE;
128 }
129 }
130 // Detector specific aligments
131 for (const auto & specialFolder : m_specialFolders) {
132 try {
133 bool status = processSpecialAlignment(specialFolder, aligninfo.AlignFolder());
134 alignmentChange = (alignmentChange || status);
135 } catch(std::runtime_error& err) {
136 // keys are empty when running simualtion. It is normal for detector specific aligments not to exist.
137 ATH_MSG_INFO(err.what());
138 // We continue as detector specific aligments don't always exist.
139 }
140 }
141
142 // We invalidate all the elements if at least one alignment changed.
143 if (alignmentChange) {
144 //this is non-const as it invalidate the elements we hold
146 }
147
148 return StatusCode::SUCCESS;
149 }
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
virtual bool processSpecialAlignment(const std::string &key, InDetDD::AlignFolderType alignfolder)=0
bool processGlobalAlignmentContainer(const std::string &key, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const
virtual const AtlasDetectorID * getIdHelper() const =0
virtual void invalidateAll()=0
Invalidate cache for all detector elements.
bool processAlignmentContainer(const std::string &key) const
return align folder string to use
status
Definition merge.py:16

◆ align() [2/2]

StatusCode InDetDD::InDetDetectorManager::align ( const RawAlignmentObjects & alignObjects,
GeoVAlignmentStore * alignStore ) const
inherited

Definition at line 151 of file InDetDetectorManager.cxx.

152 {
153
154 ATH_MSG_DEBUG("align() called from an alignment CondAlg");
155 if (!getIdHelper()) return StatusCode::SUCCESS; // To Do: is it really a success?
156
157 bool alignmentChange = false;
158 // const AlignInfo &aligninfo = AlignInfo(m_alignfoldertype);
159
160 for(const auto& alignObj : alignObjects) {
161 const std::string& key = alignObj.first;
162
163 ATH_MSG_DEBUG(" Processing folder " << key);
164
165 if(m_globalFolders.find(key)!=m_globalFolders.end()) {
166 try {
167 // New global alignemnts
168 const CondAttrListCollection* obj = static_cast<const CondAttrListCollection*>(alignObj.second);
169 bool status = processGlobalAlignmentContainer(key,obj,alignStore);
170 alignmentChange = (alignmentChange || status);
171 } catch(std::runtime_error& err) {
172 // alignments should always exist so we return fatal if we could not process the alignment for this key
173 ATH_MSG_FATAL(err.what());
174 return StatusCode::FAILURE;
175 }
176 }
177 else if(m_folders.find(key)!=m_folders.end()) {
178 try {
179 // Regular alignemnts
180 const AlignableTransformContainer* container = static_cast<const AlignableTransformContainer*>(alignObj.second);
181 bool status = processAlignmentContainer(container,alignStore);
182 alignmentChange = (alignmentChange || status);
183 } catch(std::runtime_error& err) {
184 // alignments should always exist so we return fatal if we could not process the alignment for this key
185 ATH_MSG_FATAL(err.what());
186 return StatusCode::FAILURE;
187 }
188 }
189 else if(m_specialFolders.find(key)!=m_specialFolders.end()) {
190 try {
191 // Detector specific alignments
192 const CondAttrListCollection *obj =
193 static_cast<const CondAttrListCollection*>(alignObj.second);
194 bool status = processSpecialAlignment(key, obj, alignStore);
195 alignmentChange = (alignmentChange || status);
196 }
197 catch(std::runtime_error& err) {
198 // Should always exist if the folder was requested so we return fatal if
199 // we could not process the alignment for this key
200 ATH_MSG_FATAL(err.what());
201 return StatusCode::FAILURE;
202 }
203 }
204 else {
205 // Should not be any other keys specified in raw alignment object.
206 ATH_MSG_ERROR("Unrecognized folder name "<<key<<". Expected names are:");
207 for (const std::string& out:m_globalFolders) ATH_MSG_ERROR("--"<<out);
208 for (const std::string& out:m_folders) ATH_MSG_ERROR("--"<<out);
209 for (const std::string& out:m_specialFolders) ATH_MSG_ERROR("--"<<out);
210
211 return StatusCode::RECOVERABLE;
212 }
213 }
214 return StatusCode::SUCCESS;
215 }
CondMultChanCollection< AlignableTransform > AlignableTransformContainer
#define ATH_MSG_ERROR(x)

◆ alignmentCallback()

StatusCode InDetDD::TRT_DetectorManager::alignmentCallback ( )

Call back for alignment updates, DEPRECATED.

Now registered in tool.

Definition at line 399 of file TRT_DetectorManager.cxx.

400 {
401 return align();
402 }

◆ barrelTransformField()

const GeoXF::Function * InDetDD::TRT_DetectorManager::barrelTransformField ( size_t i) const

Definition at line 197 of file TRT_DetectorManager.cxx.

197 {
198 return m_barrelXF[i];
199 }

◆ conditions()

const TRT_Conditions * InDetDD::TRT_DetectorManager::conditions ( ) const

Conditions interface (mostly for internal use):-------------------------—.

Definition at line 465 of file TRT_DetectorManager.cxx.

466 {
467 return this;
468 }

◆ dxContainer()

const TRTCond::StrawDxContainer * InDetDD::TRT_Conditions::dxContainer ( ) const
inherited

Definition at line 14 of file TRT_Conditions.cxx.

15{
16 return m_dxContainer;
17}
const TRTCond::StrawDxContainer * m_dxContainer

◆ endcapTransformField()

const GeoXF::Function * InDetDD::TRT_DetectorManager::endcapTransformField ( size_t i) const

Definition at line 206 of file TRT_DetectorManager.cxx.

206 {
207 return m_endcapXF[i];
208 }

◆ gasType()

TRT_DetectorManager::ActiveGasType InDetDD::TRT_DetectorManager::gasType ( ) const

Definition at line 211 of file TRT_DetectorManager.cxx.

212 {
213 return m_gasType;
214 }

◆ getBarrelElement() [1/2]

TRT_BarrelElement * InDetDD::TRT_DetectorManager::getBarrelElement ( unsigned int positive,
unsigned int moduleIndex,
unsigned int phiIndex,
unsigned int strawLayerIndex )

Definition at line 108 of file TRT_DetectorManager.cxx.

112 {
113 return m_elementContainer.getBarrelDetElement(positive,moduleIndex,phiIndex,strawLayerIndex);
114 }

◆ getBarrelElement() [2/2]

const TRT_BarrelElement * InDetDD::TRT_DetectorManager::getBarrelElement ( unsigned int positive,
unsigned int moduleIndex,
unsigned int phiIndex,
unsigned int strawLayerIndex ) const

Access Barrel Elements:---------------—(Fast)-------------------------—.

Definition at line 100 of file TRT_DetectorManager.cxx.

104 {
105 return m_elementContainer.getBarrelDetElement(positive,moduleIndex,phiIndex,strawLayerIndex);
106 }

◆ getDetectorElementBegin() [1/2]

TRT_DetElementCollection::iterator InDetDD::TRT_DetectorManager::getDetectorElementBegin ( )

Definition at line 182 of file TRT_DetectorManager.cxx.

183 {
184 return m_elementContainer.getElements()->begin();
185 }

◆ getDetectorElementBegin() [2/2]

TRT_DetElementCollection::const_iterator InDetDD::TRT_DetectorManager::getDetectorElementBegin ( ) const

Definition at line 172 of file TRT_DetectorManager.cxx.

173 {
174 return m_elementContainer.getElements()->begin();
175 }

◆ getDetectorElementCollection()

const TRT_DetElementCollection * InDetDD::TRT_DetectorManager::getDetectorElementCollection ( ) const

Access to Whole Collection of Elements ---------------------------------—.

Definition at line 167 of file TRT_DetectorManager.cxx.

168 {
169 return m_elementContainer.getElements();
170 }

◆ getDetectorElementContainer()

const TRT_DetElementContainer * InDetDD::TRT_DetectorManager::getDetectorElementContainer ( ) const

Access the element container -------------------------------------------—.

Definition at line 162 of file TRT_DetectorManager.cxx.

163 {
164 return &m_elementContainer;
165 }

◆ getDetectorElementEnd() [1/2]

TRT_DetElementCollection::iterator InDetDD::TRT_DetectorManager::getDetectorElementEnd ( )

Definition at line 187 of file TRT_DetectorManager.cxx.

188 {
189 return m_elementContainer.getElements()->end();
190 }

◆ getDetectorElementEnd() [2/2]

TRT_DetElementCollection::const_iterator InDetDD::TRT_DetectorManager::getDetectorElementEnd ( ) const

Definition at line 177 of file TRT_DetectorManager.cxx.

178 {
179 return m_elementContainer.getElements()->end();
180 }

◆ getElement() [1/2]

const TRT_BaseElement * InDetDD::TRT_DetectorManager::getElement ( Identifier id) const

Access Elements Generically---------------------------------------------—.

Definition at line 145 of file TRT_DetectorManager.cxx.

146 {
147 // Make sure it is a straw_layer id
148 Identifier strawLayerId = m_idHelper->layer_id(id);
149 IdentifierHash hashId = m_idHelper->straw_layer_hash(strawLayerId);
150 const TRT_DetElementCollection* elements = m_elementContainer.getElements();
151 if (hashId>=elements->size()) return nullptr;
152 return (*elements)[hashId];
153 }

◆ getElement() [2/2]

const TRT_BaseElement * InDetDD::TRT_DetectorManager::getElement ( IdentifierHash id) const

Definition at line 155 of file TRT_DetectorManager.cxx.

156 {
157 const TRT_DetElementCollection* elements = m_elementContainer.getElements();
158 if (id>=elements->size()) return nullptr;
159 return (*elements)[id];
160 }

◆ getEndcapElement() [1/2]

TRT_EndcapElement * InDetDD::TRT_DetectorManager::getEndcapElement ( unsigned int positive,
unsigned int wheelIndex,
unsigned int strawLayerIndex,
unsigned int phiIndex )

Definition at line 124 of file TRT_DetectorManager.cxx.

128 {
129 return m_elementContainer.getEndcapDetElement(positive,wheelIndex,strawLayerIndex,phiIndex);
130 }

◆ getEndcapElement() [2/2]

const TRT_EndcapElement * InDetDD::TRT_DetectorManager::getEndcapElement ( unsigned int positive,
unsigned int wheelIndex,
unsigned int strawLayerIndex,
unsigned int phiIndex ) const

Access Endcap Elements:---------------—(Fast)--------------------------—.

Definition at line 116 of file TRT_DetectorManager.cxx.

120 {
121 return m_elementContainer.getEndcapDetElement(positive,wheelIndex,strawLayerIndex,phiIndex);
122 }

◆ getIdHelper()

const TRT_ID * InDetDD::TRT_DetectorManager::getIdHelper ( ) const
overrideprivatevirtual

Implements InDetDD::InDetDetectorManager.

Definition at line 132 of file TRT_DetectorManager.cxx.

133 {
134 return m_idHelper;
135 }

◆ getLayout()

const std::string & InDetDD::InDetDetectorManager::getLayout ( ) const
inherited

Definition at line 38 of file InDetDetectorManager.cxx.

39 {
40 return m_version.layout();
41 }

◆ getLevel()

const InDetDetectorManager::LevelInfo & InDetDD::InDetDetectorManager::getLevel ( const std::string & key) const
privateinherited

Retrieve level information.

Definition at line 87 of file InDetDetectorManager.cxx.

88 {
89 std::map<std::string, LevelInfo>::const_iterator iter;
90 iter = m_keys.find(key);
91 if (iter == m_keys.end()) return s_invalidLevel;
92 return iter->second;
93 }
static const LevelInfo s_invalidLevel

◆ getNumerology() [1/2]

TRT_Numerology * InDetDD::TRT_DetectorManager::getNumerology ( )

Access Numerological information:---------------------------------------—.

Definition at line 43 of file TRT_DetectorManager.cxx.

43 {
44 return m_numerology;
45 }

◆ getNumerology() [2/2]

const TRT_Numerology * InDetDD::TRT_DetectorManager::getNumerology ( ) const

Definition at line 47 of file TRT_DetectorManager.cxx.

47 {
48 return m_numerology;
49 }

◆ getNumTreeTops()

unsigned int InDetDD::TRT_DetectorManager::getNumTreeTops ( ) const
overridevirtual

Access Raw Geometry:----------------------------------------------------—.

Definition at line 74 of file TRT_DetectorManager.cxx.

75 {
76 return m_volume.size();
77 }

◆ getTreeTop()

PVConstLink InDetDD::TRT_DetectorManager::getTreeTop ( unsigned int i) const
overridevirtual

Definition at line 79 of file TRT_DetectorManager.cxx.

80 {
81 return m_volume[i];
82 }

◆ getVersion()

const Version & InDetDD::InDetDetectorManager::getVersion ( ) const
inherited

Get version information.

Definition at line 33 of file InDetDetectorManager.cxx.

34 {
35 return m_version;
36 }

◆ identifierBelongs()

bool InDetDD::TRT_DetectorManager::identifierBelongs ( const Identifier & id) const
overridevirtual

Check identifier is for this detector.

Implements InDetDD::InDetDetectorManager.

Definition at line 430 of file TRT_DetectorManager.cxx.

431 {
432 return getIdHelper()->is_trt(id);
433 }
bool is_trt(Identifier id) const
virtual const TRT_ID * getIdHelper() const override

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ invalidateAll()

void InDetDD::TRT_DetectorManager::invalidateAll ( )
overridevirtual

Invalidate cache for all detector elements.

Implements InDetDD::InDetDetectorManager.

Definition at line 406 of file TRT_DetectorManager.cxx.

407 {
409 element_iter != getDetectorElementEnd();
410 ++element_iter) {
411 if (*element_iter) {
412 (*element_iter)->invalidate();
413 }
414 }
415 }
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
TRT_DetElementCollection::const_iterator getDetectorElementBegin() const
TRT_DetElementCollection::const_iterator getDetectorElementEnd() const

◆ manageBarrelElement()

void InDetDD::TRT_DetectorManager::manageBarrelElement ( TRT_BarrelElement * barrel)

Definition at line 89 of file TRT_DetectorManager.cxx.

90 {
91 m_elementContainer.manageBarrelElement(barrel,m_idHelper);
92 }

◆ manageEndcapElement()

void InDetDD::TRT_DetectorManager::manageEndcapElement ( TRT_EndcapElement * endcap)

Definition at line 95 of file TRT_DetectorManager.cxx.

96 {
97 m_elementContainer.manageEndcapElement(endcap,m_idHelper);
98 }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 182 of file AthMessaging.h.

183{ return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 // If user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ operator=()

const TRT_DetectorManager & InDetDD::TRT_DetectorManager::operator= ( const TRT_DetectorManager & right)
private

◆ processAlignmentContainer() [1/2]

bool InDetDD::InDetDetectorManager::processAlignmentContainer ( const AlignableTransformContainer * container,
GeoVAlignmentStore * alignStore ) const
privateinherited

Definition at line 245 of file InDetDetectorManager.cxx.

246 {
247 bool alignmentChange = false;
248
249 // Check if container is empty - this can occur if it is an invalid IOV.
250 if (container->empty()) {
251 ATH_MSG_ERROR("AlignableTransformContainer "
252 << " is empty. Probably due to out of range IOV"); // To Do: add key to this printout for making it more informative
253 // This should not occur in normal situations so we force job to abort.
254 throw std::runtime_error("Unable to apply Inner Detector alignments.");
255 }
256 // loop over all the AlignableTransform objects in the collection
257 // use only the last ones.
258 // /Indet/AlignL3/SCTEA9 appear repeatedly in tags of the /Indet/AlignL3 folder
259 std::map<const std::string, const AlignableTransform*> stringToTransform;
260 for (const auto *pat : *container) {
261 stringToTransform[pat->tag()] = pat;
262 }
263 for (const std::pair<const std::string, const AlignableTransform*>& value: stringToTransform) {
264 bool status = processKey(value.first, value.second, alignStore);
265 alignmentChange = (alignmentChange || status);
266 }
267 return alignmentChange;
268 }
bool empty() const noexcept
Returns true if the collection is empty.
bool processKey(const std::string &key, const AlignableTransform *transformCollection, GeoVAlignmentStore *alignStore=nullptr) const
Called by processAlignmentContainer, applies only one key on the transform Collections.

◆ processAlignmentContainer() [2/2]

bool InDetDD::InDetDetectorManager::processAlignmentContainer ( const std::string & key) const
privateinherited

return align folder string to use

Process the alignment container, calls processKey

Definition at line 217 of file InDetDetectorManager.cxx.

218 {
219 bool alignmentChange = false;
220
221 ATH_MSG_DEBUG("Dealing with key as container");
222 const AlignableTransformContainer* container;
223 if (StatusCode::SUCCESS!=m_detStore->retrieve(container, key)) {
224 ATH_MSG_ERROR("Cannot find AlignableTransformContainer for key "
225 << key << " - no misalignment");
226 // This should not occur in normal situations so we force job to abort.
227 throw std::runtime_error("Unable to apply Inner Detector alignments");
228 }
229 // Check if container is empty - this can occur if it is an invalid IOV.
230 if (container->empty()) {
231 ATH_MSG_ERROR("AlignableTransformContainer for key "
232 << key << " is empty. Probably due to out of range IOV");
233 // This should not occur in normal situations so we force job to abort.
234 throw std::runtime_error("Unable to apply Inner Detector alignments.");
235 }
236 // loop over all the AlignableTransform objects in the collection
237 for (const auto *pat : *container) {
238
239 bool status = processKey(pat->tag(),pat);
240 alignmentChange = (alignmentChange || status);
241 }
242 return alignmentChange;
243 }

◆ processGlobalAlignment()

bool InDetDD::TRT_DetectorManager::processGlobalAlignment ( const std::string & key,
int level,
FrameType frame,
const CondAttrListCollection * obj,
GeoVAlignmentStore * alignStore ) const
overridevirtual

Process new global DB folders for L1 and L2.

Reimplemented from InDetDD::InDetDetectorManager.

Definition at line 471 of file TRT_DetectorManager.cxx.

473 {
474
475 bool alignmentChange = false;
476
477 ATH_MSG_INFO("Processing new global alignment containers with key " << key << " in the " << frame << " frame at level " << level);
478
479 Identifier ident=Identifier();
480 const CondAttrListCollection* atrlistcol=obj;
481 //cppcheck-suppress nullPointerRedundantCheck
482 if (!atrlistcol) {
483 ATH_MSG_INFO("Read alignment from detector store with key " << key);
484 if (StatusCode::SUCCESS!=m_detStore->retrieve(atrlistcol,key)) {
485 ATH_MSG_WARNING("Cannot find new global align Container for key "
486 << key << " - no new global alignment");
487 return alignmentChange;
488 }
489 }
490 // Avoid cppcheck warning.
491 if (!atrlistcol) {
492 return alignmentChange;
493 }
494 {
495 // loop over objects in collection
496 //cppcheck-suppress nullPointerRedundantCheck
497 for (const auto & citr : *atrlistcol) {
498
499 const coral::AttributeList& atrlist=citr.second;
500 ident = getIdHelper()->module_id(atrlist["bec"].data<int>(),
501 atrlist["layer"].data<int>(),
502 atrlist["sector"].data<int>());
503
504 // Follow same definitions as in TRT_AlignDbSvc.cxx
505 CLHEP::Hep3Vector newtranslation(atrlist["Tx"].data<float>(),atrlist["Ty"].data<float>(),atrlist["Tz"].data<float>());
506 CLHEP::HepRotation newrotation;
507 newrotation.set(atrlist["phi"].data<float>(),atrlist["theta"].data<float>(),atrlist["psi"].data<float>());
508 HepGeom::Transform3D newtransform(newrotation, newtranslation);
509
510 msg(MSG::DEBUG) << "New global DB -- channel: " << citr.first
511 << " ,bec: " << atrlist["bec"].data<int>()
512 << " ,layer: " << atrlist["layer"].data<int>()
513 << " ,sector: " << atrlist["sector"].data<int>()
514 << " ,Tx: " << atrlist["Tx"].data<float>()
515 << " ,Ty: " << atrlist["Ty"].data<float>()
516 << " ,Tz: " << atrlist["Tz"].data<float>()
517 << " ,phi: " << atrlist["phi"].data<float>()
518 << " ,theta: " << atrlist["theta"].data<float>()
519 << " ,psi: " << atrlist["psi"].data<float>() << endmsg;
520
521 // Set the new transform; Will replace existing one with updated transform
523 ident,
524 Amg::CLHEPTransformToEigen(newtransform),
525 frame,
526 alignStore);
527
528 if (!status) {
529 if (msgLvl(MSG::DEBUG)) {
530 msg(MSG::DEBUG) << "Cannot set AlignableTransform for identifier."
531 << getIdHelper()->show_to_string(ident)
532 << " at level " << level << " for new global DB " << endmsg;
533 }
534 }
535
536 alignmentChange = (alignmentChange || status);
537 }
538 }
539 return alignmentChange;
540 }
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
virtual bool setAlignableTransformDelta(int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const override
Set alignable transforms: Amg based.
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.
Definition TRT_ID.h:442
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
@ ident
Definition HitInfo.h:77

◆ processGlobalAlignmentContainer()

bool InDetDD::InDetDetectorManager::processGlobalAlignmentContainer ( const std::string & key,
const CondAttrListCollection * obj = nullptr,
GeoVAlignmentStore * alignStore = nullptr ) const
privateinherited

Definition at line 333 of file InDetDetectorManager.cxx.

336 {
337 bool alignmentChange = false;
338
339 ATH_MSG_DEBUG("processing GlobalAlignmentContainer with key: " << key);
340 // From the key determine what level in hierarchy we are dealing with.
341 // returns -1 if unrecognized.
342 const LevelInfo & levelInfo = getLevel(key);
343 if (levelInfo.isValid()) {
344 ATH_MSG_VERBOSE("Processing channel: " << key);
345 } else {
346 ATH_MSG_DEBUG("Channel " << key << " not registered in this manager");
347 }
348 // return silently if unrecognised - this can happen in container mode
349 // when a single container holds transforms for both pixel and SCT
350 if (!levelInfo.isValid() ) return false;
351
352 // Within detector specific code
353 bool status = processGlobalAlignment(key, levelInfo.level(), levelInfo.frame(), obj, alignStore);
354
355 alignmentChange = (alignmentChange || status);
356
357 return alignmentChange;
358
359 }
#define ATH_MSG_VERBOSE(x)
virtual bool processGlobalAlignment(const std::string &key, int level, FrameType frame, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const
const LevelInfo & getLevel(const std::string &key) const
Retrieve level information.

◆ processKey()

bool InDetDD::InDetDetectorManager::processKey ( const std::string & key,
const AlignableTransform * transformCollection,
GeoVAlignmentStore * alignStore = nullptr ) const
privateinherited

Called by processAlignmentContainer, applies only one key on the transform Collections.

Definition at line 270 of file InDetDetectorManager.cxx.

273 {
274 bool alignmentChange = false;
275
276 // From the key determine what level in hierarchy we are dealing with.
277 // returns -1 if unrecognized.
278 const LevelInfo & levelInfo = getLevel(key);
279 if (levelInfo.isValid()) {
280 ATH_MSG_VERBOSE("Processing channel: " << key);
281 } else {
282 ATH_MSG_DEBUG("Channel " << key << " not registered in this manager");
283 }
284 // return silently if unrecognised - this can happen in container mode
285 // when a single container holds transforms for both pixel and SCT
286 if (!levelInfo.isValid() ) return false;
287
288 //Loop over the effected nodes.
289 for (AlignableTransform::AlignTransMem_citr trans_iter = transformCollection->begin();
290 trans_iter != transformCollection->end();
291 ++trans_iter) {
292 ATH_MSG_DEBUG( "Get alignment for identifier "
293 << getIdHelper()->show_to_string(trans_iter->identify())
294 << " at level " << levelInfo.level());
295
296 // The delta in the conditions DB is not necessarily the same as what is needed in the
297 // alignable transform. At the moment we support global frame, local frame or an alternative frame
298 // The setAlignableTransformDelta method takes care of this correction - this is CLHEP <--> Amg interfaced
299 bool status = setAlignableTransformDelta(levelInfo.level(),
300 trans_iter->identify(),
301 Amg::CLHEPTransformToEigen(trans_iter->transform()),
302 levelInfo.frame(),
303 alignStore);
304
305 alignmentChange = (alignmentChange || status);
306
307 if (!status) {
308 if (!identifierBelongs(trans_iter->identify())) {
309 // Its probably OK. Eg /Indet/Align/ID contains alse pixel and sct ids.
310 ATH_MSG_DEBUG("Cannot set AlignableTransform for identifier."
311 << " Probably OK if its /Indet/Align/ID folder. "
312 << getIdHelper()->show_to_string(trans_iter->identify())
313 << " at level " << levelInfo.level());
314 } else {
315 if (m_suppressWarnings) {
316 ATH_MSG_DEBUG("WARNING: Cannot set AlignableTransform for identifier "
317 << getIdHelper()->show_to_string(trans_iter->identify())
318 << " at level " << levelInfo.level());
319 } else {
320 ATH_MSG_WARNING("Cannot set AlignableTransform for identifier "
321 << getIdHelper()->show_to_string(trans_iter->identify())
322 << " at level " << levelInfo.level());
323 ATH_MSG_WARNING("Subsequent WARNINGS will be printed at DEBUG level.");
324 m_suppressWarnings = true;
325 }
326 }
327 }
328 }
329 return alignmentChange;
330 }
std::vector< AlignTransMember >::const_iterator AlignTransMem_citr
AlignTransMem_citr end() const
AlignTransMem_citr begin() const
virtual bool identifierBelongs(const Identifier &id) const =0
Check identifier is for this detector.
virtual bool setAlignableTransformDelta(int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore=nullptr) const =0
Set method applying the delta transform (in global or local frame) onto the geoModel transform : CLHE...

◆ processSpecialAlignment() [1/2]

bool InDetDD::TRT_DetectorManager::processSpecialAlignment ( const std::string & key,
const CondAttrListCollection * obj = nullptr,
GeoVAlignmentStore * alignStore = nullptr ) const
overridevirtual

Implements InDetDD::InDetDetectorManager.

Definition at line 458 of file TRT_DetectorManager.cxx.

460 {
461 return false;
462 }

◆ processSpecialAlignment() [2/2]

bool InDetDD::TRT_DetectorManager::processSpecialAlignment ( const std::string & key,
InDetDD::AlignFolderType dummy )
overridevirtual

Implements InDetDD::InDetDetectorManager.

Definition at line 436 of file TRT_DetectorManager.cxx.

437 {
438 if(msgLvl(MSG::DEBUG))
439 msg(MSG::DEBUG) << "Processing TRT fine alignment." << endmsg;
440
441 const TRTCond::StrawDxContainer* container = nullptr;
442 StatusCode sc = StatusCode::FAILURE;
443 if (m_detStore->contains<TRTCond::StrawDxContainer>(key)) {
444 sc = m_detStore->retrieve(container, key);
445 }
446
447 if (sc.isFailure()) {
448 if (msgLvl(MSG::INFO))
449 msg(MSG::INFO) << "Cannot find StrawDxContainer for key "
450 << key << " - no fine alignment " << endmsg;
451 throw std::runtime_error("Unable to apply TRT fine alignment. This is normal for simulation");
452 } else {
453 this->setDxContainer(container);
454 return true; //Elements will need to be invalidated via invalidateAll from the caller
455 }
456 }
static Double_t sc
void setDxContainer(const TRTCond::StrawDxContainer *container)
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ setAlignableTransformAnyFrameDelta()

bool InDetDD::TRT_DetectorManager::setAlignableTransformAnyFrameDelta ( ExtendedAlignableTransform * extXF,
const Amg::Transform3D & delta,
FrameType frame,
GeoVAlignmentStore * alignStore ) const

Set alignable transforms: Amg based.

Definition at line 307 of file TRT_DetectorManager.cxx.

311 {
312 //---------------------
313 // For Local:
314 //---------------------
315 // The geomodel alignable transform delta is already a local delta so we just pass it directly
316
317 //---------------------
318 // For global frame
319 //---------------------
320 // Sets the alignable transform delta when the supplied delta is in the global frame.
321
322 // If the default transform down to the alignable transform is
323 // T = A*B*C
324 // and the alignable transform is C with delta c and the delta in the global frame is g, then
325 // A*B*C*c = g*A*B*C
326 // T*c = g*T
327 // c = T.inverse() * g * T
328
329 // To get default transform up and including the alignable transform,
330 // we assume the next volume down is a fullphys volume and so its
331 // transform is the transform we want (ie T=A*B*C in the above example).
332
333 //---------------------
334 // For Other frame
335 //---------------------
336 // Sets the alignable transform delta when the supplied delta is in the frame of the
337 // volume "frameVol".
338
339 // If the default transform down to the alignable transform is
340 // T = A*B*C
341 // and the alignable transform is C with delta c and the delta g is expressed in the frame A, then
342 // A*B*C*c = A*g*B*C
343 // c = (BC).inverse * g * (BC)
344 // BC = A.inverse() * T
345 // C = T.inverse() * A * g * A.inverse() * T
346
347 // To get default transform up and including the alignable transform,
348 // we assume the next volume down is a fullphys volume and so its
349 // transform is the transform we want (ie T=A*B*C in the above example).
350 // The Transform to the frame is T = A which we get from the fullphys volume frameVol.
351
352 if (!extXF) return false;
353 if (!extXF->alignableTransform()) return false;
354
355 const GeoVFullPhysVol * child = extXF->child();
356 const GeoVFullPhysVol * frameVol = extXF->frame();
357
358 FrameType newFrame = frame;
359 // If frame is other then check if "other" is actually local or global
360 if (frame == InDetDD::other) {
361 if (child && !frameVol) {
362 // frame = 0 indicates to use global frame
363 newFrame = InDetDD::global;
364 } else if (!child || child == frameVol){
365 // if child is 0 or the they are the same volumes then its local
366 newFrame = InDetDD::local;
367 } // else its "other" already.
368 }
369
370 if (newFrame == InDetDD::global) { // Global
371 if (!child) {
372 msg(MSG::ERROR) << "global frame specified, but child == 0" << endmsg;
373 } else {
374 const GeoTrf::Transform3D & childXF = child->getDefAbsoluteTransform(alignStore);
375 extXF->alignableTransform()->setDelta(childXF.inverse() * delta * childXF, alignStore);
376 }
377
378 } else if (frame == InDetDD::local) { // Local
379 // if its a local frame then no transform necessary. We set it directly.
380 extXF->alignableTransform()->setDelta(delta, alignStore);
381
382 } else { // Other frame
383 // if child or frame is zero it will have been set to local or global above
384 if (!child) { // CID 113112
385 // shouldn't be happening, if child is null then something is terribly wrong
386 ATH_MSG_ERROR("Child can't be null if frame is 'other'");
387 return false;
388 } else {
389 const GeoTrf::Transform3D & xfChild = child->getDefAbsoluteTransform(alignStore);
390 const GeoTrf::Transform3D & xfFrame = frameVol->getDefAbsoluteTransform(alignStore);
391 extXF->alignableTransform()->setDelta(xfChild.inverse() * xfFrame * delta * xfFrame.inverse() * xfChild, alignStore);
392 }
393 }
394
395 return true;
396 }

◆ setAlignableTransformDelta()

bool InDetDD::TRT_DetectorManager::setAlignableTransformDelta ( int level,
const Identifier & id,
const Amg::Transform3D & delta,
FrameType frame,
GeoVAlignmentStore * alignStore ) const
overridevirtual

Set alignable transforms: Amg based.

Implements InDetDD::InDetDetectorManager.

Definition at line 283 of file TRT_DetectorManager.cxx.

288 {
289 if (level == 0) {
290 // Nothing implemented. Reserved in case we want alignable straws
291 return false;
292 } else {
293
294 int index = level - FIRST_HIGHER_LEVEL; // level 0 treated separately.
295 if (index >= static_cast<int>(m_alignableTransforms.size())) return false;
296
297 // We retrieve it from a map.
298 AlignableTransformMap::const_iterator iter;
299 iter = m_alignableTransforms[index].find(id);
300 if (iter == m_alignableTransforms[index].end()) return false;
301
302 return setAlignableTransformAnyFrameDelta(iter->second, delta, frame, alignStore);
303
304 }
305 }
bool setAlignableTransformAnyFrameDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const
Set alignable transforms: Amg based.

◆ setBarrelDescriptor()

void InDetDD::TRT_DetectorManager::setBarrelDescriptor ( const TRT_BarrelDescriptor * barrelDescriptor)

Set TRT_Barrel/EndcapDescriptor pointer to the internal sets to delete them in the destructor.

Definition at line 542 of file TRT_DetectorManager.cxx.

543 {
544 m_barrelDescriptors.insert(barrelDescriptor);
545 }

◆ setBarrelTransformField()

void InDetDD::TRT_DetectorManager::setBarrelTransformField ( size_t i,
const GeoXF::Function * field )

Definition at line 192 of file TRT_DetectorManager.cxx.

192 {
193 if (m_barrelXF[i]!=f) delete m_barrelXF[i];
194 m_barrelXF[i] = f;
195 }

◆ setDxContainer()

void InDetDD::TRT_Conditions::setDxContainer ( const TRTCond::StrawDxContainer * container)
protectedinherited

Definition at line 20 of file TRT_Conditions.cxx.

21{
22 m_dxContainer = container;
23}

◆ setEndcapDescriptor()

void InDetDD::TRT_DetectorManager::setEndcapDescriptor ( const TRT_EndcapDescriptor * endcapDescriptor)

Definition at line 547 of file TRT_DetectorManager.cxx.

548 {
549 m_endcapDescriptors.insert(endcapDescriptor);
550 }

◆ setEndcapTransformField()

void InDetDD::TRT_DetectorManager::setEndcapTransformField ( size_t i,
const GeoXF::Function * field )

Definition at line 201 of file TRT_DetectorManager.cxx.

201 {
202 if (m_endcapXF[i]!=f) delete m_endcapXF[i];
203 m_endcapXF[i]=f;
204 }

◆ setGasType()

void InDetDD::TRT_DetectorManager::setGasType ( const ActiveGasType & activeGasType)

Definition at line 216 of file TRT_DetectorManager.cxx.

217 {
218 m_gasType = activeGasType;
219 }

◆ setIdHelper()

void InDetDD::TRT_DetectorManager::setIdHelper ( const TRT_ID * idHelper,
bool owns = true )

Get the ID helper: -----------------------------------------------------—.

Definition at line 137 of file TRT_DetectorManager.cxx.

138 {
139 m_idHelper=idHelper;
140 m_ownsIdHelper=owns;
141 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ setVersion()

void InDetDD::InDetDetectorManager::setVersion ( const Version & version)
inherited

Definition at line 43 of file InDetDetectorManager.cxx.

44 {
46
47 // Since default alignments are for final layout, Pixel Rome-Initial
48 // layout will result in several (harmless) WARNING message. We suppress these.
49 // Also the SR1 layout produce warnings due to missing parts. We suppress these also.
50 m_suppressWarnings = ( (getName() == "Pixel" &&
51 (version.tag() == "Pixel-01" || version.tag() == "Pixel-DC2-Initial-00"))
52 || version.layout() == "SR1" || version.layout() == "SR1-EndcapC");
53
54 }

◆ updateAll()

void InDetDD::TRT_DetectorManager::updateAll ( ) const
overridevirtual

Update all caches.

Implements InDetDD::InDetDetectorManager.

Definition at line 417 of file TRT_DetectorManager.cxx.

418 {
420 element_iter != getDetectorElementEnd();
421 ++element_iter) {
422
423 if (*element_iter) {
424 (*element_iter)->updateAllCaches();
425 }
426 }
427 }
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_alignableTransforms

std::vector< AlignableTransformMap > InDetDD::TRT_DetectorManager::m_alignableTransforms
private

Definition at line 253 of file TRT_DetectorManager.h.

◆ m_alignfoldertype

AlignFolderType InDetDD::InDetDetectorManager::m_alignfoldertype
inherited

Definition at line 93 of file InDetDetectorManager.h.

◆ m_barrelDescriptors

std::set<const TRT_BarrelDescriptor*> InDetDD::TRT_DetectorManager::m_barrelDescriptors
private

Definition at line 256 of file TRT_DetectorManager.h.

◆ m_barrelXF

const GeoXF::Function* InDetDD::TRT_DetectorManager::m_barrelXF[3] {}
private

Definition at line 244 of file TRT_DetectorManager.h.

244{}; //

◆ m_detStore

StoreGateSvc* InDetDD::InDetDetectorManager::m_detStore
protectedinherited

Definition at line 96 of file InDetDetectorManager.h.

◆ m_digvers

unsigned int InDetDD::TRT_DetectorManager::m_digvers
private

Definition at line 248 of file TRT_DetectorManager.h.

◆ m_digversname

std::string InDetDD::TRT_DetectorManager::m_digversname
private

Definition at line 249 of file TRT_DetectorManager.h.

◆ m_dxContainer

const TRTCond::StrawDxContainer* InDetDD::TRT_Conditions::m_dxContainer
privateinherited

Definition at line 41 of file TRT_Conditions.h.

◆ m_elementContainer

TRT_DetElementContainer InDetDD::TRT_DetectorManager::m_elementContainer
private

Definition at line 239 of file TRT_DetectorManager.h.

◆ m_endcapDescriptors

std::set<const TRT_EndcapDescriptor*> InDetDD::TRT_DetectorManager::m_endcapDescriptors
private

Definition at line 257 of file TRT_DetectorManager.h.

◆ m_endcapXF

const GeoXF::Function* InDetDD::TRT_DetectorManager::m_endcapXF[3] {}
private

Definition at line 245 of file TRT_DetectorManager.h.

245{}; //

◆ m_folders

std::set<std::string> InDetDD::InDetDetectorManager::m_folders
privateinherited

Definition at line 179 of file InDetDetectorManager.h.

◆ m_gasType

ActiveGasType InDetDD::TRT_DetectorManager::m_gasType
private

Definition at line 247 of file TRT_DetectorManager.h.

◆ m_globalFolders

std::set<std::string> InDetDD::InDetDetectorManager::m_globalFolders
privateinherited

Definition at line 181 of file InDetDetectorManager.h.

◆ m_idHelper

const TRT_ID* InDetDD::TRT_DetectorManager::m_idHelper
private

Definition at line 242 of file TRT_DetectorManager.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_keys

std::map<std::string, LevelInfo> InDetDD::InDetDetectorManager::m_keys
privateinherited

Definition at line 178 of file InDetDetectorManager.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_numerology

TRT_Numerology* InDetDD::TRT_DetectorManager::m_numerology
private

Definition at line 241 of file TRT_DetectorManager.h.

◆ m_ownsIdHelper

bool InDetDD::TRT_DetectorManager::m_ownsIdHelper
private

Definition at line 243 of file TRT_DetectorManager.h.

◆ m_specialFolders

std::set<std::string> InDetDD::InDetDetectorManager::m_specialFolders
privateinherited

Definition at line 180 of file InDetDetectorManager.h.

◆ m_suppressWarnings

std::atomic_bool InDetDD::InDetDetectorManager::m_suppressWarnings
mutableprotectedinherited

Definition at line 97 of file InDetDetectorManager.h.

◆ m_version

Version InDetDD::InDetDetectorManager::m_version
privateinherited

Definition at line 177 of file InDetDetectorManager.h.

◆ m_volume

std::vector<PVLink> InDetDD::TRT_DetectorManager::m_volume
private

Definition at line 237 of file TRT_DetectorManager.h.

◆ s_invalidLevel

const InDetDetectorManager::LevelInfo InDetDD::InDetDetectorManager::s_invalidLevel
staticprivateinherited

Definition at line 183 of file InDetDetectorManager.h.


The documentation for this class was generated from the following files: