Belle II Software  release-05-02-19
CsiGeometryPar.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Poyuan Chen *
7  * Alexandre Beaulieu *
8  * This software is provided "as is" without any warranty. *
9  * *
10  * 7/31: Poyuan *
11  * 2014/10/24: ABeaulieu: adapted from the ECL package to BEAST CsI *
12  * *
13  **************************************************************************/
14 #ifndef CSIGEOMETRYPAR_H
15 #define CSIGEOMETRYPAR_H
16 
17 #include <vector>
18 #include <G4String.hh>
19 #include <G4Material.hh>
20 
21 #include <CLHEP/Geometry/Transform3D.h>
22 #include <CLHEP/Vector/ThreeVector.h>
23 #include <TVector3.h>
24 
26 typedef int CsiIdentifier ;
27 
28 typedef CLHEP::HepRotation RotationMatrix;
29 typedef CLHEP::Hep3Vector ThreeVector;
30 
31 typedef HepGeom::Transform3D Transform3D;
32 //typedef HepGeom::Rotate3D Rotate3D;
33 //typedef HepGeom::RotateX3D RotateX3D;
34 typedef HepGeom::RotateY3D RotateY3D;
35 typedef HepGeom::RotateZ3D RotateZ3D;
36 
37 typedef HepGeom::Translate3D Translate3D;
38 //typedef HepGeom::TranslateX3D TranslateX3D;
39 //typedef HepGeom::TranslateY3D TranslateY3D;
40 //typedef HepGeom::TranslateZ3D TranslateZ3D;
41 
42 
43 namespace Belle2 {
48  namespace csi {
49 
51 
55 
56  public:
57 
60 
62  virtual ~CsiGeometryPar();
63 
65 
68  static CsiGeometryPar* Instance();
69 
71  void clear();
72 
74  void Print(const int cid, int debuglevel = 80);
75 
77  void PrintAll(int debuglevel = 80);
78 
79 
81  void read();
82 
84  int CsiVolNameToCellID(const G4String VolumeName);//Mapping from VolumeName to Crystal CellID
85 
87  G4Material* GetMaterial(int cid);
88 
90  ThreeVector GetPosition(int cid) { return m_Position.at(cid); };
91 
93  ThreeVector GetOrientation(int cid) { return m_Orientation.at(cid); };
94 
96  TVector3 GetPositionTV3(int cid) { return m_PositionTV3.at(cid); };
97 
99  TVector3 GetOrientationTV3(int cid) { return m_OrientationTV3.at(cid); };
100 
102  TVector3 ConvertToTVector3(ThreeVector _hepTV)
103  {
104  TVector3 pos(_hepTV.x(), _hepTV.y(), _hepTV.z());
105  return pos;
106  };
107 
109  int GetEnclosureID(int cid) { return m_BoxID.at(cid); };
110 
112  int GetSlotID(int cid) { return m_SlotID.at(cid); };
113 
115  double GetMaterialProperty(int cid, const char* propertyname);
116 
118  double GetTauFast(int cid) { return GetMaterialProperty(cid, "FASTTIMECONSTANT"); };
119 
121  double GetTauSlow(int cid) { return GetMaterialProperty(cid, "SLOWTIMECONSTANT"); };
122 
123 
124  private:
125 
126 
128  int m_cellID;
129 
131  std::vector<int> m_thetaID;
132 
134  std::vector<int> m_phiID;
135 
137  std::vector<int> m_BoxID;
138 
140  std::vector<int> m_SlotID;
141 
143  std::vector<ThreeVector> m_Position;
145  std::vector<TVector3> m_PositionTV3;
146 
148  std::vector<ThreeVector> m_Orientation;
150  std::vector<TVector3> m_OrientationTV3;
151 
154  };
155 
156  } // end of namespace csi
158 } // end of namespace Belle2
159 
160 
161 #endif
Belle2::csi::CsiGeometryPar::ConvertToTVector3
TVector3 ConvertToTVector3(ThreeVector _hepTV)
Converts to a ROOT TVector3.
Definition: CsiGeometryPar.h:102
Belle2::csi::CsiGeometryPar::GetPositionTV3
TVector3 GetPositionTV3(int cid)
Get the position of the crystal in a root TVector3.
Definition: CsiGeometryPar.h:96
Belle2::csi::CsiGeometryPar::read
void read()
Gets geometry parameters from gearbox.
Definition: CsiGeometryPar.cc:66
Belle2::csi::CsiGeometryPar::GetMaterialProperty
double GetMaterialProperty(int cid, const char *propertyname)
Get material property.
Definition: CsiGeometryPar.cc:198
Belle2::csi::CsiGeometryPar::GetEnclosureID
int GetEnclosureID(int cid)
Get Enclosure ID from cell ID.
Definition: CsiGeometryPar.h:109
Belle2::csi::CsiGeometryPar::PrintAll
void PrintAll(int debuglevel=80)
Print all crystals information.
Definition: CsiGeometryPar.cc:228
Belle2::csi::CsiGeometryPar::m_cellID
int m_cellID
The Cell ID information.
Definition: CsiGeometryPar.h:121
Belle2::csi::CsiGeometryPar::Instance
static CsiGeometryPar * Instance()
Static method to get a reference to the CsiGeometryPar instance.
Definition: CsiGeometryPar.cc:31
Belle2::csi::CsiGeometryPar
The Class for CSI Geometry Parameters.
Definition: CsiGeometryPar.h:54
Belle2::csi::CsiGeometryPar::GetPosition
ThreeVector GetPosition(int cid)
Get the position of the crystal.
Definition: CsiGeometryPar.h:90
Belle2::csi::CsiGeometryPar::m_phiID
std::vector< int > m_phiID
The Phi ID information.
Definition: CsiGeometryPar.h:134
Belle2::csi::CsiGeometryPar::m_OrientationTV3
std::vector< TVector3 > m_OrientationTV3
Orientation of the crystal (as ROOT TVector3)
Definition: CsiGeometryPar.h:150
Belle2::csi::CsiGeometryPar::m_BoxID
std::vector< int > m_BoxID
The index of the enclosure.
Definition: CsiGeometryPar.h:137
Belle2::csi::CsiGeometryPar::CsiGeometryPar
CsiGeometryPar()
Constructor.
Definition: CsiGeometryPar.cc:37
Belle2::csi::CsiGeometryPar::m_Position
std::vector< ThreeVector > m_Position
Position of the nominal centre of the crystal (as a HEP ThreeVector)
Definition: CsiGeometryPar.h:143
Belle2::csi::CsiGeometryPar::m_Orientation
std::vector< ThreeVector > m_Orientation
Orientation of the crystal (as a HEP ThreeVector)
Definition: CsiGeometryPar.h:148
Belle2::csi::CsiGeometryPar::GetSlotID
int GetSlotID(int cid)
Get Slot ID in the Enclosure from cell ID.
Definition: CsiGeometryPar.h:112
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::csi::CsiGeometryPar::GetTauFast
double GetTauFast(int cid)
Get crystal fast time constant.
Definition: CsiGeometryPar.h:118
Belle2::csi::CsiGeometryPar::m_B4CsiGeometryParDB
static CsiGeometryPar * m_B4CsiGeometryParDB
Pointer that saves the instance of this class.
Definition: CsiGeometryPar.h:153
Belle2::csi::CsiGeometryPar::GetTauSlow
double GetTauSlow(int cid)
Get crystal slow time constant.
Definition: CsiGeometryPar.h:121
Belle2::csi::CsiGeometryPar::m_thetaID
std::vector< int > m_thetaID
The Theta ID information.
Definition: CsiGeometryPar.h:131
Belle2::csi::CsiGeometryPar::CsiVolNameToCellID
int CsiVolNameToCellID(const G4String VolumeName)
Get Cell Id.
Definition: CsiGeometryPar.cc:151
Belle2::csi::CsiGeometryPar::GetOrientationTV3
TVector3 GetOrientationTV3(int cid)
Get the orientation of the crystal in a root TVector3.
Definition: CsiGeometryPar.h:99
Belle2::csi::CsiGeometryPar::GetMaterial
G4Material * GetMaterial(int cid)
Get pointer to the Geant4 Material.
Definition: CsiGeometryPar.cc:173
Belle2::csi::CsiGeometryPar::~CsiGeometryPar
virtual ~CsiGeometryPar()
Destructor.
Definition: CsiGeometryPar.cc:45
Belle2::csi::CsiGeometryPar::m_PositionTV3
std::vector< TVector3 > m_PositionTV3
Position of the nominal centre of the crystal (as a ROOT TVector3)
Definition: CsiGeometryPar.h:145
Belle2::csi::CsiGeometryPar::clear
void clear()
Clears.
Definition: CsiGeometryPar.cc:53
Belle2::csi::CsiGeometryPar::m_SlotID
std::vector< int > m_SlotID
The slot index of the crystal in the enclosure.
Definition: CsiGeometryPar.h:140
Belle2::csi::CsiGeometryPar::Print
void Print(const int cid, int debuglevel=80)
Print crystal information.
Definition: CsiGeometryPar.cc:207
Belle2::csi::CsiGeometryPar::GetOrientation
ThreeVector GetOrientation(int cid)
Get the position of the crystal.
Definition: CsiGeometryPar.h:93