CbmRoot
Loading...
Searching...
No Matches
CbmTrdGeoFactory.h
Go to the documentation of this file.
1/* Copyright (C) 2024 National Institute of Physics and Nuclear Engineering - Horia Hulubei, Bucharest
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Alexandru Bercuci [committer] */
4
20#ifndef CBMTRDGEOFACTORY_H_
21#define CBMTRDGEOFACTORY_H_
22
23#include "CbmTrdDefs.h" // for trd namespace
24
25#include <FairTask.h>
26
27#include <TString.h>
28
29#include <array>
30#include <string>
31
32class TGeoMedium;
33class TGeoTranslation;
34class TGeoVolume;
35class TGeoVolumeAssembly;
36using namespace std;
37using namespace cbm::trd;
39{
40 enum class eException
41 {
42 invalid_type = 0,
44 };
45
50 struct info_t {
51 int address = -1;
52 int id = -1;
53 int superId = -1;
54 int type = -1;
55 int superType = -1;
56 int rotation = -1;
57 };
64 bool ReadModuleInfo(const char* modTxt, info_t& info);
65
71 bool ReadFebInfo(const char* febTxt, info_t& info);
72
77 int WriteModuleInfo(info_t* info);
78
82 int WriteFebInfo(info_t* info);
83
84
85 // chamber generic geometrical definitions
86 static double sizeX, sizeY;
87 static double activeAreaX, activeAreaY;
88 static map<const string, const TGeoMedium*> fMaterial = {};
89 const TGeoMedium* GetMaterial(const char* mname);
90
91
94 class ChamberBuilder : public FairTask {
95 public:
96 enum class eGeoPart : int
97 {
98 kRadiator = 0,
99 kWindow,
100 kVolume,
102 kFEB,
103 kNparts
104 };
106 {
107 kRadiator = 8
109 kFEB
110 };
111 class Component;
112 class Radiator;
113 class Window;
114 class Volume;
115 class BackPanel;
116 class FEB;
120 ChamberBuilder(int typ = 1);
121
122 TGeoVolume* GetModule() const { return fVol; }
123 bool HasFEB() const { return TESTBIT(fConfig, eConfig::kFEB); }
126 virtual InitStatus Init();
128 virtual void Exec(Option_t*);
130 virtual void Finish() { ; }
131
132 void SetFEB(bool feb = true) { feb ? SETBIT(fConfig, eConfig::kFEB) : CLRBIT(fConfig, eConfig::kFEB); }
133 void SetRadiator(bool rad = true)
134 {
136 }
137
138 private:
141
142 short fConfig = 0;
143 short fChmbTyp = 1;
145 static const int Nfebs = faspFeb[1].nmax;
146 const double feb_pos[Nfebs][2] = {{-18, -21.6}, {0, -21.6}, {18, -21.6}, {-18, -10.8}, {0, -10.8},
147 {18, -10.8}, {-18, 0.0}, {0, 0.0}, {18, 0.0}, {-18, +10.8},
148 {0, +10.8}, {18, +10.8}, {-18, +21.6}, {0, +21.6}, {18, +21.6}};
149 TGeoVolume* fVol = nullptr;
150 ClassDef(ChamberBuilder, 1) // Manager of the TRD support structure
151 };
152
153
156 class ChamberBuilder::Component : public FairTask {
157 public:
158 friend class ChamberBuilder;
162 Component(const char* name) : FairTask(name)
163 {
164 sizeX = 0;
165 sizeY = 0;
166 activeAreaX = 0;
167 activeAreaY = 0;
168 }
174 virtual InitStatus Init() = 0;
176 virtual void Exec(Option_t*) { ; }
178 virtual void Finish() { ; }
179 virtual double GetCenter() const;
180 virtual double GetHeight() const { return fHeight; }
181
182 static const char* fgName[(int) eGeoPart::kNparts];
183
184 protected:
185 TGeoVolume* fVol = nullptr;
186
187 private:
189 //Component operator=(const Component&);
190
191 double fHeight = 0;
192 ClassDef(ChamberBuilder::Component, 1) // Model for the TRD generic chamber component builder
193 };
194
196 public:
197 Radiator();
199 virtual InitStatus Init();
200
201 private:
203 const double radiator_thickness = 30.0;
204 ClassDef(ChamberBuilder::Radiator, 1) // Model for the TRD radiator
205 };
206
208 public:
211 Window();
213 virtual InitStatus Init();
214
215 private:
216 Window(const Window&);
217
218 const double winIn_C_thickness = 0.012;
219 const double winIn_HC_thickness = 0.9;
220 const double WIN_FrameX_thickness = 0.5;
221 const double WIN_FrameY_thickness = 0.6;
222 const double WIN_OutX_thickness = 0.35;
223 const double WIN_OutY_thickness = 0.30;
224 ClassDef(ChamberBuilder::Window, 1) // Model for the TRD2D entrance window
225 };
226
230 public:
233 Volume();
235 virtual InitStatus Init();
236
237 private:
238 Volume(const Volume&);
239
240 const double gas_extra = 0.6;
241 const double gas_thickness = 1.2;
242 const double ridge_height = 0.29;
243 const double ledge_thickness = gas_thickness / 3.;
244 const double cathode_width = 1.0;
245 const double anode_width = 0.65;
246 const double dist_width = 0.40;
247 const double WIN_OutX_thickness = 0.35;
248 const double WIN_OutY_thickness = 0.30;
249 ClassDef(ChamberBuilder::Volume, 1) // Model for the TRD active volume
250 };
251
258 public:
261 BackPanel();
263 virtual InitStatus Init();
264
265 private:
267 TGeoTranslation* tr = nullptr;
268 TString sexpr = "";
269
270 const double pp_pads_thickness = 0.0020;
271 const double pp_pcb_thickness = 0.0230;
272 const double hc_thickness = 2.30;
273 const double hc_unitx = 6.0;
274 const double hc_unity = 2.7;
275 const double hc_holex = 2.4;
276 const double hc_holey = 0.8;
277 const double cu_pcb_thickness = 0.0150;
278 const double cu_thickness = 0.0020;
279 const double BKP_Frame_width = 1.;
280 const double BKP_Frame_closure = 0.25;
281 const double BKP_OutX_thickness = 0.50;
282 const double BKP_OutY_thickness = 0.45;
283 const double BKP_OutY_correct = 0.15;
284
285 ClassDef(ChamberBuilder::BackPanel, 1) // Model for the TRD back panel
286 };
290 public:
293 FEB();
295 virtual InitStatus Init();
296
297 private:
298 FEB(const FEB&);
299 //ChamberBuilder::FEB operator=(const FEB&);
300 const double FASP_x = 1.10;
301 const double FASP_y = 1.10;
302 const double FASP_z = 0.10;
303 const double FPGA_x = 2.20;
304 const double FPGA_y = 2.20;
305 const double FPGA_z = 0.18;
306 const double ADC_x = 0.9;
307 const double ADC_y = 1.5;
308 const double ADC_z = 0.1;
309 const double DCDC_x = 1.5012;
310 const double DCDC_y = 0.8992;
311 const double DCDC_z = 0.4319;
312 const double ConnFC_x = 2.37;
313 const double ConnFC_y = 0.535;
314 const double ConnFC_z = 0.266;
315 const double ConnBRG_x = 0.5;
316 const double ConnBRG_y = 4.58;
317 const double ConnBRG_z = 0.658;
318
319 static const int FASPRO_Nly = 18;
320 static const int FASPRO_Nfasp = 12;
321 static const int FASPRO_Nadc = 6;
322 static const int FASPRO_Nfpga = 3;
323 static const int FASPRO_Ndcdc = 3;
324 const double FASPRO_zspace = 1.0;
325 const double FASPRO_length = 17.8;
326 const double FASPRO_width = 10.6;
327 const double FASPRO_hole_x = 2.2;
328 const double FASPRO_hole_y = 0.4;
329 const double FASPRO_ly_cu[FASPRO_Nly][2] = { // FASPRO(Cu) layer thickness [um] and covarage [%]
330 {54, 95}, {34, 10}, {16, 95}, {16, 10}, {16, 95}, {34, 10},
331 {16, 95}, {16, 10}, {16, 95}, {16, 95}, {16, 10}, {16, 95},
332 {34, 10}, {16, 95}, {16, 10}, {16, 95}, {34, 10}, {54, 95}};
333 const double FASPRO_ly_pcb[FASPRO_Nly - 1] = {// FASPRO(FR4) layer thickness [um]
334 100, 133, 100, 127, 100, 133, 100, 127, 100,
335 127, 100, 133, 100, 127, 100, 133, 100};
336 const double HOLE_pos[FASPRO_Nfasp][2] = {{-6, -3.55}, {-6, -1.55}, {-6, 1.55}, {-6, 3.55},
337 {0, -3.55}, {0, -1.55}, {0, 1.55}, {0, 3.55},
338 {+6, -3.55}, {+6, -1.55}, {+6, 1.55}, {+6, 3.55}};
339 const double FASP_pos[FASPRO_Nfasp][2] = {{-6, -4.5}, {-6, -2.5}, {-6, +2.5}, {-6, +4.5}, {0, -4.5}, {0, -2.5},
340 {0, +2.5}, {0, +4.5}, {+6, -4.5}, {+6, -2.5}, {+6, +2.5}, {+6, +4.5}};
341 const double ADC_pos[FASPRO_Nadc][2] = {{-4.15, -3.35}, {1.85, -3.35}, {7.85, -3.35},
342 {-4.15, +3.35}, {1.85, +3.35}, {7.85, +3.35}};
343 const double FPGA_pos[FASPRO_Nfpga][2] = {{-6, 0}, {0, 0}, {+6, 0}};
344 const double DCDC_pos[FASPRO_Ndcdc][2] = {{-3, 0.1}, {3, -1.2}, {2.89, 0.1}};
345 const double ConnFC_pos[FASPRO_Nfasp][2] = {{-6, -4.9}, {-6, -2.9}, {-6, 2.9}, {-6, 4.9}, {0, -4.9}, {0, -2.9},
346 {0, 2.9}, {0, 4.9}, {+6, -4.9}, {+6, -2.9}, {+6, 2.9}, {+6, 4.9}};
347 const double ConnBRG_pos[2][2] = {{-8.4, 0}, {+8.4, 0}};
348
349 ClassDef(ChamberBuilder::FEB, 1) // Model for the TRD FEB geometry
350 };
351} // namespace cbm::trd::geo
352#endif // CBMTRDGEOFACTORY_H_
#define SETBIT(n, i)
Definition RTypes.h:15
#define TESTBIT(n, i)
Definition RTypes.h:17
#define CLRBIT(n, i)
Definition RTypes.h:16
Inner class describing the back panel of composed of.
const double BKP_Frame_closure
Global width of the perimetral frame (including indentation)
const double hc_holey
dimension of flat-cable hole x-dimension (along wires)
const double BKP_OutY_thickness
outside framing
const double BKP_OutY_correct
outside framing
const double hc_holex
area opearted by one FASP 6 x 2.7 cm2
const double pp_pcb_thickness
cu coverage of PP PCB
const double cu_pcb_thickness
dimension of flat-cable hole x-dimension (along wires)
const double hc_unity
area opearted by one FASP 6 x 2.7 cm2
const double BKP_OutX_thickness
Perimetral frame indentation.
const double hc_unitx
Honneycomb backpanel support thickness.
const double hc_thickness
PP support PCB thickness.
const double BKP_Frame_width
Electric shield Cu covarage thickness.
const double cu_thickness
Electric shield PCB support thickness.
static const char * fgName[(int) eGeoPart::kNparts]
Component(const char *name)
Constructor of the TRD chamber component. It links the chamber class.
virtual InitStatus Init()=0
Init task.
Component(const Component &)
the geo volume itself
virtual void Exec(Option_t *)
Executed task.
Inner class describing the geometry of the TRD Front End Electronics (FEE):
const double FPGA_pos[FASPRO_Nfpga][2]
const double FASPRO_length
gap size between boards
const double FASPRO_ly_cu[FASPRO_Nly][2]
const double FASPRO_width
length of FASP FEBs in cm
virtual InitStatus Init()
Init task.
const double FASPRO_hole_x
width of FASP FEBs in cm
const double DCDC_pos[FASPRO_Ndcdc][2]
const double ConnFC_pos[FASPRO_Nfasp][2]
const double FASPRO_ly_pcb[FASPRO_Nly - 1]
const double FASP_pos[FASPRO_Nfasp][2]
const double ADC_pos[FASPRO_Nadc][2]
const double HOLE_pos[FASPRO_Nfasp][2]
virtual InitStatus Init()
Init task.
virtual InitStatus Init()
Init task.
const double ledge_thickness
closure to pad-plane dimension
const double gas_thickness
extra volume of gas parallel to wires
const double WIN_OutX_thickness
distance from anode to PP
const double WIN_OutY_thickness
outside framing
const double cathode_width
ledge thickness supporting A/K wires
const double ridge_height
active volume thickness
const double WIN_FrameX_thickness
9mm HC structure
const double WIN_OutY_thickness
outside framing at win 3.5x9 mm2
const double WIN_FrameY_thickness
entrance window framing 5x9 mm2
Window()
Constructor of entrance window for the TRD chamber.
const double WIN_OutX_thickness
entrance window framing 5x9 mm2
const double winIn_HC_thickness
100um C foil + 25um KaptonAl
virtual InitStatus Init()
Init task.
Generic Chamber builder.
array< Component *,(int) eGeoPart::kNparts > fComponent
chamber type [1, 3, 5, 7]
ChamberBuilder(int typ=1)
Constructor for the chamber. Adds all elements according to config.
short fChmbTyp
bit map of the setter flags
virtual void Exec(Option_t *)
Executed task.
static const int Nfebs
list of chamber component builders
@ kFEB
include FEB in chamber geometry
ChamberBuilder operator=(const ChamberBuilder &)
virtual InitStatus Init()
Init task.
const double feb_pos[Nfebs][2]
ChamberBuilder(const ChamberBuilder &)
virtual void Finish()
Finish task.
const TGeoMedium * GetMaterial(const char *mname)
material mapping (name, value)
bool ReadModuleInfo(const char *modTxt, info_t &info)
Identify information related to the module encrypted in the geoManager path. Based on legacy function...
bool ReadFebInfo(const char *febTxt, info_t &info)
Identify information related to one FEB encrypted in the geoManager path.
int WriteFebInfo(info_t *info)
Put up information related to the FEB and store it in the geoManager path.
static double sizeX
static double sizeY
int WriteModuleInfo(info_t *info)
Put up information related to the module and store it in the geoManager path. Based on legacy version...
static double activeAreaY
static map< const string, const TGeoMedium * > fMaterial
active area
static double activeAreaX
total area
static constexpr FEB faspFeb[2]
Definition CbmTrdDefs.h:158
Hash for CbmL1LinkKey.
Information to be storred in the geoManager path. Based on legacy class CbmTrdGeoHandler.
int type
global (wrt setup) id of element
int superType
version of element wrt superType family
int superId
local (wrt installation) id of element
int rotation
global type wrt TRD design