ATLAS Offline Software
ALFA_DetectorFactory.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ALFAGEOMODEL_ALFADETECTORFACTORY_H
6 #define ALFAGEOMODEL_ALFADETECTORFACTORY_H
7 
10 #include "GeoModelKernel/GeoAlignableTransform.h"
11 
12 #include "GeoModelKernel/GeoVDetectorFactory.h"
15 
16 #include <string>
17 #include <vector>
18 
19 class StoreGateSvc;
21 class IRDBRecordset;
22 class GeoShape;
23 class GeoPhysVol;
24 class GeoFullPhysVol;
25 
26 typedef struct _ALFAPHYSVOLUME {
27  GeoFullPhysVol* pPhysVolume;
30 
31 typedef struct _ALIGNPARAMETERS {
32  double fYOffset[RPOTSCNT] = {};
33  double fXOffset[RPOTSCNT] = {};
34  double fTheta[RPOTSCNT] = {};
36 
38 
39 typedef struct _CONFIGURATION {
41 
43  bool bAddIBP;
44 
45  std::vector<bool> bIsTransformInStation;
46  std::vector<bool> bIsTransformInDetector;
47  std::vector<double> pointTransformInDetectorB7L1U;
48  std::vector<double> pointTransformInDetectorB7L1L;
49  std::vector<double> pointTransformInDetectorA7L1U;
50  std::vector<double> pointTransformInDetectorA7L1L;
51  std::vector<double> pointTransformInDetectorB7R1U;
52  std::vector<double> pointTransformInDetectorB7R1L;
53  std::vector<double> pointTransformInDetectorA7R1U;
54  std::vector<double> pointTransformInDetectorA7R1L;
55  std::vector<double> vecTransformInDetectorB7L1U;
56  std::vector<double> vecTransformInDetectorB7L1L;
57  std::vector<double> vecTransformInDetectorA7L1U;
58  std::vector<double> vecTransformInDetectorA7L1L;
59  std::vector<double> vecTransformInDetectorB7R1U;
60  std::vector<double> vecTransformInDetectorB7R1L;
61  std::vector<double> vecTransformInDetectorA7R1U;
62  std::vector<double> vecTransformInDetectorA7R1L;
63  std::vector<double> vecTransformInStationB7L1U;
64  std::vector<double> vecTransformInStationB7L1L;
65  std::vector<double> vecTransformInStationA7L1U;
66  std::vector<double> vecTransformInStationA7L1L;
67  std::vector<double> vecTransformInStationB7R1U;
68  std::vector<double> vecTransformInStationB7R1L;
69  std::vector<double> vecTransformInStationA7R1U;
70  std::vector<double> vecTransformInStationA7R1L;
71 
72  void clear();
74 
75 class ALFA_DetectorFactory : public GeoVDetectorFactory
76 {
77  private:
78  // The managers:
82 
85  std::unique_ptr<ALFA_GeometryReader> m_pGeoReader;
86  std::list<eRPotName> m_ListExistingRPots;
87  std::map<std::string,const GeoMaterial*> m_MapMaterials;
88 
89 
90  public:
91  ALFA_DetectorFactory(StoreGateSvc *pDetStore,IRDBAccessSvc *pAccess, const PCONFIGURATION pConfig);
93 
94  // Creation of geometry:
95  virtual void create(GeoPhysVol *pWorld);
96  // Access to the results:
97  virtual const ALFA_DetectorManager * getDetectorManager() const { return m_pDetectorManager; }
98 
99  void UpdateTransforms(PALIGNPARAMETERS pAlignParams);
100  bool ReadGeometry(bool bAlignCorrections=false);
101 
102  private:
103  // Illegal operations:
106 
107  private:
108  void SaveGeometry();
109  void DefineMaterials (StoredMaterialManager* pMaterialManager);
110  void ConstructUFiberCladdings(const eRPotName eRPName, GeoFullPhysVol* pMotherVolume, const HepGeom::Transform3D& MotherTransform, GeoAlignableTransform* pDetTransform);
111  void ConstructVFiberCladdings(const eRPotName eRPName, GeoFullPhysVol* pMotherVolume, const HepGeom::Transform3D& MotherTransform, GeoAlignableTransform* pDetTransform);
112  void ConstructODFiberCladdings(const eRPotName eRPName, GeoFullPhysVol* pPhysMotherVolume, const HepGeom::Transform3D& MotherTransform, GeoAlignableTransform* pDetTransform);
113 
114  void ConstructODFibers00(const eRPotName eRPName, const int iODPlate, eFiberType eFType, GeoFullPhysVol* pMotherVolume, const HepGeom::Transform3D& MotherTransform, const HepGeom::Transform3D& TransODCladding);
115  void ConstructODFibers01(const eRPotName eRPName, const int iODPlate, eFiberType eFType, GeoFullPhysVol* pMotherVolume, const HepGeom::Transform3D& MotherTransform, const HepGeom::Transform3D& TransODCladding);
116  void SelectRPots();
117  void CreateAxes(GeoPhysVol* pMotherVolume);
118  void ConstructAlfaStations(std::map<eAStationName,ALFAPHYSVOLUME>* pmapActiveStations, GeoPhysVol* pWorld);
119  void ConstructBeampipe(GeoPhysVol* pWorld);
120  void AddBeamPipeInStation(GeoFullPhysVol* pPhysStation, const char* pszStationLabel);
121  void AddGlobalVacuumSensorInStation(GeoFullPhysVol* pPhysStation, eAStationName eStatName);
122 
123  GeoShape* CreateSolidRP();
124  GeoShape* CreateSolidAir();
125  GeoShape* CreateSolidTrigger();
126  GeoShape* CreateSolidRPSupport();
127  GeoShape* CreateSolidG10Shapes();
128  std::map<int,GeoShape*>* CreateSolidTiPlates();
129  std::map<int,GeoShape*>* CreateSolidODPlates();
130 
131  private:
134  HepGeom::Point3D<double> Point3DInDetector(eRPotName eRPName);
135 };
136 
137 #endif
ALFA_DetectorManager
Definition: ALFA_DetectorManager.h:16
ALFA_DetectorFactory::AddBeamPipeInStation
void AddBeamPipeInStation(GeoFullPhysVol *pPhysStation, const char *pszStationLabel)
Definition: ALFA_DetectorFactory.cxx:416
eFiberType
eFiberType
Definition: ALFA_GeometryReader.h:25
_CONFIGURATION::vecTransformInDetectorA7L1U
std::vector< double > vecTransformInDetectorA7L1U
Definition: ALFA_DetectorFactory.h:57
ALFA_DetectorFactory::create
virtual void create(GeoPhysVol *pWorld)
Definition: ALFA_DetectorFactory.cxx:691
_CONFIGURATION::vecTransformInDetectorB7L1L
std::vector< double > vecTransformInDetectorB7L1L
Definition: ALFA_DetectorFactory.h:56
ALFA_DetectorFactory::SaveGeometry
void SaveGeometry()
Definition: ALFA_DetectorFactory.cxx:155
_CONFIGURATION::pointTransformInDetectorA7L1L
std::vector< double > pointTransformInDetectorA7L1L
Definition: ALFA_DetectorFactory.h:50
_CONFIGURATION::pointTransformInDetectorA7R1L
std::vector< double > pointTransformInDetectorA7R1L
Definition: ALFA_DetectorFactory.h:54
_CONFIGURATION::vecTransformInStationB7R1U
std::vector< double > vecTransformInStationB7R1U
Definition: ALFA_DetectorFactory.h:67
ALFA_DetectorFactory::operator=
const ALFA_DetectorFactory & operator=(const ALFA_DetectorFactory &right)
_CONFIGURATION::vecTransformInDetectorA7R1L
std::vector< double > vecTransformInDetectorA7R1L
Definition: ALFA_DetectorFactory.h:62
ALFA_DetectorFactory::AddGlobalVacuumSensorInStation
void AddGlobalVacuumSensorInStation(GeoFullPhysVol *pPhysStation, eAStationName eStatName)
Definition: ALFA_DetectorFactory.cxx:441
_CONFIGURATION::vecTransformInStationB7L1L
std::vector< double > vecTransformInStationB7L1L
Definition: ALFA_DetectorFactory.h:64
PCONFIGURATION
struct _CONFIGURATION * PCONFIGURATION
_CONFIGURATION::pointTransformInDetectorA7R1U
std::vector< double > pointTransformInDetectorA7R1U
Definition: ALFA_DetectorFactory.h:53
ALFA_DetectorFactory::m_pIRDBAccess
IRDBAccessSvc * m_pIRDBAccess
Definition: ALFA_DetectorFactory.h:81
ALFA_DetectorFactory::~ALFA_DetectorFactory
~ALFA_DetectorFactory()
Definition: ALFA_DetectorFactory.cxx:104
ALFA_DetectorFactory::m_pDetectorStore
StoreGateSvc * m_pDetectorStore
Definition: ALFA_DetectorFactory.h:80
eRPotName
eRPotName
Definition: ALFA_GeometryReader.h:27
ALFA_GeometryReader.h
_CONFIGURATION::bIsTransformInDetector
std::vector< bool > bIsTransformInDetector
Definition: ALFA_DetectorFactory.h:46
ALFA_DetectorFactory::CreateSolidG10Shapes
GeoShape * CreateSolidG10Shapes()
Definition: ALFA_DetectorFactory.cxx:1027
RPOTSCNT
#define RPOTSCNT
Definition: ALFA_CLinkAlg.h:26
_ALIGNPARAMETERS
Definition: ALFA_DetectorFactory.h:31
ALFA_DetectorFactory::m_ListExistingRPots
std::list< eRPotName > m_ListExistingRPots
Definition: ALFA_DetectorFactory.h:86
ALFA_DetectorFactory::m_pDetectorManager
ALFA_DetectorManager * m_pDetectorManager
Definition: ALFA_DetectorFactory.h:79
ALFA_DetectorFactory::m_pGeoReader
std::unique_ptr< ALFA_GeometryReader > m_pGeoReader
Definition: ALFA_DetectorFactory.h:85
_ALFAPHYSVOLUME
Definition: ALFA_DetectorFactory.h:26
_CONFIGURATION::pointTransformInDetectorB7L1L
std::vector< double > pointTransformInDetectorB7L1L
Definition: ALFA_DetectorFactory.h:48
_CONFIGURATION::vecTransformInStationB7L1U
std::vector< double > vecTransformInStationB7L1U
Definition: ALFA_DetectorFactory.h:63
ETDT_RPTRANSFORM
@ ETDT_RPTRANSFORM
Definition: ALFA_DetectorFactory.h:37
PALFAPHYSVOLUME
struct _ALFAPHYSVOLUME * PALFAPHYSVOLUME
IRDBRecordset
IRDBRecordset is an abstract interface to the RDB Recordsets, which represent a snapshot of HVS-tagge...
Definition: IRDBRecordset.h:35
ALFA_DetectorFactory::CreateSolidTrigger
GeoShape * CreateSolidTrigger()
Definition: ALFA_DetectorFactory.cxx:980
ALFA_DetectorFactory::SelectRPots
void SelectRPots()
ALFA_DetectorFactory::ConstructBeampipe
void ConstructBeampipe(GeoPhysVol *pWorld)
Definition: ALFA_DetectorFactory.cxx:548
ALFA_DetectorFactory::ReadGeometry
bool ReadGeometry(bool bAlignCorrections=false)
Definition: ALFA_DetectorFactory.cxx:108
ALFA_DetectorFactory::CreateSolidRP
GeoShape * CreateSolidRP()
Definition: ALFA_DetectorFactory.cxx:896
GEOMETRYCONFIGURATION
Definition: ALFA_GeometryReader.h:196
eAStationName
eAStationName
Definition: ALFA_GeometryReader.h:26
ALFA_constants.h
_CONFIGURATION::vecTransformInDetectorA7R1U
std::vector< double > vecTransformInDetectorA7R1U
Definition: ALFA_DetectorFactory.h:61
_CONFIGURATION::bIsTransformInStation
std::vector< bool > bIsTransformInStation
Definition: ALFA_DetectorFactory.h:45
_ALIGNPARAMETERS::fXOffset
double fXOffset[RPOTSCNT]
Definition: ALFA_DetectorFactory.h:33
ALFA_DetectorFactory::Point3DInDetector
HepGeom::Point3D< double > Point3DInDetector(eRPotName eRPName)
Definition: ALFA_DetectorFactory.cxx:1872
ALFA_DetectorFactory
Definition: ALFA_DetectorFactory.h:76
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
eMetrologyType
eMetrologyType
Definition: ALFA_GeometryReader.h:24
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
ALFA_DetectorFactory::ConstructAlfaStations
void ConstructAlfaStations(std::map< eAStationName, ALFAPHYSVOLUME > *pmapActiveStations, GeoPhysVol *pWorld)
Definition: ALFA_DetectorFactory.cxx:461
_CONFIGURATION::GeometryConfig
GEOMETRYCONFIGURATION GeometryConfig
Definition: ALFA_DetectorFactory.h:40
_CONFIGURATION::vecTransformInStationA7R1L
std::vector< double > vecTransformInStationA7R1L
Definition: ALFA_DetectorFactory.h:70
ALFA_DetectorFactory::UpdateTransforms
void UpdateTransforms(PALIGNPARAMETERS pAlignParams)
Definition: ALFA_DetectorFactory.cxx:1910
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:42
_ALIGNPARAMETERS::fYOffset
double fYOffset[RPOTSCNT]
Definition: ALFA_DetectorFactory.h:32
_CONFIGURATION::vecTransformInStationA7L1U
std::vector< double > vecTransformInStationA7L1U
Definition: ALFA_DetectorFactory.h:65
ALFAPHYSVOLUME
struct _ALFAPHYSVOLUME ALFAPHYSVOLUME
ALFA_DetectorFactory::CreateSolidRPSupport
GeoShape * CreateSolidRPSupport()
Definition: ALFA_DetectorFactory.cxx:1005
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
ALFA_DetectorFactory::m_eRequestedMetrologyType
eMetrologyType m_eRequestedMetrologyType
Definition: ALFA_DetectorFactory.h:83
eTransformDeltaType
eTransformDeltaType
Definition: ALFA_DetectorFactory.h:37
ALFA_DetectorFactory::ConstructUFiberCladdings
void ConstructUFiberCladdings(const eRPotName eRPName, GeoFullPhysVol *pMotherVolume, const HepGeom::Transform3D &MotherTransform, GeoAlignableTransform *pDetTransform)
Definition: ALFA_DetectorFactory.cxx:1448
_CONFIGURATION::pointTransformInDetectorB7L1U
std::vector< double > pointTransformInDetectorB7L1U
Definition: ALFA_DetectorFactory.h:47
_CONFIGURATION
Definition: ALFA_DetectorFactory.h:39
ALFA_DetectorFactory::CreateSolidTiPlates
std::map< int, GeoShape * > * CreateSolidTiPlates()
Definition: ALFA_DetectorFactory.cxx:1044
ALIGNPARAMETERS
struct _ALIGNPARAMETERS ALIGNPARAMETERS
ALFA_DetectorFactory::ConstructVFiberCladdings
void ConstructVFiberCladdings(const eRPotName eRPName, GeoFullPhysVol *pMotherVolume, const HepGeom::Transform3D &MotherTransform, GeoAlignableTransform *pDetTransform)
Definition: ALFA_DetectorFactory.cxx:1563
ALFA_DetectorFactory::CreateSolidAir
GeoShape * CreateSolidAir()
Definition: ALFA_DetectorFactory.cxx:949
ALFA_DetectorFactory::m_Config
CONFIGURATION m_Config
Definition: ALFA_DetectorFactory.h:84
CONFIGURATION
struct _CONFIGURATION CONFIGURATION
_CONFIGURATION::vecTransformInStationA7R1U
std::vector< double > vecTransformInStationA7R1U
Definition: ALFA_DetectorFactory.h:69
ALFA_DetectorFactory::CreateSolidODPlates
std::map< int, GeoShape * > * CreateSolidODPlates()
Definition: ALFA_DetectorFactory.cxx:1077
_CONFIGURATION::vecTransformInDetectorB7R1U
std::vector< double > vecTransformInDetectorB7R1U
Definition: ALFA_DetectorFactory.h:59
_CONFIGURATION::pointTransformInDetectorB7R1U
std::vector< double > pointTransformInDetectorB7R1U
Definition: ALFA_DetectorFactory.h:51
ALFA_DetectorFactory::ConstructODFibers00
void ConstructODFibers00(const eRPotName eRPName, const int iODPlate, eFiberType eFType, GeoFullPhysVol *pMotherVolume, const HepGeom::Transform3D &MotherTransform, const HepGeom::Transform3D &TransODCladding)
Definition: ALFA_DetectorFactory.cxx:1246
_ALFAPHYSVOLUME::Transform
HepGeom::Transform3D Transform
Definition: ALFA_DetectorFactory.h:28
_CONFIGURATION::pointTransformInDetectorA7L1U
std::vector< double > pointTransformInDetectorA7L1U
Definition: ALFA_DetectorFactory.h:49
_CONFIGURATION::bConstructBeampipe
bool bConstructBeampipe
Definition: ALFA_DetectorFactory.h:42
ALFA_DetectorFactory::UserTransformInStation
HepGeom::Transform3D UserTransformInStation(eRPotName eRPName)
Definition: ALFA_DetectorFactory.cxx:1720
ALFA_DetectorManager.h
_CONFIGURATION::vecTransformInDetectorB7L1U
std::vector< double > vecTransformInDetectorB7L1U
Definition: ALFA_DetectorFactory.h:55
ALFA_DetectorFactory::CreateAxes
void CreateAxes(GeoPhysVol *pMotherVolume)
Definition: ALFA_DetectorFactory.cxx:380
ALFA_DetectorFactory::ALFA_DetectorFactory
ALFA_DetectorFactory(StoreGateSvc *pDetStore, IRDBAccessSvc *pAccess, const PCONFIGURATION pConfig)
Definition: ALFA_DetectorFactory.cxx:93
_ALIGNPARAMETERS::fTheta
double fTheta[RPOTSCNT]
Definition: ALFA_DetectorFactory.h:34
_CONFIGURATION::pointTransformInDetectorB7R1L
std::vector< double > pointTransformInDetectorB7R1L
Definition: ALFA_DetectorFactory.h:52
_CONFIGURATION::vecTransformInStationB7R1L
std::vector< double > vecTransformInStationB7R1L
Definition: ALFA_DetectorFactory.h:68
_CONFIGURATION::vecTransformInDetectorB7R1L
std::vector< double > vecTransformInDetectorB7R1L
Definition: ALFA_DetectorFactory.h:60
ALFA_DetectorFactory::getDetectorManager
virtual const ALFA_DetectorManager * getDetectorManager() const
Definition: ALFA_DetectorFactory.h:97
ALFA_DetectorFactory::ALFA_DetectorFactory
ALFA_DetectorFactory(const ALFA_DetectorFactory &right)
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
ALFA_DetectorFactory::ConstructODFiberCladdings
void ConstructODFiberCladdings(const eRPotName eRPName, GeoFullPhysVol *pPhysMotherVolume, const HepGeom::Transform3D &MotherTransform, GeoAlignableTransform *pDetTransform)
Definition: ALFA_DetectorFactory.cxx:1159
ALFA_DetectorFactory::DefineMaterials
void DefineMaterials(StoredMaterialManager *pMaterialManager)
Definition: ALFA_DetectorFactory.cxx:223
PALIGNPARAMETERS
struct _ALIGNPARAMETERS * PALIGNPARAMETERS
_CONFIGURATION::vecTransformInStationA7L1L
std::vector< double > vecTransformInStationA7L1L
Definition: ALFA_DetectorFactory.h:66
ALFA_DetectorFactory::ConstructODFibers01
void ConstructODFibers01(const eRPotName eRPName, const int iODPlate, eFiberType eFType, GeoFullPhysVol *pMotherVolume, const HepGeom::Transform3D &MotherTransform, const HepGeom::Transform3D &TransODCladding)
Definition: ALFA_DetectorFactory.cxx:1354
_CONFIGURATION::vecTransformInDetectorA7L1L
std::vector< double > vecTransformInDetectorA7L1L
Definition: ALFA_DetectorFactory.h:58
_ALFAPHYSVOLUME::pPhysVolume
GeoFullPhysVol * pPhysVolume
Definition: ALFA_DetectorFactory.h:27
_CONFIGURATION::bAddIBP
bool bAddIBP
Definition: ALFA_DetectorFactory.h:43
_CONFIGURATION::clear
void clear()
Definition: ALFA_DetectorFactory.cxx:55
ALFA_DetectorFactory::UserTransformInDetector
HepGeom::Transform3D UserTransformInDetector(eRPotName eRPName)
Definition: ALFA_DetectorFactory.cxx:1796
ALFA_DetectorFactory::m_MapMaterials
std::map< std::string, const GeoMaterial * > m_MapMaterials
Definition: ALFA_DetectorFactory.h:87