ATLAS Offline Software
ForwardRegionGeoModelFactory.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 ForwardRegionGeoModelFactory_h
6 #define ForwardRegionGeoModelFactory_h 1
7 #include "GeoModelKernel/GeoVDetectorFactory.h"
9 
11 #include "GaudiKernel/ToolHandle.h"
12 
13 #include <string>
14 #include <vector>
15 #include <map>
16 
17 class StoreGateSvc;
18 
19 typedef struct _FWD_CONFIGURATION
20 {
33  bool buildTCL4;
34  bool buildTCL6;
37  double newPosB7L1;
38  double newPosB7R1;
39  double posAFPL1;
40  double posAFPL2;
41  double posAFPR1;
42  double posAFPR2;
43  double posZDC1;
44  double posZDC2;
45 
46  void clear();
48 
49 class ForwardRegionGeoModelFactory : public GeoVDetectorFactory {
50 
51  public:
52 
53  // Constructor:
55 
56  // Destructor:
58 
59  // Creation of geometry:
60  virtual void create(GeoPhysVol *world);
61 
62  // Access to the results:
63  virtual const ForwardRegionGeoModelManager * getDetectorManager() const;
64 
65  private:
66 
68 
69  // map of defined materials
70  std::map<std::string,const GeoMaterial*> m_MapMaterials;
71 
72  // property configuration
75 
76  ToolHandle<IForwardRegionProperties> m_properties; // properties of mag. field tool
77 
78  // initialization of the material map
79  void DefineMaterials();
80 
81  // construct elements for given beam
82  void constructElements(GeoPhysVol *fwrPhys, std::vector<std::vector<std::string> > loadedDataFile, int beam);
83 
84  // Elements
85  GeoPhysVol* insertMagnetEnvelope(const std::string& name, double x, double y, double z, double rotationAngle, double diameter, double halfL, double dL, GeoPhysVol* fwrPhys);
86  void insertCircularElement(const std::string& name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol* fwrPhys);
87  void insertEllipticalElement(const std::string& name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol* fwrPhys);
88  void insertXRecticircularElement(const std::string& name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol* fwrPhys);
89  void insertYRecticircularElement(const std::string& name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol* fwrPhys);
90  void insertTrousersElement(const std::string& name, double x, double y, double z, double rotationAngle, GeoPhysVol* fwrPhys);
91  void insertTCLElement(const std::string& name, double x, double y, double z, GeoPhysVol* fwrPhys, double TCLJawDistO, double TCLJawDistI, bool tungstenInsteadOfCopper = false);
92 
93  // Load data from file into 2D array of strings
94  std::vector<std::vector<std::string> > loadDataFile(char * fileName, int cols);
95 
96  // convert number to string
97  template <class T>
98  std::string num2str(T);
99 
100  // signum
101  template <typename T> int sgn(T val);
102 
103  // Illegal operations:
106 
107  // The manager:
109 };
110 
111 // Class ForwardRegionGeoModelFactory
112 #endif
113 
114 
_FWD_CONFIGURATION::TCL5JawDistB2I
double TCL5JawDistB2I
Definition: ForwardRegionGeoModelFactory.h:28
ForwardRegionGeoModelFactory::m_detectorManager
ForwardRegionGeoModelManager * m_detectorManager
Definition: ForwardRegionGeoModelFactory.h:108
ForwardRegionGeoModelFactory::getDetectorManager
virtual const ForwardRegionGeoModelManager * getDetectorManager() const
Definition: ForwardRegionGeoModelFactory.cxx:454
_FWD_CONFIGURATION::posZDC2
double posZDC2
Definition: ForwardRegionGeoModelFactory.h:44
_FWD_CONFIGURATION::TCL6JawDistB2I
double TCL6JawDistB2I
Definition: ForwardRegionGeoModelFactory.h:29
_FWD_CONFIGURATION::TCL6JawDistB2O
double TCL6JawDistB2O
Definition: ForwardRegionGeoModelFactory.h:32
ForwardRegionGeoModelManager
Definition: ForwardRegionGeoModelManager.h:10
ForwardRegionGeoModelFactory::insertYRecticircularElement
void insertYRecticircularElement(const std::string &name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol *fwrPhys)
Definition: ForwardRegionGeoModelElements.cxx:206
ForwardRegionGeoModelFactory::num2str
std::string num2str(T)
Definition: ForwardRegionGeoModelFactory.cxx:215
_FWD_CONFIGURATION::newPosB7R1
double newPosB7R1
Definition: ForwardRegionGeoModelFactory.h:38
_FWD_CONFIGURATION::TCL5JawDistB1O
double TCL5JawDistB1O
Definition: ForwardRegionGeoModelFactory.h:25
_FWD_CONFIGURATION::TCL5JawDistB1I
double TCL5JawDistB1I
Definition: ForwardRegionGeoModelFactory.h:22
_FWD_CONFIGURATION::TCL4JawDistB2I
double TCL4JawDistB2I
Definition: ForwardRegionGeoModelFactory.h:27
_FWD_CONFIGURATION::posAFPL1
double posAFPL1
Definition: ForwardRegionGeoModelFactory.h:39
ForwardRegionGeoModelFactory::m_MapMaterials
std::map< std::string, const GeoMaterial * > m_MapMaterials
Definition: ForwardRegionGeoModelFactory.h:70
ForwardRegionGeoModelFactory::ForwardRegionGeoModelFactory
ForwardRegionGeoModelFactory(StoreGateSvc *pDetStore, const PFWD_CONFIGURATION pConfig)
Definition: ForwardRegionGeoModelFactory.cxx:76
ForwardRegionGeoModelFactory::insertTCLElement
void insertTCLElement(const std::string &name, double x, double y, double z, GeoPhysVol *fwrPhys, double TCLJawDistO, double TCLJawDistI, bool tungstenInsteadOfCopper=false)
Definition: ForwardRegionGeoModelElements.cxx:393
ForwardRegionGeoModelFactory::ForwardRegionGeoModelFactory
ForwardRegionGeoModelFactory(const ForwardRegionGeoModelFactory &right)
x
#define x
ForwardRegionGeoModelFactory::constructElements
void constructElements(GeoPhysVol *fwrPhys, std::vector< std::vector< std::string > > loadedDataFile, int beam)
Definition: ForwardRegionGeoModelFactory.cxx:226
_FWD_CONFIGURATION::posAFPL2
double posAFPL2
Definition: ForwardRegionGeoModelFactory.h:40
ForwardRegionGeoModelFactory::insertTrousersElement
void insertTrousersElement(const std::string &name, double x, double y, double z, double rotationAngle, GeoPhysVol *fwrPhys)
Definition: ForwardRegionGeoModelElements.cxx:285
_FWD_CONFIGURATION::vp1Compatibility
bool vp1Compatibility
Definition: ForwardRegionGeoModelFactory.h:35
_FWD_CONFIGURATION::ALFAInNewPosition
bool ALFAInNewPosition
Definition: ForwardRegionGeoModelFactory.h:36
beamspotnt.cols
list cols
Definition: bin/beamspotnt.py:1114
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
_FWDMg_CONFIGURATION
Definition: IForwardRegionProperties.h:13
ForwardRegionGeoModelFactory::insertCircularElement
void insertCircularElement(const std::string &name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol *fwrPhys)
Definition: ForwardRegionGeoModelElements.cxx:49
ForwardRegionGeoModelFactory::insertMagnetEnvelope
GeoPhysVol * insertMagnetEnvelope(const std::string &name, double x, double y, double z, double rotationAngle, double diameter, double halfL, double dL, GeoPhysVol *fwrPhys)
Definition: ForwardRegionGeoModelElements.cxx:26
FWD_CONFIGURATION
struct _FWD_CONFIGURATION FWD_CONFIGURATION
z
#define z
_FWD_CONFIGURATION::TCL4JawDistB1I
double TCL4JawDistB1I
Definition: ForwardRegionGeoModelFactory.h:21
_FWD_CONFIGURATION::buildTCL6
bool buildTCL6
Definition: ForwardRegionGeoModelFactory.h:34
_FWD_CONFIGURATION::posAFPR2
double posAFPR2
Definition: ForwardRegionGeoModelFactory.h:42
ForwardRegionGeoModelFactory
Definition: ForwardRegionGeoModelFactory.h:49
_FWD_CONFIGURATION::newPosB7L1
double newPosB7L1
Definition: ForwardRegionGeoModelFactory.h:37
ForwardRegionGeoModelFactory::insertXRecticircularElement
void insertXRecticircularElement(const std::string &name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol *fwrPhys)
Definition: ForwardRegionGeoModelElements.cxx:125
ForwardRegionGeoModelFactory::create
virtual void create(GeoPhysVol *world)
Definition: ForwardRegionGeoModelFactory.cxx:385
jobOptions.beam
beam
Definition: jobOptions.SuperChic_ALP2.py:16
ForwardRegionGeoModelFactory::loadDataFile
std::vector< std::vector< std::string > > loadDataFile(char *fileName, int cols)
Definition: ForwardRegionGeoModelFactory.cxx:460
_FWD_CONFIGURATION::TCL6JawDistB1O
double TCL6JawDistB1O
Definition: ForwardRegionGeoModelFactory.h:26
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
_FWD_CONFIGURATION::clear
void clear()
Definition: ForwardRegionGeoModelFactory.cxx:47
ForwardRegionGeoModelFactory::m_Config
FWD_CONFIGURATION m_Config
Definition: ForwardRegionGeoModelFactory.h:73
IForwardRegionProperties.h
ForwardRegionGeoModelFactory::m_MagConfig
FWDMg_CONFIGURATION m_MagConfig
Definition: ForwardRegionGeoModelFactory.h:74
_FWD_CONFIGURATION::TCL6JawDistB1I
double TCL6JawDistB1I
Definition: ForwardRegionGeoModelFactory.h:23
ForwardRegionGeoModelFactory::m_properties
ToolHandle< IForwardRegionProperties > m_properties
Definition: ForwardRegionGeoModelFactory.h:76
ForwardRegionGeoModelFactory::operator=
const ForwardRegionGeoModelFactory & operator=(const ForwardRegionGeoModelFactory &right)
_FWD_CONFIGURATION::posAFPR1
double posAFPR1
Definition: ForwardRegionGeoModelFactory.h:41
PFWD_CONFIGURATION
struct _FWD_CONFIGURATION * PFWD_CONFIGURATION
_FWD_CONFIGURATION::TCL5JawDistB2O
double TCL5JawDistB2O
Definition: ForwardRegionGeoModelFactory.h:31
_FWD_CONFIGURATION::posZDC1
double posZDC1
Definition: ForwardRegionGeoModelFactory.h:43
_FWD_CONFIGURATION::TCL4JawDistB1O
double TCL4JawDistB1O
Definition: ForwardRegionGeoModelFactory.h:24
y
#define y
ForwardRegionGeoModelFactory::m_detectorStore
StoreGateSvc * m_detectorStore
Definition: ForwardRegionGeoModelFactory.h:67
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
ForwardRegionGeoModelFactory::insertEllipticalElement
void insertEllipticalElement(const std::string &name, double x, double y, double z, double rotationAngle, double xAperture, double yAperture, double halfL, double dL, double tubeThickness, GeoPhysVol *fwrPhys)
Definition: ForwardRegionGeoModelElements.cxx:82
ForwardRegionGeoModelFactory::sgn
int sgn(T val)
Definition: ForwardRegionGeoModelFactory.cxx:222
ForwardRegionGeoModelFactory::DefineMaterials
void DefineMaterials()
Definition: ForwardRegionGeoModelFactory.cxx:100
ForwardRegionGeoModelFactory::~ForwardRegionGeoModelFactory
~ForwardRegionGeoModelFactory()
Definition: ForwardRegionGeoModelFactory.cxx:94
_FWD_CONFIGURATION::buildTCL4
bool buildTCL4
Definition: ForwardRegionGeoModelFactory.h:33
ForwardRegionGeoModelManager.h
_FWD_CONFIGURATION
Definition: ForwardRegionGeoModelFactory.h:20
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
_FWD_CONFIGURATION::TCL4JawDistB2O
double TCL4JawDistB2O
Definition: ForwardRegionGeoModelFactory.h:30