1 #ifndef GEOMETRYHANDLER_HH
2 #define GEOMETRYHANDLER_HH
15 #include "Exception.hh"
18 static std::map<std::string, std::string> geo_mapping =
19 {{
"tof0",
"TOF0"}, {
"tof1",
"TOF1"}, {
"tof2",
"TOF2"},
20 {
"ckova",
"Ckov1"}, {
"ckovb",
"Ckov2"}, {
"tku",
"Tracker0"}, {
"tkd",
"Tracker1"},
21 {
"kl",
"KL"}, {
"emr",
"EMR"}, {
"abs",
"Disk_LiH LH2-Empty LH2-Full NeAbs"}};
24 static std::vector<double> station_offsets = {-550., -350., -100., 200., 550.};
43 const std::string& name);
65 void Load(
const std::string& filename,
66 const std::string& name);
81 double x()
const {
return _pos.x(); }
84 double y()
const {
return _pos.y(); }
87 double z()
const {
return _pos.z(); }
127 const std::vector<std::string>& names);
const TVector3 & operator[](const size_t i) const
Overload the subscript operator, return a value.
Definition: GeometryHandler.hh:55
TVector3 _pos
Position of module.
Definition: GeometryHandler.hh:100
~DetectorGlobals()
Destructor.
Definition: GeometryHandler.cc:32
DetectorGlobals & operator=(const DetectorGlobals &detector_globals)
Equality operator.
Definition: GeometryHandler.cc:21
DetectorGlobals()
Default constructor, initilizes everything to 0.
Definition: GeometryHandler.cc:3
double z() const
Returns the global z coordinate of the detector.
Definition: GeometryHandler.hh:87
const DetectorGlobals & operator[](const std::string &name) const
Overload the subscript operator, return a value.
Definition: GeometryHandler.cc:168
std::vector< TVector3 > _subpos
Positions of submodules.
Definition: GeometryHandler.hh:102
Stores the positions of all the requested MICE detectors.
Definition: GeometryHandler.hh:109
double y() const
Returns the global y coordinate of the detector.
Definition: GeometryHandler.hh:84
void Load(const std::string &filename, const std::string &name)
Loads the global constants from the parent geometry file.
Definition: GeometryHandler.cc:34
const TVector3 & Angles() const
Returns the global rotation angles of the detector.
Definition: GeometryHandler.hh:78
double x() const
Returns the global x coordinate of the detector.
Definition: GeometryHandler.hh:81
GeometryHandler()
Default constructor, initilizes everything to 0.
Definition: GeometryHandler.cc:118
GeometryHandler & operator=(const GeometryHandler &geohandler)
Equality operator.
Definition: GeometryHandler.cc:156
~GeometryHandler()
Destructor.
Definition: GeometryHandler.cc:166
double gamma() const
Returns the global roll of the detector.
Definition: GeometryHandler.hh:96
void SetAngles(const TVector3 &angles)
Sets the global rotation angles of the detector.
Definition: GeometryHandler.hh:75
double beta() const
Returns the global yaw of the detector.
Definition: GeometryHandler.hh:93
TVector3 & operator[](const size_t i)
Overload the subscript operator, return a value, allows mods.
Definition: GeometryHandler.hh:58
const TVector3 & Position() const
Returns the global position of the detector.
Definition: GeometryHandler.hh:72
Stores the positions of a MICE detector in global coordinates.
Definition: GeometryHandler.hh:31
std::vector< std::string > _names
Short names of modules.
Definition: GeometryHandler.hh:146
std::map< std::string, DetectorGlobals > _detectors
List of detector globals.
Definition: GeometryHandler.hh:147
double alpha() const
Returns the global pitch of the detector.
Definition: GeometryHandler.hh:90
void SetPosition(const TVector3 &pos)
Sets the global position of the detector.
Definition: GeometryHandler.cc:109
TVector3 _angles
Rotation angles of module.
Definition: GeometryHandler.hh:101