Belle II Software development
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 <Math/Vector3D.h>
18
20typedef int CsiIdentifier ;
21
22typedef CLHEP::HepRotation RotationMatrix;
23typedef CLHEP::Hep3Vector ThreeVector;
24
25typedef HepGeom::Transform3D Transform3D;
26//typedef HepGeom::Rotate3D Rotate3D;
27//typedef HepGeom::RotateX3D RotateX3D;
28typedef HepGeom::RotateY3D RotateY3D;
29typedef HepGeom::RotateZ3D RotateZ3D;
30
31typedef HepGeom::Translate3D Translate3D;
32//typedef HepGeom::TranslateX3D TranslateX3D;
33//typedef HepGeom::TranslateY3D TranslateY3D;
34//typedef HepGeom::TranslateZ3D TranslateZ3D;
35
36
37namespace 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 ROOT::Math::XYZVector GetPosition(int cid) { return m_Position.at(cid); };
85
87 ROOT::Math::XYZVector GetOrientation(int cid) { return m_Orientation.at(cid); };
88
90 int GetEnclosureID(int cid) { return m_BoxID.at(cid); };
91
93 int GetSlotID(int cid) { return m_SlotID.at(cid); };
94
96 double GetMaterialProperty(int cid, const char* propertyname);
97
99 double GetTauFast(int cid) { return GetMaterialProperty(cid, "FASTTIMECONSTANT"); };
100
102 double GetTauSlow(int cid) { return GetMaterialProperty(cid, "SLOWTIMECONSTANT"); };
103
104
105 private:
106
107
110
112 std::vector<int> m_thetaID;
113
115 std::vector<int> m_phiID;
116
118 std::vector<int> m_BoxID;
119
121 std::vector<int> m_SlotID;
122
124 std::vector<ROOT::Math::XYZVector> m_Position;
125
127 std::vector<ROOT::Math::XYZVector> m_Orientation;
128
131 };
132
133 } // end of namespace csi
135} // end of namespace Belle2
136
137
138#endif
The Class for CSI Geometry Parameters.
void PrintAll(int debuglevel=80)
Print all crystals information.
std::vector< ROOT::Math::XYZVector > m_Position
Position of the nominal centre of the crystal.
int GetEnclosureID(int cid)
Get Enclosure ID from cell ID.
ROOT::Math::XYZVector GetOrientation(int cid)
Get the orientation of the crystal.
double GetTauSlow(int cid)
Get crystal slow time constant.
std::vector< ROOT::Math::XYZVector > m_Orientation
Orientation of the crystal.
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.
ROOT::Math::XYZVector 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< 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.
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.
double GetMaterialProperty(int cid, const char *propertyname)
Get material property.
Abstract base class for different kinds of events.