ATLAS Offline Software
SCT_ComponentFactory.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SCT_GEOMODEL_SCT_COMPONENTFACTORY_H
6 #define SCT_GEOMODEL_SCT_COMPONENTFACTORY_H
7 
9 #include <string>
10 #include <map>
11 #include <memory>
12 
13 namespace InDetDD{class SCT_DetectorManager;}
16 
17 class GeoLogVol;
18 class GeoVPhysVol;
19 class GeoFullPhysVol;
20 class GeoAlignableTransform;
21 
22 namespace GeoModelIO {
23  class ReadGeoModel;
24 }
25 
27 {
28 
29 public:
30  SCT_ComponentFactory(const std::string & name,
31  InDetDD::SCT_DetectorManager* detectorManager,
32  SCT_GeometryManager* geometryManager,
33  SCT_MaterialManager* materials);
34 
35  const std::string & getName() const {return m_name;}
36 
37  // utility function to covert int to string
38  std::string intToString(int i) const;
39 
40 protected:
44 
45  double epsilon() const;
46  virtual ~SCT_ComponentFactory();
47 
48 private:
49  std::string m_name;
50  static const double s_epsilon;
51 
52 };
53 
54 
56 {
57 
58 public:
59  SCT_SharedComponentFactory(const std::string & name,
60  InDetDD::SCT_DetectorManager* detectorManager,
61  SCT_GeometryManager* geometryManager,
62  SCT_MaterialManager* materials=nullptr) :
63  SCT_ComponentFactory(name, detectorManager, geometryManager, materials),
64  m_physVolume(nullptr)
65  {};
66 
67  GeoVPhysVol * getVolume() {return m_physVolume;}
68 
69 protected:
70  GeoVPhysVol * m_physVolume;
71  virtual GeoVPhysVol * build() = 0;
72 
73 };
74 
76 {
77 
78 public:
79  SCT_UniqueComponentFactory(const std::string & name,
80  InDetDD::SCT_DetectorManager* detectorManager,
81  SCT_GeometryManager* geometryManager,
82  SCT_MaterialManager* materials=nullptr,
83  GeoModelIO::ReadGeoModel* sqliteReader=nullptr,
84  std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV=nullptr,
85  std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX=nullptr);
86 
87  virtual GeoVPhysVol * build(SCT_Identifier id) = 0;
88 
89 protected:
90  const GeoLogVol * m_logVolume;
91  GeoModelIO::ReadGeoModel* m_sqliteReader;
92 
93  virtual const GeoLogVol * preBuild() = 0;
94 
95  std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> m_mapFPV;
96  std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> m_mapAX;
97 
98 };
99 
100 #endif // SCT_GEOMODEL_SCT_COMPONENTFACTORY_H
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition: SCT_ComponentFactory.h:42
SCT_MaterialManager
Definition: SCT_MaterialManager.h:21
SCT_Identifier
Definition: SCT_Identifier.h:12
SCT_ComponentFactory::m_name
std::string m_name
Definition: SCT_ComponentFactory.h:49
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
SCT_UniqueComponentFactory::m_mapFPV
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
Definition: SCT_ComponentFactory.h:95
SCT_Identifier.h
SCT_UniqueComponentFactory::m_mapAX
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
Definition: SCT_ComponentFactory.h:96
SCT_ComponentFactory
Definition: SCT_ComponentFactory.h:27
SCT_UniqueComponentFactory::SCT_UniqueComponentFactory
SCT_UniqueComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials=nullptr, GeoModelIO::ReadGeoModel *sqliteReader=nullptr, std::shared_ptr< std::map< std::string, GeoFullPhysVol * >> mapFPV=nullptr, std::shared_ptr< std::map< std::string, GeoAlignableTransform * >> mapAX=nullptr)
Definition: SCT_ComponentFactory.cxx:44
SCT_ComponentFactory::m_detectorManager
InDetDD::SCT_DetectorManager * m_detectorManager
Definition: SCT_ComponentFactory.h:41
SCT_ComponentFactory::epsilon
double epsilon() const
Definition: SCT_ComponentFactory.cxx:38
SCT_UniqueComponentFactory::build
virtual GeoVPhysVol * build(SCT_Identifier id)=0
SCT_ComponentFactory::~SCT_ComponentFactory
virtual ~SCT_ComponentFactory()
Definition: SCT_ComponentFactory.cxx:26
lumiFormat.i
int i
Definition: lumiFormat.py:85
SCT_SharedComponentFactory::getVolume
GeoVPhysVol * getVolume()
Definition: SCT_ComponentFactory.h:67
SCT_ComponentFactory::intToString
std::string intToString(int i) const
Definition: SCT_ComponentFactory.cxx:30
SCT_ComponentFactory::s_epsilon
static const double s_epsilon
Definition: SCT_ComponentFactory.h:50
GeoModelIO
Definition: IGeoDbTagSvc.h:12
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition: SCT_ComponentFactory.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SCT_SharedComponentFactory::m_physVolume
GeoVPhysVol * m_physVolume
Definition: SCT_ComponentFactory.h:70
SCT_SharedComponentFactory::SCT_SharedComponentFactory
SCT_SharedComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials=nullptr)
Definition: SCT_ComponentFactory.h:59
SCT_UniqueComponentFactory::m_logVolume
const GeoLogVol * m_logVolume
Definition: SCT_ComponentFactory.h:90
SCT_UniqueComponentFactory
Definition: SCT_ComponentFactory.h:76
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
SCT_UniqueComponentFactory::preBuild
virtual const GeoLogVol * preBuild()=0
SCT_SharedComponentFactory
Definition: SCT_ComponentFactory.h:56
SCT_SharedComponentFactory::build
virtual GeoVPhysVol * build()=0
SCT_ComponentFactory::SCT_ComponentFactory
SCT_ComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
Definition: SCT_ComponentFactory.cxx:16
SCT_UniqueComponentFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition: SCT_ComponentFactory.h:91
SCT_ComponentFactory::getName
const std::string & getName() const
Definition: SCT_ComponentFactory.h:35
SCT_GeometryManager
Definition: SCT_GeometryManager.h:25