ATLAS Offline Software
Loading...
Searching...
No Matches
InDetDD::SiDetectorManager Class Referenceabstract

Base class for Pixel and SCT Detector managers. More...

#include <SiDetectorManager.h>

Inheritance diagram for InDetDD::SiDetectorManager:
Collaboration diagram for InDetDD::SiDetectorManager:

Public Member Functions

 SiDetectorManager (StoreGateSvc *detStore, const std::string &name)
virtual ~SiDetectorManager ()
virtual const SiDetectorElementgetDetectorElement (const Identifier &id) const =0
 access to individual elements using Identifier or IdentiferHash
virtual const SiDetectorElementgetDetectorElement (const IdentifierHash &idHash) const =0
virtual const SiDetectorElementCollectiongetDetectorElementCollection () const =0
 access to whole collectiom
virtual SiDetectorElementCollection::const_iterator getDetectorElementBegin () const =0
virtual SiDetectorElementCollection::const_iterator getDetectorElementEnd () const =0
virtual SiDetectorElementCollection::iterator getDetectorElementBegin ()=0
virtual SiDetectorElementCollection::iterator getDetectorElementEnd ()=0
virtual void addDetectorElement (SiDetectorElement *element)=0
 Add elememts.
virtual void initNeighbours ()=0
 Initialize the neighbours.
const std::string & tag () const
 Get tag used in dictionary.
virtual bool isPixel () const =0
 Methods to query which manager we have.
bool isSCT () const
virtual void addAlignableTransform (int level, const Identifier &id, GeoAlignableTransform *xf)=0
 Add alignable transforms.
virtual void invalidateAll ()
 Invalidate cache for all detector elements.
virtual void updateAll () const
 Update all caches.
const SiDetectorDesignaddDesign (std::unique_ptr< const SiDetectorDesign > &&)
 Access to module design; returns an observer pointer.
int numDesigns () const
const SiDetectorDesigngetDesign (int i) const
const SiNumerologynumerology () const
 Access Numerology.
SiNumerologynumerology ()
void setCommonItems (std::unique_ptr< const SiCommonItems > &&commonItems)
 Set SiCommonItems.
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 (IOVSVC_CALLBACK_ARGS)
StatusCode align (const RawAlignmentObjects &alignObjects, GeoVAlignmentStore *alignStore) const
virtual bool identifierBelongs (const Identifier &id) const =0
 Check identifier is for this detector.
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.

Static Public Member Functions

static bool setAlignableTransformGlobalDelta (ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, GeoVAlignmentStore *alignStore=nullptr)
 Helper method to set delta transform from a global delta - Amg interface.
static bool setAlignableTransformLocalDelta (ExtendedAlignableTransform *extXF, const Amg::Transform3D &localToGlobalXF, const Amg::Transform3D &delta, GeoVAlignmentStore *alignStore=nullptr)
 Helper method to set delta transform from a local delta - Amg interface.

Public Attributes

AlignFolderType m_alignfoldertype

Protected Attributes

StoreGateSvcm_detStore
std::atomic_bool m_suppressWarnings

Private Member Functions

const SiDetectorManageroperator= (const SiDetectorManager &right)
 SiDetectorManager (const SiDetectorManager &right)
virtual bool setAlignableTransformDelta (int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const =0
 This method is called by the InDetDetectorManager.
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.
virtual bool processSpecialAlignment (const std::string &key, InDetDD::AlignFolderType alignfolder)=0
virtual bool processSpecialAlignment (const std::string &key, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const =0
bool processGlobalAlignmentContainer (const std::string &key, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const
virtual bool processGlobalAlignment (const std::string &key, int level, FrameType frame, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const
virtual const AtlasDetectorIDgetIdHelper () const =0
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::string m_tag
SiNumerology m_numerology
std::vector< std::unique_ptr< const SiDetectorDesign > > m_designs
std::unique_ptr< const SiCommonItemsm_commonItems
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)

Static Private Attributes

static const LevelInfo s_invalidLevel

Detailed Description

Base class for Pixel and SCT Detector managers.

The Detector manager has methods to retrieve the Identifier helper and methods to retrieve the detector elements. It also manages the alignment with methods to register the call backs and infrastructure to associate the alignment transforms with the appropriate alignable transform in GeoModel. There is also access to the layout (Initial, Final, TestBeam) and and version information.

Author
: Grant Gorfine
  • modified and maintained by Nick Styles & Andreas Salzburger

Definition at line 60 of file SiDetectorManager.h.

Constructor & Destructor Documentation

◆ SiDetectorManager() [1/2]

InDetDD::SiDetectorManager::SiDetectorManager ( StoreGateSvc * detStore,
const std::string & name )

Definition at line 27 of file SiDetectorManager.cxx.

28 : InDetDetectorManager(detStore, name)
29 {
30 }
InDetDetectorManager(StoreGateSvc *detStore, const std::string &name)

◆ ~SiDetectorManager()

InDetDD::SiDetectorManager::~SiDetectorManager ( )
virtualdefault

◆ SiDetectorManager() [2/2]

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

Member Function Documentation

◆ addAlignableTransform()

virtual void InDetDD::SiDetectorManager::addAlignableTransform ( int level,
const Identifier & id,
GeoAlignableTransform * xf )
pure virtual

Add alignable transforms.

No access to these, they will be changed by manager:

Implemented in InDetDD::PixelDetectorManager, InDetDD::SCT_DetectorManager, PixelDetectorManager, and SCT_DetectorManager.

◆ 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

◆ addDesign()

const SiDetectorDesign * InDetDD::SiDetectorManager::addDesign ( std::unique_ptr< const SiDetectorDesign > && design)

Access to module design; returns an observer pointer.

Definition at line 134 of file SiDetectorManager.cxx.

135 {
136 m_designs.push_back(std::move(design));
137 return m_designs.back().get();
138 }
std::vector< std::unique_ptr< const SiDetectorDesign > > m_designs

◆ addDetectorElement()

virtual void InDetDD::SiDetectorManager::addDetectorElement ( SiDetectorElement * element)
pure virtual

◆ 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

◆ align() [1/2]

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

Definition at line 209 of file InDetDetectorManager.cxx.

210 {
211
212 ATH_MSG_DEBUG("align() called from an alignment CondAlg");
213 if (!getIdHelper()) return StatusCode::SUCCESS; // To Do: is it really a success?
214
215 bool alignmentChange = false;
216 // const AlignInfo &aligninfo = AlignInfo(m_alignfoldertype);
217
218 for(const auto& alignObj : alignObjects) {
219 const std::string& key = alignObj.first;
220
221 ATH_MSG_DEBUG(" Processing folder " << key);
222
223 if(m_globalFolders.find(key)!=m_globalFolders.end()) {
224 try {
225 // New global alignemnts
226 const CondAttrListCollection* obj = static_cast<const CondAttrListCollection*>(alignObj.second);
227 bool status = processGlobalAlignmentContainer(key,obj,alignStore);
228 alignmentChange = (alignmentChange || status);
229 } catch(std::runtime_error& err) {
230 // alignments should always exist so we return fatal if we could not process the alignment for this key
231 ATH_MSG_FATAL(err.what());
232 return StatusCode::FAILURE;
233 }
234 }
235 else if(m_folders.find(key)!=m_folders.end()) {
236 try {
237 // Regular alignemnts
238 const AlignableTransformContainer* container = static_cast<const AlignableTransformContainer*>(alignObj.second);
239 bool status = processAlignmentContainer(container,alignStore);
240 alignmentChange = (alignmentChange || status);
241 } catch(std::runtime_error& err) {
242 // alignments should always exist so we return fatal if we could not process the alignment for this key
243 ATH_MSG_FATAL(err.what());
244 return StatusCode::FAILURE;
245 }
246 }
247 else if(m_specialFolders.find(key)!=m_specialFolders.end()) {
248 try {
249 // Detector specific alignments
250 const CondAttrListCollection *obj =
251 static_cast<const CondAttrListCollection*>(alignObj.second);
252 bool status = processSpecialAlignment(key, obj, alignStore);
253 alignmentChange = (alignmentChange || status);
254 }
255 catch(std::runtime_error& err) {
256 // Should always exist if the folder was requested so we return fatal if
257 // we could not process the alignment for this key
258 ATH_MSG_FATAL(err.what());
259 return StatusCode::FAILURE;
260 }
261 }
262 else {
263 // Should not be any other keys specified in raw alignment object.
264 ATH_MSG_ERROR("Unrecognized folder name "<<key<<". Expected names are:");
265 for (const std::string& out:m_globalFolders) ATH_MSG_ERROR("--"<<out);
266 for (const std::string& out:m_folders) ATH_MSG_ERROR("--"<<out);
267 for (const std::string& out:m_specialFolders) ATH_MSG_ERROR("--"<<out);
268
269 return StatusCode::RECOVERABLE;
270 }
271 }
272 return StatusCode::SUCCESS;
273 }
CondMultChanCollection< AlignableTransform > AlignableTransformContainer
#define ATH_MSG_ERROR(x)
#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
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 ( IOVSVC_CALLBACK_ARGS )
inherited

◆ getDesign()

const SiDetectorDesign * InDetDD::SiDetectorManager::getDesign ( int i) const

Definition at line 146 of file SiDetectorManager.cxx.

147 {
148 return m_designs[i].get();
149 }

◆ getDetectorElement() [1/2]

virtual const SiDetectorElement * InDetDD::SiDetectorManager::getDetectorElement ( const Identifier & id) const
pure virtual

access to individual elements using Identifier or IdentiferHash

Implemented in InDetDD::PixelDetectorManager, InDetDD::SCT_DetectorManager, PixelDetectorManager, and SCT_DetectorManager.

◆ getDetectorElement() [2/2]

virtual const SiDetectorElement * InDetDD::SiDetectorManager::getDetectorElement ( const IdentifierHash & idHash) const
pure virtual

◆ getDetectorElementBegin() [1/2]

virtual SiDetectorElementCollection::const_iterator InDetDD::SiDetectorManager::getDetectorElementBegin ( ) const
pure virtual

◆ getDetectorElementBegin() [2/2]

virtual SiDetectorElementCollection::iterator InDetDD::SiDetectorManager::getDetectorElementBegin ( )
pure virtual

◆ getDetectorElementCollection()

virtual const SiDetectorElementCollection * InDetDD::SiDetectorManager::getDetectorElementCollection ( ) const
pure virtual

◆ getDetectorElementEnd() [1/2]

virtual SiDetectorElementCollection::const_iterator InDetDD::SiDetectorManager::getDetectorElementEnd ( ) const
pure virtual

◆ getDetectorElementEnd() [2/2]

virtual SiDetectorElementCollection::iterator InDetDD::SiDetectorManager::getDetectorElementEnd ( )
pure virtual

◆ getIdHelper()

virtual const AtlasDetectorID * InDetDD::InDetDetectorManager::getIdHelper ( ) const
privatepure virtualinherited

◆ 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

◆ 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()

virtual bool InDetDD::InDetDetectorManager::identifierBelongs ( const Identifier & id) const
pure virtualinherited

◆ 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)

◆ initNeighbours()

virtual void InDetDD::SiDetectorManager::initNeighbours ( )
pure virtual

Initialize the neighbours.

This can only be done when all elements are built

Implemented in InDetDD::PixelDetectorManager, InDetDD::SCT_DetectorManager, PixelDetectorManager, and SCT_DetectorManager.

◆ invalidateAll()

void InDetDD::SiDetectorManager::invalidateAll ( )
virtual

Invalidate cache for all detector elements.

Implements InDetDD::InDetDetectorManager.

Definition at line 39 of file SiDetectorManager.cxx.

40 {
42 element_iter != getDetectorElementEnd();
43 ++element_iter) {
44
45 if (*element_iter) {
46 (*element_iter)->invalidate();
47 }
48 }
49 }
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
virtual SiDetectorElementCollection::const_iterator getDetectorElementEnd() const =0
virtual SiDetectorElementCollection::const_iterator getDetectorElementBegin() const =0

◆ isPixel()

virtual bool InDetDD::SiDetectorManager::isPixel ( ) const
pure virtual

Methods to query which manager we have.

Implemented in InDetDD::PixelDetectorManager, InDetDD::SCT_DetectorManager, PixelDetectorManager, and SCT_DetectorManager.

◆ isSCT()

bool InDetDD::SiDetectorManager::isSCT ( ) const
inline

Definition at line 100 of file SiDetectorManager.h.

100{return !isPixel();}
virtual bool isPixel() const =0
Methods to query which manager we have.

◆ 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 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
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 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ 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 (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ numDesigns()

int InDetDD::SiDetectorManager::numDesigns ( ) const

Definition at line 140 of file SiDetectorManager.cxx.

141 {
142 return m_designs.size();
143 }

◆ numerology() [1/2]

SiNumerology & InDetDD::SiDetectorManager::numerology ( )
inline

Definition at line 129 of file SiDetectorManager.h.

129{return m_numerology;}

◆ numerology() [2/2]

const SiNumerology & InDetDD::SiDetectorManager::numerology ( ) const
inline

Access Numerology.

Definition at line 128 of file SiDetectorManager.h.

128{return m_numerology;}

◆ operator=()

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

◆ processAlignmentContainer() [1/2]

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

Definition at line 303 of file InDetDetectorManager.cxx.

304 {
305 bool alignmentChange = false;
306
307 // Check if container is empty - this can occur if it is an invalid IOV.
308 if (container->empty()) {
309 ATH_MSG_ERROR("AlignableTransformContainer "
310 << " is empty. Probably due to out of range IOV"); // To Do: add key to this printout for making it more informative
311 // This should not occur in normal situations so we force job to abort.
312 throw std::runtime_error("Unable to apply Inner Detector alignments.");
313 }
314 // loop over all the AlignableTransform objects in the collection
315 // use only the last ones.
316 // /Indet/AlignL3/SCTEA9 appear repeatedly in tags of the /Indet/AlignL3 folder
317 std::map<const std::string, const AlignableTransform*> stringToTransform;
318 for (const auto *pat : *container) {
319 stringToTransform[pat->tag()] = pat;
320 }
321 for (const std::pair<const std::string, const AlignableTransform*>& value: stringToTransform) {
322 bool status = processKey(value.first, value.second, alignStore);
323 alignmentChange = (alignmentChange || status);
324 }
325 return alignmentChange;
326 }
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 275 of file InDetDetectorManager.cxx.

276 {
277 bool alignmentChange = false;
278
279 ATH_MSG_DEBUG("Dealing with key as container");
280 const AlignableTransformContainer* container;
281 if (StatusCode::SUCCESS!=m_detStore->retrieve(container, key)) {
282 ATH_MSG_ERROR("Cannot find AlignableTransformContainer for key "
283 << key << " - no misalignment");
284 // This should not occur in normal situations so we force job to abort.
285 throw std::runtime_error("Unable to apply Inner Detector alignments");
286 }
287 // Check if container is empty - this can occur if it is an invalid IOV.
288 if (container->empty()) {
289 ATH_MSG_ERROR("AlignableTransformContainer for key "
290 << key << " is empty. Probably due to out of range IOV");
291 // This should not occur in normal situations so we force job to abort.
292 throw std::runtime_error("Unable to apply Inner Detector alignments.");
293 }
294 // loop over all the AlignableTransform objects in the collection
295 for (const auto *pat : *container) {
296
297 bool status = processKey(pat->tag(),pat);
298 alignmentChange = (alignmentChange || status);
299 }
300 return alignmentChange;
301 }

◆ processGlobalAlignment()

bool InDetDD::InDetDetectorManager::processGlobalAlignment ( const std::string & key,
int level,
FrameType frame,
const CondAttrListCollection * obj = nullptr,
GeoVAlignmentStore * alignStore = nullptr ) const
privatevirtualinherited

◆ processGlobalAlignmentContainer()

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

Definition at line 391 of file InDetDetectorManager.cxx.

394 {
395 bool alignmentChange = false;
396
397 ATH_MSG_DEBUG("processing GlobalAlignmentContainer with key: " << key);
398 // From the key determine what level in hierarchy we are dealing with.
399 // returns -1 if unrecognized.
400 const LevelInfo & levelInfo = getLevel(key);
401 if (levelInfo.isValid()) {
402 ATH_MSG_VERBOSE("Processing channel: " << key);
403 } else {
404 ATH_MSG_DEBUG("Channel " << key << " not registered in this manager");
405 }
406 // return silently if unrecognised - this can happen in container mode
407 // when a single container holds transforms for both pixel and SCT
408 if (!levelInfo.isValid() ) return false;
409
410 // Within detector specific code
411 bool status = processGlobalAlignment(key, levelInfo.level(), levelInfo.frame(), obj, alignStore);
412
413 alignmentChange = (alignmentChange || status);
414
415 return alignmentChange;
416
417 }
#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 328 of file InDetDetectorManager.cxx.

331 {
332 bool alignmentChange = false;
333
334 // From the key determine what level in hierarchy we are dealing with.
335 // returns -1 if unrecognized.
336 const LevelInfo & levelInfo = getLevel(key);
337 if (levelInfo.isValid()) {
338 ATH_MSG_VERBOSE("Processing channel: " << key);
339 } else {
340 ATH_MSG_DEBUG("Channel " << key << " not registered in this manager");
341 }
342 // return silently if unrecognised - this can happen in container mode
343 // when a single container holds transforms for both pixel and SCT
344 if (!levelInfo.isValid() ) return false;
345
346 //Loop over the effected nodes.
347 for (AlignableTransform::AlignTransMem_citr trans_iter = transformCollection->begin();
348 trans_iter != transformCollection->end();
349 ++trans_iter) {
350 ATH_MSG_DEBUG( "Get alignment for identifier "
351 << getIdHelper()->show_to_string(trans_iter->identify())
352 << " at level " << levelInfo.level());
353
354 // The delta in the conditions DB is not necessarily the same as what is needed in the
355 // alignable transform. At the moment we support global frame, local frame or an alternative frame
356 // The setAlignableTransformDelta method takes care of this correction - this is CLHEP <--> Amg interfaced
357 bool status = setAlignableTransformDelta(levelInfo.level(),
358 trans_iter->identify(),
359 Amg::CLHEPTransformToEigen(trans_iter->transform()),
360 levelInfo.frame(),
361 alignStore);
362
363 alignmentChange = (alignmentChange || status);
364
365 if (!status) {
366 if (!identifierBelongs(trans_iter->identify())) {
367 // Its probably OK. Eg /Indet/Align/ID contains alse pixel and sct ids.
368 ATH_MSG_DEBUG("Cannot set AlignableTransform for identifier."
369 << " Probably OK if its /Indet/Align/ID folder. "
370 << getIdHelper()->show_to_string(trans_iter->identify())
371 << " at level " << levelInfo.level());
372 } else {
373 if (m_suppressWarnings) {
374 ATH_MSG_DEBUG("WARNING: Cannot set AlignableTransform for identifier "
375 << getIdHelper()->show_to_string(trans_iter->identify())
376 << " at level " << levelInfo.level());
377 } else {
378 ATH_MSG_WARNING("Cannot set AlignableTransform for identifier "
379 << getIdHelper()->show_to_string(trans_iter->identify())
380 << " at level " << levelInfo.level());
381 ATH_MSG_WARNING("Subsequent WARNINGS will be printed at DEBUG level.");
382 m_suppressWarnings = true;
383 }
384 }
385 }
386 }
387 return alignmentChange;
388 }
#define ATH_MSG_WARNING(x)
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...
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.

◆ processSpecialAlignment() [1/2]

virtual bool InDetDD::InDetDetectorManager::processSpecialAlignment ( const std::string & key,
const CondAttrListCollection * obj = nullptr,
GeoVAlignmentStore * alignStore = nullptr ) const
privatepure virtualinherited

◆ processSpecialAlignment() [2/2]

bool InDetDD::InDetDetectorManager::processSpecialAlignment ( const std::string & key,
InDetDD::AlignFolderType alignfolder )
privatepure virtualinherited

◆ setAlignableTransformDelta()

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

◆ setAlignableTransformGlobalDelta()

bool InDetDD::SiDetectorManager::setAlignableTransformGlobalDelta ( ExtendedAlignableTransform * extXF,
const Amg::Transform3D & delta,
GeoVAlignmentStore * alignStore = nullptr )
static

Helper method to set delta transform from a global delta - Amg interface.

Definition at line 101 of file SiDetectorManager.cxx.

103 {
104 // ATTENTION -------------------------------------------------------- (A.S.)
105 // CLHEP < -- > AMG interface method
106
107 // Sets the alignable transform delta when the supplied delta is in the global frame.
108
109 // If the default transform down to the alignable transform is
110 // T = A*B*C
111 // and the alignable transform is C with delta c and the delta in the global frame is g, then
112 // A*B*C*c = g*A*B*C
113 // T*c = g*T
114 // c = T.inverse() * g * T
115
116 // To get default transform up and including the alignable transform,
117 // we assume the next volume down is a fullphys volume and so its
118 // transform is the transform we want (ie T=A*B*C in the above example).
119
120
121 if (!extXF) return false;
122
123 const GeoVFullPhysVol * child = extXF->child();
124 if (child && extXF->alignableTransform()) {
125 // do the calculation in CLHEP
126 const GeoTrf::Transform3D& transform = child->getDefAbsoluteTransform(alignStore);
127 extXF->alignableTransform()->setDelta(transform.inverse() * delta * transform, alignStore);
128 return true;
129 } else {
130 return false;
131 }
132 }
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.

◆ setAlignableTransformLocalDelta()

bool InDetDD::SiDetectorManager::setAlignableTransformLocalDelta ( ExtendedAlignableTransform * extXF,
const Amg::Transform3D & localToGlobalXF,
const Amg::Transform3D & delta,
GeoVAlignmentStore * alignStore = nullptr )
static

Helper method to set delta transform from a local delta - Amg interface.

Definition at line 62 of file SiDetectorManager.cxx.

66 {
67 // ATTENTION -------------------------------------------------------- (A.S.)
68 // CLHEP < -- > AMG interface method
69
70 // Sets the alignable transform delta when the supplied delta is in the local
71 // reconstruction frame
72
73 // If the default transform to the local recostruction frame is
74 // T = A*B*C*D*E
75 // and the alignable transform is C with delta c and the delat in the local frame is l, then
76 // A*B*C*c*D*E = A*B*C*D*E*l
77 // c = (D*E) * l * (D*E).inverse()
78 // c = (A*B*C).inverse * T * l * T.inverse() * (A*B*C)
79
80 // To get default transform up and including the alignable transform,
81 // we assume the next volume down is a fullphys volume and so its
82 // transform is the transform we want (ie A*B*C in the above example).
83
84 if (!extXF) return false;
85
86 const GeoVFullPhysVol* child = extXF->child();
87 if (child && extXF->alignableTransform()) {
88 // the definitiv absolut transform is in CLHEP -> do the calculation in CLHEP
89 const GeoTrf::Transform3D& transform = child->getDefAbsoluteTransform(alignStore);
90 // calucluate the corrected delta according to the formula above
91 GeoTrf::Transform3D correctedDelta = transform.inverse()*localToGlobalXF // (A*B*C).inverse() * T
92 * delta // l
93 * localToGlobalXF.inverse() * transform; // T.inverse() * (A*B*C)
94 extXF->alignableTransform()->setDelta(correctedDelta, alignStore);
95 return true;
96 } else {
97 return false;
98 }
99 }

◆ setCommonItems()

void InDetDD::SiDetectorManager::setCommonItems ( std::unique_ptr< const SiCommonItems > && commonItems)

Set SiCommonItems.

Definition at line 151 of file SiDetectorManager.cxx.

152 {
153 m_commonItems = std::move(commonItems);
154 }
std::unique_ptr< const SiCommonItems > m_commonItems

◆ 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 }

◆ tag()

const std::string & InDetDD::SiDetectorManager::tag ( ) const

Get tag used in dictionary.

Definition at line 34 of file SiDetectorManager.cxx.

35 {
36 return m_tag;
37 }

◆ updateAll()

void InDetDD::SiDetectorManager::updateAll ( ) const
virtual

Update all caches.

Implements InDetDD::InDetDetectorManager.

Definition at line 51 of file SiDetectorManager.cxx.

52 {
54 element_iter != getDetectorElementEnd();
55 ++element_iter) {
56 if (*element_iter) {
57 (*element_iter)->updateCache();
58 }
59 }
60 }
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_alignfoldertype

AlignFolderType InDetDD::InDetDetectorManager::m_alignfoldertype
inherited

Definition at line 96 of file InDetDetectorManager.h.

◆ m_commonItems

std::unique_ptr<const SiCommonItems> InDetDD::SiDetectorManager::m_commonItems
private

Definition at line 151 of file SiDetectorManager.h.

◆ m_designs

std::vector<std::unique_ptr<const SiDetectorDesign> > InDetDD::SiDetectorManager::m_designs
private

Definition at line 150 of file SiDetectorManager.h.

◆ m_detStore

StoreGateSvc* InDetDD::InDetDetectorManager::m_detStore
protectedinherited

Definition at line 99 of file InDetDetectorManager.h.

◆ m_folders

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

Definition at line 182 of file InDetDetectorManager.h.

◆ m_globalFolders

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

Definition at line 184 of file InDetDetectorManager.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 181 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

SiNumerology InDetDD::SiDetectorManager::m_numerology
private

Definition at line 149 of file SiDetectorManager.h.

◆ m_specialFolders

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

Definition at line 183 of file InDetDetectorManager.h.

◆ m_suppressWarnings

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

Definition at line 100 of file InDetDetectorManager.h.

◆ m_tag

std::string InDetDD::SiDetectorManager::m_tag
private

Definition at line 148 of file SiDetectorManager.h.

◆ m_version

Version InDetDD::InDetDetectorManager::m_version
privateinherited

Definition at line 180 of file InDetDetectorManager.h.

◆ s_invalidLevel

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

Definition at line 186 of file InDetDetectorManager.h.


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