ATLAS Offline Software
InDetDetectorManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // InDetDectorManager.h
8 // (c) ATLAS Detector software
10 
11 #ifndef INDETREADOUTGEOMETRY_INDETDETECTORMANAGER_H
12 #define INDETREADOUTGEOMETRY_INDETDETECTORMANAGER_H
13 
14 // Amg
16 // GeoModel stuff
17 #include "GeoModelKernel/GeoVDetectorManager.h"
20 #include "CLHEP/Geometry/Transform3D.h"
21 
22 // IOV SVC for alignment:
23 #include "AthenaKernel/IIOVSvc.h"
24 
27 
28 #include <atomic>
29 #include <string>
30 #include <map>
31 #include <set>
32 #include <list>
33 
34 class StoreGateSvc;
35 class AlignableTransform;
36 class Identifier;
37 class AtlasDetectorID;
38 class GeoVAlignmentStore;
40 
41 namespace InDetDD {
42 
43  typedef std::map<std::string, const void*> RawAlignmentObjects;
44 
60  class InDetDetectorManager : public GeoVDetectorManager, public AthMessaging {
61 
62  public:
63 
64  // Constructor
65  InDetDetectorManager(StoreGateSvc * detStore, const std::string & name);
66 
67  // Destructor
69 
70 
72  const Version & getVersion() const;
73  const std::string & getLayout() const; // eg Initial, Final, TestBeam
74  void setVersion(const Version & version);
75 
77  void addChannel(const std::string & key, int level, FrameType frame);
78  void addFolder(const std::string & key);
79  void addSpecialFolder(const std::string & key);
80  void addGlobalFolder(const std::string & key);
81  void addAlignFolderType(const AlignFolderType alignfolder);
82 
84 
85  StatusCode align(const RawAlignmentObjects& alignObjects, GeoVAlignmentStore* alignStore) const;
86 
88  virtual void invalidateAll() const = 0;
89 
91  virtual void updateAll() const = 0;
92 
94  virtual bool identifierBelongs(const Identifier & id) const = 0;
95 
97 
98  protected:
100  mutable std::atomic_bool m_suppressWarnings;
101 
102  private:
106  class LevelInfo {
107 
108  private:
109  int m_level;
111 
112  public:
115 
116  int level() const {return m_level;}
117  FrameType frame() const {return m_type;}
118  bool isGlobalDelta() const {return m_type == InDetDD::global;}
119  bool isLocalDelta() const {return m_type == InDetDD::local;}
120  bool isValid() const {return (m_level >= 0);}
121  };
122 
123  class AlignInfo {
124 
125  private:
127 
128  public:
130  AlignInfo(AlignFolderType alignfolder): m_aligntype(alignfolder) {};
132  bool isValidAlign() const {return (m_aligntype != InDetDD::none);}
133 
134  };
135 
136 
138  const LevelInfo & getLevel(const std::string & key) const;
139 
141  // InDetDD::AlignFolderType getAlignInfo();
142 
144  bool processAlignmentContainer(const std::string & key) const;
145  bool processAlignmentContainer(const AlignableTransformContainer* container, GeoVAlignmentStore* alignStore) const;
146 
149  bool processKey(const std::string& key,
150  const AlignableTransform* transformCollection,
151  GeoVAlignmentStore* alignStore=nullptr) const;
152 
156  const Identifier & id,
157  const Amg::Transform3D & delta,
158  FrameType frame,
159  GeoVAlignmentStore* alignStore=nullptr) const = 0;
160 
161  virtual bool processSpecialAlignment(const std::string & key,
162  InDetDD::AlignFolderType alignfolder) const = 0;
163 
164  virtual bool processSpecialAlignment(const std::string& key,
165  const CondAttrListCollection* obj=nullptr,
166  GeoVAlignmentStore* alignStore=nullptr) const = 0;
167 
168  bool processGlobalAlignmentContainer(const std::string & key,
169  const CondAttrListCollection* obj=nullptr,
170  GeoVAlignmentStore* alignStore=nullptr) const;
171 
172  virtual bool processGlobalAlignment(const std::string & key, int level, FrameType frame,
173  const CondAttrListCollection* obj=nullptr,
174  GeoVAlignmentStore* alignStore=nullptr) const;
175 
176  virtual const AtlasDetectorID* getIdHelper() const = 0;
177 
179  std::map<std::string, LevelInfo> m_keys;
180  std::set<std::string> m_folders;
181  std::set<std::string> m_specialFolders;
182  std::set<std::string> m_globalFolders; // new time-dependent global folders
183 
184  static const LevelInfo s_invalidLevel;
185  };
186 
187 } // namespace InDetDD
188 
189 #endif // INDETREADOUTGEOMETRY_INDETDETECTORMANAGER_H
InDetDD::FrameType
FrameType
Definition: InDetDD_Defs.h:16
InDetDD::InDetDetectorManager::addSpecialFolder
void addSpecialFolder(const std::string &key)
Definition: InDetDetectorManager.cxx:71
InDetDD::InDetDetectorManager::identifierBelongs
virtual bool identifierBelongs(const Identifier &id) const =0
Check identifier is for this detector.
CondMultChanCollection
A CondMultChanCollection is a template class which can hold a collection of T* objects which are inte...
Definition: CondMultChanCollection.h:52
InDetDD::InDetDetectorManager::getIdHelper
virtual const AtlasDetectorID * getIdHelper() const =0
InDetDD::RawAlignmentObjects
std::map< std::string, const void * > RawAlignmentObjects
Definition: InDetDetectorManager.h:43
InDetDD::InDetDetectorManager::m_suppressWarnings
std::atomic_bool m_suppressWarnings
Definition: InDetDetectorManager.h:100
InDetDD::InDetDetectorManager::setVersion
void setVersion(const Version &version)
Definition: InDetDetectorManager.cxx:43
InDetDD::Version
Definition: Version.h:24
InDetDD::InDetDetectorManager::invalidateAll
virtual void invalidateAll() const =0
Invalidate cache for all detector elements.
InDetDD::global
@ global
Definition: InDetDD_Defs.h:16
InDetDD::InDetDetectorManager::~InDetDetectorManager
virtual ~InDetDetectorManager()
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
IOVSVC_CALLBACK_ARGS
#define IOVSVC_CALLBACK_ARGS
short hand for IOVSvc call back argument list, to be used when no access to formal arguments is neede...
Definition: IOVSvcDefs.h:24
InDetDD::InDetDetectorManager::addAlignFolderType
void addAlignFolderType(const AlignFolderType alignfolder)
Definition: InDetDetectorManager.cxx:81
InDetDD::InDetDetectorManager::m_keys
std::map< std::string, LevelInfo > m_keys
Definition: InDetDetectorManager.h:179
InDetDD::InDetDetectorManager::getLevel
const LevelInfo & getLevel(const std::string &key) const
Retrieve level information.
Definition: InDetDetectorManager.cxx:87
InDetDD::InDetDetectorManager::updateAll
virtual void updateAll() const =0
Update all caches.
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
Version.h
GeoPrimitives.h
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
InDetDD::InDetDetectorManager::AlignInfo::m_aligntype
AlignFolderType m_aligntype
Definition: InDetDetectorManager.h:126
InDetDD_Defs.h
InDetDD::InDetDetectorManager::LevelInfo::isValid
bool isValid() const
Definition: InDetDetectorManager.h:120
InDetDD::InDetDetectorManager::LevelInfo::level
int level() const
Definition: InDetDetectorManager.h:116
InDetDD::InDetDetectorManager::LevelInfo::frame
FrameType frame() const
Definition: InDetDetectorManager.h:117
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDetDD::InDetDetectorManager::AlignInfo::AlignInfo
AlignInfo()
Definition: InDetDetectorManager.h:129
AlignableTransformContainer.h
InDetDD::InDetDetectorManager::addFolder
void addFolder(const std::string &key)
Definition: InDetDetectorManager.cxx:66
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetDD::InDetDetectorManager::m_globalFolders
std::set< std::string > m_globalFolders
Definition: InDetDetectorManager.h:182
InDetDD::InDetDetectorManager::getLayout
const std::string & getLayout() const
Definition: InDetDetectorManager.cxx:38
InDetDD::InDetDetectorManager::getVersion
const Version & getVersion() const
Get version information.
Definition: InDetDetectorManager.cxx:33
InDetDD::InDetDetectorManager
Definition: InDetDetectorManager.h:60
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
InDetDD::InDetDetectorManager::s_invalidLevel
static const LevelInfo s_invalidLevel
Definition: InDetDetectorManager.h:184
InDetDD::InDetDetectorManager::addGlobalFolder
void addGlobalFolder(const std::string &key)
Definition: InDetDetectorManager.cxx:76
InDetDD::InDetDetectorManager::AlignInfo::AlignFolder
AlignFolderType AlignFolder() const
Definition: InDetDetectorManager.h:131
InDetDD::none
@ none
Definition: InDetDD_Defs.h:19
InDetDD::InDetDetectorManager::LevelInfo::m_type
FrameType m_type
Definition: InDetDetectorManager.h:110
InDetDD::InDetDetectorManager::m_detStore
StoreGateSvc * m_detStore
Definition: InDetDetectorManager.h:99
InDetDD::InDetDetectorManager::setAlignableTransformDelta
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...
InDetDD::InDetDetectorManager::processSpecialAlignment
virtual bool processSpecialAlignment(const std::string &key, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const =0
AlignableTransform
Definition: AlignableTransform.h:24
InDetDD::local
@ local
Definition: InDetDD_Defs.h:16
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::InDetDetectorManager::LevelInfo::LevelInfo
LevelInfo()
Definition: InDetDetectorManager.h:113
InDetDD::InDetDetectorManager::m_folders
std::set< std::string > m_folders
Definition: InDetDetectorManager.h:180
InDetDD::InDetDetectorManager::LevelInfo::isLocalDelta
bool isLocalDelta() const
Definition: InDetDetectorManager.h:119
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDetDD::InDetDetectorManager::align
StatusCode align(IOVSVC_CALLBACK_ARGS) const
InDetDD::InDetDetectorManager::LevelInfo::m_level
int m_level
Definition: InDetDetectorManager.h:109
InDetDD::InDetDetectorManager::processGlobalAlignment
virtual bool processGlobalAlignment(const std::string &key, int level, FrameType frame, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const
Definition: InDetDetectorManager.cxx:424
InDetDD::InDetDetectorManager::AlignInfo::AlignInfo
AlignInfo(AlignFolderType alignfolder)
Definition: InDetDetectorManager.h:130
InDetDD::InDetDetectorManager::processKey
bool processKey(const std::string &key, const AlignableTransform *transformCollection, GeoVAlignmentStore *alignStore=nullptr) const
Called by processAlignmentContainer, applies only one key on the transform Collections.
Definition: InDetDetectorManager.cxx:332
IIOVSvc.h
InDetDD::InDetDetectorManager::LevelInfo::isGlobalDelta
bool isGlobalDelta() const
Definition: InDetDetectorManager.h:118
get_generator_info.version
version
Definition: get_generator_info.py:33
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::InDetDetectorManager::AlignInfo::isValidAlign
bool isValidAlign() const
Definition: InDetDetectorManager.h:132
InDetDD::InDetDetectorManager::m_specialFolders
std::set< std::string > m_specialFolders
Definition: InDetDetectorManager.h:181
AthMessaging.h
InDetDD::InDetDetectorManager::processAlignmentContainer
bool processAlignmentContainer(const std::string &key) const
return align folder string to use
Definition: InDetDetectorManager.cxx:279
InDetDD::InDetDetectorManager::m_version
Version m_version
Definition: InDetDetectorManager.h:178
InDetDD::InDetDetectorManager::AlignInfo
Definition: InDetDetectorManager.h:123
InDetDD::InDetDetectorManager::processGlobalAlignmentContainer
bool processGlobalAlignmentContainer(const std::string &key, const CondAttrListCollection *obj=nullptr, GeoVAlignmentStore *alignStore=nullptr) const
Definition: InDetDetectorManager.cxx:395
InDetDD::InDetDetectorManager::m_alignfoldertype
AlignFolderType m_alignfoldertype
Definition: InDetDetectorManager.h:96
InDetDD::InDetDetectorManager::InDetDetectorManager
InDetDetectorManager(StoreGateSvc *detStore, const std::string &name)
Definition: InDetDetectorManager.cxx:20
InDetDD::InDetDetectorManager::addChannel
void addChannel(const std::string &key, int level, FrameType frame)
Alignment access.
Definition: InDetDetectorManager.cxx:56
InDetDD::InDetDetectorManager::LevelInfo::LevelInfo
LevelInfo(int level, FrameType frame)
Definition: InDetDetectorManager.h:114
python.PyAthena.obj
obj
Definition: PyAthena.py:132
InDetDD::InDetDetectorManager::processSpecialAlignment
virtual bool processSpecialAlignment(const std::string &key, InDetDD::AlignFolderType alignfolder) const =0
Definition: InDetDetectorManager.cxx:432
InDetDD::AlignFolderType
AlignFolderType
Definition: InDetDD_Defs.h:19
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
InDetDD::InDetDetectorManager::LevelInfo
Definition: InDetDetectorManager.h:106
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14