3 #include <phparameter/PHParameters.h>
5 #include <Geant4/G4Colour.hh>
6 #include <Geant4/G4Element.hh>
7 #include <Geant4/G4LogicalVolume.hh>
8 #include <Geant4/G4Material.hh>
9 #include <Geant4/G4PVDivision.hh>
10 #include <Geant4/G4PVPlacement.hh>
11 #include <Geant4/G4RotationMatrix.hh>
12 #include <Geant4/G4SystemOfUnits.hh>
13 #include <Geant4/G4ThreeVector.hh>
14 #include <Geant4/G4Tubs.hh>
15 #include <Geant4/G4VPhysicalVolume.hh>
16 #include <Geant4/G4VisAttributes.hh>
28 , m_Params(parameters)
32 , fpcbcu_phys(nullptr)
33 , fmylar_phys(nullptr)
34 , fcarbon_phys(nullptr)
37 , mcarbon_phys(nullptr)
38 , mmylar_phys(nullptr)
39 , mpcbcu_phys(nullptr)
41 , mpcbcu2_phys(nullptr)
42 , mmylar2_phys(nullptr)
43 , mcarbon2_phys(nullptr)
48 , bpcbcu_phys(nullptr)
49 , bmylar_phys(nullptr)
50 , bcarbon_phys(nullptr)
51 , m_Active(m_Params->get_int_param(
"active"))
60 for (
int i = 0; i < 6; i++)
89 std::cout <<
" passed on parameters from macros :: " << std::endl;
90 std::cout <<
"n_fgas_layer :" << n_fgas_layer << std::endl;
91 std::cout <<
"n_bgas_layer : " << n_bgas_layer << std::endl;
92 std::cout <<
"gas_gap : " << gas_gap << std::endl;
93 std::cout <<
"glass_thick : " << glass_thick << std::endl;
94 std::cout <<
"carbon_thick : " << carbon_thick << std::endl;
95 std::cout <<
"pcb_thick : " << pcb_thick << std::endl;
96 std::cout <<
"cu_thick : " << cu_thick << std::endl;
97 std::cout <<
"honeycomb_thick : " << honeycomb_thick << std::endl;
98 std::cout <<
"mylar_thick : " << mylar_thick << std::endl;
99 std::cout <<
"Rin : " << Rin << std::endl;
100 std::cout <<
"Rout : " << Rout << std::endl;
101 std::cout <<
"z_begin : " << z_begin << std::endl;
104 double tot_thick = (n_fgas_layer + n_bgas_layer) * gas_gap + (n_fgas_layer + n_bgas_layer + 2) * glass_thick + 4. * carbon_thick + 3. * pcb_thick + 4. * cu_thick + 4 * mylar_thick + 2. *
honeycomb_thick;
105 double posz = z_begin + 0.5 * tot_thick;
109 std::cout <<
"Mother vol dimensions : " << std::endl;
110 std::cout <<
" z begin :" << z_begin << std::endl;
111 std::cout <<
" tot_thick :" << tot_thick << std::endl;
112 std::cout <<
" mid pos :" << posz << std::endl;
116 G4Tubs *Solid =
new G4Tubs(
"ToF_GVol_Solid", Rin, Rout, tot_thick / 2., 0., 360. *
deg);
144 G4Tubs *fhc_solid =
new G4Tubs(
"front_honeycomb_solid", Rin, Rout, 0.5 * honeycomb_thick, 0., 360 *
deg);
156 if (
Verbosity() > 1) std::cout <<
" Front HC mid pos :" << fhc_pos << std::endl;
159 G4Tubs *fpcb_solid =
new G4Tubs(
"front_pcb_solid", Rin, Rout, 0.5 * pcb_thick, 0., 360 *
deg);
167 double fpcb_pos = fhc_pos + 0.5 * honeycomb_thick + 0.5 *
pcb_thick;
171 if (
Verbosity() > 1) std::cout <<
" Front PCB mid pos : " << fpcb_pos << std::endl;
174 G4Tubs *fpcbcu_solid =
new G4Tubs(
"front_pcbcu_solid", Rin, Rout, 0.5 * cu_thick, 0., 360 *
deg);
182 double fpcbcu_pos = fpcb_pos + 0.5 * pcb_thick + 0.5 *
cu_thick;
186 if (
Verbosity() > 1) std::cout <<
" Front PCB Cu pos : " << fpcbcu_pos << std::endl;
189 G4Tubs *fmylar_solid =
new G4Tubs(
"front_mylar_solid", Rin, Rout, 0.5 * mylar_thick, 0., 360 *
deg);
197 double fmylar_pos = fpcbcu_pos + 0.5 * cu_thick + 0.5 *
mylar_thick;
201 if (
Verbosity() > 1) std::cout <<
" Front mylar pos :" << fmylar_pos << std::endl;
203 G4Tubs *fcarbon_solid =
new G4Tubs(
"front_carbon_solid", Rin, Rout, 0.5 * carbon_thick, 0., 360 *
deg);
211 double fcarbon_pos = fmylar_pos + 0.5 * mylar_thick + 0.5 *
carbon_thick;
215 if (
Verbosity() > 1) std::cout <<
" front Carbon pos :" << fcarbon_pos << std::endl;
217 double glass_begin_pos = fcarbon_pos + 0.5 *
carbon_thick;
218 double glass_mid_pos = 0.;
219 double gas_begin_pos = glass_begin_pos + glass_thick;
220 double gas_mid_pos = 0.;
232 G4Tubs *fglass_solid[n_fgas_layer + 1];
234 G4Tubs *fgas_solid[n_fgas_layer];
237 for (
int l = 0; l < n_fgas_layer + 1; l++)
251 fglass_solid[l] =
new G4Tubs(gl_solid_name, Rin, Rout, 0.5 * glass_thick, 0, 360. *
deg);
252 fglass_logic[l] =
new G4LogicalVolume(fglass_solid[l], plateglass, gl_logic_name, 0, 0, 0);
254 glass_mid_pos = glass_begin_pos + (l + 0.5) * glass_thick + l *
gas_gap;
259 if (l < n_fgas_layer)
273 fgas_solid[l] =
new G4Tubs(gas_solid_name, Rin, Rout, 0.5 * gas_gap, 0, 360. *
deg);
274 fgas_logic[l] =
new G4LogicalVolume(fgas_solid[l], G4_gas, gas_logic_name, 0, 0, 0);
276 gas_mid_pos = gas_begin_pos + (l + 0.5) * gas_gap + l * glass_thick;
283 std::cout <<
" Front glass layer : " << l <<
" glass mid : " << glass_mid_pos << std::endl;
284 std::cout <<
"Front gas layer : " << l <<
" gas mid : " << gas_mid_pos << std::endl;
290 G4Tubs *mcarbon_solid =
new G4Tubs(
"mid_carbon_solid", Rin, Rout, 0.5 * carbon_thick, 0., 360 *
deg);
293 double mcarbon_pos = glass_mid_pos + 0.5 * glass_thick + 0.5 *
carbon_thick;
296 if (
Verbosity() > 1) std::cout <<
" Middle Carbon pos :" << mcarbon_pos << std::endl;
299 G4Tubs *mmylar_solid =
new G4Tubs(
"middle_mylar_solid", Rin, Rout, 0.5 * mylar_thick, 0., 360 *
deg);
302 double mmylar_pos = mcarbon_pos + 0.5 * carbon_thick + 0.5 *
mylar_thick;
306 if (
Verbosity() > 1) std::cout <<
" Middle mylar pos :" << mmylar_pos << std::endl;
309 G4Tubs *mpcbcu_solid =
new G4Tubs(
"middle_pcbcu_solid", Rin, Rout, 0.5 * cu_thick, 0., 360 *
deg);
312 double mpcbcu_pos = mmylar_pos + 0.5 * mylar_thick + 0.5 *
cu_thick;
316 if (
Verbosity() > 1) std::cout <<
" Middle PCB Cu pos :" << mpcbcu_pos << std::endl;
319 G4Tubs *mpcb_solid =
new G4Tubs(
"middle_pcb_solid", Rin, Rout, 0.5 * pcb_thick, 0., 360 *
deg);
322 double mpcb_pos = mpcbcu_pos + 0.5 * cu_thick + 0.5 *
pcb_thick;
326 if (
Verbosity() > 1) std::cout <<
" Middle PCB pos :" << mpcb_pos << std::endl;
329 G4Tubs *mpcbcu2_solid =
new G4Tubs(
"middle_pcbcu2_solid", Rin, Rout, 0.5 * cu_thick, 0., 360 *
deg);
332 double mpcbcu2_pos = mpcb_pos + 0.5 * pcb_thick + 0.5 *
cu_thick;
335 if (
Verbosity() > 1) std::cout <<
" Middle PCB Cu pos :" << mpcbcu2_pos << std::endl;
337 G4Tubs *mmylar2_solid =
new G4Tubs(
"middle_mylar2_solid", Rin, Rout, 0.5 * mylar_thick, 0., 360 *
deg);
340 double mmylar2_pos = mpcbcu2_pos + 0.5 * cu_thick + 0.5 *
mylar_thick;
344 if (
Verbosity() > 1) std::cout <<
" Middle mylar pos :" << mmylar2_pos << std::endl;
347 G4Tubs *mcarbon2_solid =
new G4Tubs(
"mid_carbon2_solid", Rin, Rout, 0.5 * carbon_thick, 0., 360 *
deg);
350 double mcarbon2_pos = mmylar2_pos + 0.5 * mylar_thick + 0.5 *
carbon_thick;
352 if (
Verbosity() > 1) std::cout <<
" Middle PCB back Carbon pos :" << mcarbon2_pos << std::endl;
355 double bglass_begin_pos = mcarbon2_pos + 0.5 *
carbon_thick;
356 double bglass_mid_pos = 0.;
357 double bgas_begin_pos = bglass_begin_pos + glass_thick;
358 double bgas_mid_pos = 0.;
362 std::cout <<
" Back glass begin pos : " << bglass_begin_pos << std::endl;
363 std::cout <<
" Back gas begin pos : " << bgas_begin_pos << std::endl;
366 G4Tubs *bglass_solid[n_bgas_layer + 1];
368 G4Tubs *bgas_solid[n_bgas_layer];
371 for (
int l = 0; l < n_bgas_layer + 1; l++)
384 bglass_solid[l] =
new G4Tubs(bgl_solid_name, Rin, Rout, 0.5 * glass_thick, 0, 360. *
deg);
385 bglass_logic[l] =
new G4LogicalVolume(bglass_solid[l], plateglass, bgl_logic_name, 0, 0, 0);
387 bglass_mid_pos = bglass_begin_pos + (l + 0.5) * glass_thick + l *
gas_gap;
390 if (l < n_bgas_layer)
403 bgas_solid[l] =
new G4Tubs(bgas_solid_name, Rin, Rout, 0.5 * gas_gap, 0, 360. *
deg);
404 bgas_logic[l] =
new G4LogicalVolume(bgas_solid[l], G4_gas, bgas_logic_name, 0, 0, 0);
406 bgas_mid_pos = bgas_begin_pos + (l + 0.5) * gas_gap + l * glass_thick;
412 std::cout <<
" Back glass layer : " << l <<
" glass mid : " << bglass_mid_pos << std::endl;
413 std::cout <<
"Back gas layer : " << l <<
" gas mid : " << bgas_mid_pos << std::endl;
418 G4Tubs *bcarbon_solid =
new G4Tubs(
"mid_carbon2_solid", Rin, Rout, 0.5 * carbon_thick, 0., 360 *
deg);
421 double bcarbon_pos = bglass_mid_pos + 0.5 * glass_thick + 0.5 *
carbon_thick;
424 if (
Verbosity() > 1) std::cout <<
" back carbon mid :" << bcarbon_pos << std::endl;
427 G4Tubs *bmylar_solid =
new G4Tubs(
"back_mylar_solid", Rin, Rout, 0.5 * mylar_thick, 0., 360 *
deg);
430 double bmylar_pos = bcarbon_pos + 0.5 * carbon_thick + 0.5 *
mylar_thick;
434 if (
Verbosity() > 1) std::cout <<
" Back mylar pos :" << bmylar_pos << std::endl;
437 G4Tubs *bpcbcu_solid =
new G4Tubs(
"back_pcbcu_solid", Rin, Rout, 0.5 * cu_thick, 0., 360 *
deg);
440 double bpcbcu_pos = bmylar_pos + 0.5 * mylar_thick + 0.5 *
cu_thick;
444 if (
Verbosity() > 1) std::cout <<
" Middle PCB back Cu pos :" << bpcbcu_pos << std::endl;
447 G4Tubs *bpcb_solid =
new G4Tubs(
"back_pcb_solid", Rin, Rout, 0.5 * pcb_thick, 0., 360 *
deg);
450 double bpcb_pos = bpcbcu_pos + 0.5 * cu_thick + 0.5 *
pcb_thick;
454 if (
Verbosity() > 1) std::cout <<
" Back PCB pos :" << bpcb_pos << std::endl;
457 G4Tubs *bhc_solid =
new G4Tubs(
"front_honeycomb_solid", Rin, Rout, 0.5 * honeycomb_thick, 0., 360 *
deg);
464 if (
Verbosity() > 1) std::cout <<
" Front HC mid pos :" << bhc_pos << std::endl;