KaliVeda
Toolkit for HIC analysis
INDRAGeometryBuilder.h
1 
4 #ifndef __INDRAGEOMETRYBUILDER_H
5 #define __INDRAGEOMETRYBUILDER_H
6 
7 #include "KVBase.h"
8 #include "KVDetector.h"
9 #include "TVector3.h"
10 #include "TGeoVolume.h"
11 #include "TGeoMatrix.h"
12 #include "KVNumberList.h"
13 #include "KVNameValueList.h"
14 #include <unordered_map>
15 
16 class TGeoManager;
28 class INDRAGeometryBuilder : public KVBase {
29 public:
30  using theta_phi = std::pair<double, double>;
31 private:
32  TString fDetName;
33  TVector3 fInnerFront[4];
34  TVector3 fOuterFront[4];
35  TVector3 fFrameFront[4];
36  KVDetector fCurrentDetector;
37  TString fCurrentDetectorType;
38  Int_t fActiveLayer;
39  KVMaterial fFrameMat;
40  TVector3 fInnerCentre;
41  TVector3 fOuterCentre;
42  TVector3 fFrameCentre;
43  Int_t Ndets;
44  Double_t thetaMin, thetaMax, deltaPhi, phi0;
45  TGeoVolume* fFrameVolume;
46  TGeoVolume* fDetVolume;
47  Int_t fInnerPads, fOuterPads;
48  Int_t fInnerRing, fOuterRing;
49  Int_t fInnerDmod, fOuterDmod;
50  Int_t fInnerModmin, fOuterModmin;
51  Int_t fModmax;
52  Double_t fRingCentreDistance;
53  TGeoTranslation* fDetectorPosition;
54  TGeoVolumeAssembly* fEtalonVol;
55  Double_t fEtalonTheta[10];
56  Double_t fEtalonPhi[10];
57  void CorrectCoordinates(Double_t*, Double_t&, Double_t&);
58  Bool_t CheckDetectorPresent(TString detname);
59 #ifndef __CINT__
60  struct detector_properties {
61  std::string name;
62  long double thick = 0.0;
63  int ring = 0;
64  int module = 0;
65  theta_phi thetaminmax;
66  theta_phi phiminmax;
67  bool present = false;
68  };
69  std::unordered_map<std::string, detector_properties> detector_map;
70  std::vector<detector_properties> read_telescope_infos(
71  const Char_t* prefix, Int_t ring, Int_t mod, Int_t ntel,
72  double thmin, double thmax, double phi);
73 #endif
74  TString fDataSet;
75  Int_t fCurrentRun;
76  TEnv fStrucInfos;
77 
78  void read_indra_struct_file();
79  void read_layer_infos(const Char_t* name);
80  void read_ring_infos(Int_t number, const Char_t* prefix);
81 
82  Bool_t fWithPhoswich = kFALSE;
83 public:
84 
85  INDRAGeometryBuilder(const TString& _data_set, Int_t current_run = -1);
86 
87  void ReadDetCAO(const Char_t* detname, Int_t ring);
88  void CalculateBackPlaneCoordinates(TVector3* frontcoords, TVector3 centre, Double_t depth, TVector3* backcoords);
89  void CalculateCentre(TVector3* corners, TVector3& centre);
90  void CalculateCornersInPlane(TVector3* plane, Double_t thetamin,
91  Double_t thetamax, Double_t phimin, Double_t phimax, TVector3* corners);
92 
93  std::vector<theta_phi> GetDirectionsToTestForImport() const;
95 
96  void Print(Option_t* = "") const override;
97 
98  void MakeFrame(TString det_type, Int_t ring_num);
99  void MakeDetector(const Char_t* det, TVector3* som, TVector3 cen);
100  void PlaceFrame(Double_t phi, Int_t copy_no);
101  void PlaceDetector();
102  void MakeRing(const Char_t* det, int ring);
103  void MakeEtalon(int RING);
104  void ReflectPad(TVector3* orig, Double_t phicentre, TVector3* newpad);
105  void CloseAndDraw();
106 
107  void Build(Bool_t withTarget = kTRUE, Bool_t closeGeometry = kTRUE);
108  void BuildEtalonVolumes();
109  void BuildTarget();
110  void Build(const KVNumberList& rings, const KVNameValueList& detectors);
111  void TransformToOwnFrame(TVector3* orig, TVector3& centre, TVector3* ownframe);
112 
113  Bool_t SetDetectorThickness(const TString& detname, Double_t thickness);
114 
115  ClassDefOverride(INDRAGeometryBuilder, 0) //Build INDRA geometry from Huguet CAO infos
116 };
117 
118 #endif
int Int_t
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
const char Option_t
#define ClassDefOverride(name, id)
char name[80]
Build INDRA geometry from Huguet CAO infos.
void MakeDetector(const Char_t *det, TVector3 *som, TVector3 cen)
make volume corresponding to the actual detector
std::vector< theta_phi > GetDirectionsToTestForImport() const
void Print(Option_t *="") const override
Bool_t CheckImportResults(const KVSeqCollection *)
void CalculateBackPlaneCoordinates(TVector3 *frontcoords, TVector3 centre, Double_t depth, TVector3 *backcoords)
void CalculateCentre(TVector3 *corners, TVector3 &centre)
void ReadDetCAO(const Char_t *detname, Int_t ring)
void PlaceFrame(Double_t phi, Int_t copy_no)
position frame (dead zone) volume in geometry
void ReflectPad(TVector3 *orig, Double_t phicentre, TVector3 *newpad)
Bool_t SetDetectorThickness(const TString &detname, Double_t thickness)
void CalculateCornersInPlane(TVector3 *plane, Double_t thetamin, Double_t thetamax, Double_t phimin, Double_t phimax, TVector3 *corners)
void TransformToOwnFrame(TVector3 *orig, TVector3 &centre, TVector3 *ownframe)
INDRAGeometryBuilder(const TString &_data_set, Int_t current_run=-1)
Default constructor.
void Build(Bool_t withTarget=kTRUE, Bool_t closeGeometry=kTRUE)
void MakeRing(const Char_t *det, int ring)
void MakeFrame(TString det_type, Int_t ring_num)
void PlaceDetector()
position detector inside frame
std::pair< double, double > theta_phi
Base class for KaliVeda framework.
Definition: KVBase.h:140
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:173
Description of physical materials used to construct detectors & targets; interface to range tables.
Definition: KVMaterial.h:115
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
KaliVeda extensions to ROOT collection classes.