Belle II Software  release-08-01-10
CsiGeometryPar.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #ifndef CSIGEOMETRYPAR_H
9 #define CSIGEOMETRYPAR_H
10 
11 #include <vector>
12 #include <G4String.hh>
13 #include <G4Material.hh>
14 
15 #include <CLHEP/Geometry/Transform3D.h>
16 #include <CLHEP/Vector/ThreeVector.h>
17 #include <TVector3.h>
18 
20 typedef int CsiIdentifier ;
21 
22 typedef CLHEP::HepRotation RotationMatrix;
23 typedef CLHEP::Hep3Vector ThreeVector;
24 
25 typedef HepGeom::Transform3D Transform3D;
26 //typedef HepGeom::Rotate3D Rotate3D;
27 //typedef HepGeom::RotateX3D RotateX3D;
28 typedef HepGeom::RotateY3D RotateY3D;
29 typedef HepGeom::RotateZ3D RotateZ3D;
30 
31 typedef HepGeom::Translate3D Translate3D;
32 //typedef HepGeom::TranslateX3D TranslateX3D;
33 //typedef HepGeom::TranslateY3D TranslateY3D;
34 //typedef HepGeom::TranslateZ3D TranslateZ3D;
35 
36 
37 namespace Belle2 {
42  namespace csi {
43 
45 
49 
50  public:
51 
54 
56  virtual ~CsiGeometryPar();
57 
59 
62  static CsiGeometryPar* Instance();
63 
65  void clear();
66 
68  void Print(const int cid, int debuglevel = 80);
69 
71  void PrintAll(int debuglevel = 80);
72 
73 
75  void read();
76 
78  int CsiVolNameToCellID(const G4String VolumeName);//Mapping from VolumeName to Crystal CellID
79 
81  G4Material* GetMaterial(int cid);
82 
84  ThreeVector GetPosition(int cid) { return m_Position.at(cid); };
85 
87  ThreeVector GetOrientation(int cid) { return m_Orientation.at(cid); };
88 
90  TVector3 GetPositionTV3(int cid) { return m_PositionTV3.at(cid); };
91 
93  TVector3 GetOrientationTV3(int cid) { return m_OrientationTV3.at(cid); };
94 
96  TVector3 ConvertToTVector3(ThreeVector _hepTV)
97  {
98  TVector3 pos(_hepTV.x(), _hepTV.y(), _hepTV.z());
99  return pos;
100  };
101 
103  int GetEnclosureID(int cid) { return m_BoxID.at(cid); };
104 
106  int GetSlotID(int cid) { return m_SlotID.at(cid); };
107 
109  double GetMaterialProperty(int cid, const char* propertyname);
110 
112  double GetTauFast(int cid) { return GetMaterialProperty(cid, "FASTTIMECONSTANT"); };
113 
115  double GetTauSlow(int cid) { return GetMaterialProperty(cid, "SLOWTIMECONSTANT"); };
116 
117 
118  private:
119 
120 
122  int m_cellID;
123 
125  std::vector<int> m_thetaID;
126 
128  std::vector<int> m_phiID;
129 
131  std::vector<int> m_BoxID;
132 
134  std::vector<int> m_SlotID;
135 
137  std::vector<ThreeVector> m_Position;
139  std::vector<TVector3> m_PositionTV3;
140 
142  std::vector<ThreeVector> m_Orientation;
144  std::vector<TVector3> m_OrientationTV3;
145 
148  };
149 
150  } // end of namespace csi
152 } // end of namespace Belle2
153 
154 
155 #endif
The Class for CSI Geometry Parameters.
void PrintAll(int debuglevel=80)
Print all crystals information.
int GetEnclosureID(int cid)
Get Enclosure ID from cell ID.
double GetTauSlow(int cid)
Get crystal slow time constant.
std::vector< TVector3 > m_OrientationTV3
Orientation of the crystal (as ROOT TVector3)
std::vector< int > m_thetaID
The Theta ID information.
void Print(const int cid, int debuglevel=80)
Print crystal information.
int m_cellID
The Cell ID information.
double GetTauFast(int cid)
Get crystal fast time constant.
std::vector< ThreeVector > m_Position
Position of the nominal centre of the crystal (as a HEP ThreeVector)
TVector3 GetOrientationTV3(int cid)
Get the orientation of the crystal in a root TVector3.
TVector3 ConvertToTVector3(ThreeVector _hepTV)
Converts to a ROOT TVector3.
ThreeVector GetPosition(int cid)
Get the position of the crystal.
std::vector< int > m_phiID
The Phi ID information.
void read()
Gets geometry parameters from gearbox.
virtual ~CsiGeometryPar()
Destructor.
std::vector< ThreeVector > m_Orientation
Orientation of the crystal (as a HEP ThreeVector)
std::vector< int > m_BoxID
The index of the enclosure.
G4Material * GetMaterial(int cid)
Get pointer to the Geant4 Material.
static CsiGeometryPar * Instance()
Static method to get a reference to the CsiGeometryPar instance.
int CsiVolNameToCellID(const G4String VolumeName)
Get Cell Id.
std::vector< int > m_SlotID
The slot index of the crystal in the enclosure.
TVector3 GetPositionTV3(int cid)
Get the position of the crystal in a root TVector3.
int GetSlotID(int cid)
Get Slot ID in the Enclosure from cell ID.
static CsiGeometryPar * m_B4CsiGeometryParDB
Pointer that saves the instance of this class.
std::vector< TVector3 > m_PositionTV3
Position of the nominal centre of the crystal (as a ROOT TVector3)
ThreeVector GetOrientation(int cid)
Get the position of the crystal.
double GetMaterialProperty(int cid, const char *propertyname)
Get material property.
Abstract base class for different kinds of events.