3 #include <phparameter/PHParameters.h>
4 #include <phparameter/PHParametersContainer.h>
8 #include <Geant4/G4Box.hh>
9 #include <Geant4/G4Color.hh>
10 #include <Geant4/G4LogicalVolume.hh>
11 #include <Geant4/G4Material.hh>
12 #include <Geant4/G4PVPlacement.hh>
13 #include <Geant4/G4RotationMatrix.hh>
14 #include <Geant4/G4String.hh>
15 #include <Geant4/G4SystemOfUnits.hh>
16 #include <Geant4/G4ThreeVector.hh>
17 #include <Geant4/G4Transform3D.hh>
18 #include <Geant4/G4VisAttributes.hh>
31 , m_ParamsContainer(params)
55 for (
int ilayer = 0; ilayer <
m_Layers; ilayer++)
63 double myL = 2 *
M_PI * dR;
64 int NUM = myL / cb_VTX_ladder_DY;
66 for (
int i = 0; i < 2; i++)
68 double LN = cb_VTX_ladder_DY * NUM;
69 double LN1 = cb_VTX_ladder_DY * (NUM + 1 + i);
70 if (LN / LN1 > 0.8) NUM = NUM + 1;
73 double cb_VTX_ladder_deltaphi = 2 *
M_PI / NUM;
74 string solidname =
"cb_VTX_ladder_Solid_" +
to_string(ilayer);
75 G4VSolid *
solid =
new G4Box(solidname, cb_VTX_ladder_Thickness / 2., cb_VTX_ladder_DY / 2., cb_VTX_ladder_DZ / 2.);
76 string logical_name =
"cb_VTX_ladder_Logic_" +
to_string(ilayer);
77 G4LogicalVolume *logical =
new G4LogicalVolume(solid, G4Material::GetMaterial(
"G4_Si"), logical_name);
78 G4VisAttributes *attr_cb_VTX_ladder =
nullptr;
83 attr_cb_VTX_ladder =
new G4VisAttributes(G4Color(0.0, 0.2, 0.8, 2.0));
86 attr_cb_VTX_ladder =
new G4VisAttributes(G4Color(0.0, 0.2, 0.8, 0.7));
89 attr_cb_VTX_ladder =
new G4VisAttributes(G4Color(0.0 + 0.1 *
double(ilayer - 3), 1., 1. - 0.1 *
double(ilayer - 3), 1.0));
92 attr_cb_VTX_ladder->SetForceSolid(
true);
93 logical->SetVisAttributes(attr_cb_VTX_ladder);
94 for (
int ia = 0; ia < NUM; ia++)
96 double phi = (ia * (cb_VTX_ladder_deltaphi));
97 double x = -dR *
cos(phi);
98 double y = -dR * sin(phi);
100 rot.rotateZ(cb_VTX_ladder_deltaphi * ia);
101 rot.rotateZ(-7. * deg);
102 ostringstream physname;
103 physname <<
"cb_VTX_ladder_Phys_" << ilayer <<
"_" << ia;
104 G4VPhysicalVolume *phy =
new G4PVPlacement(G4Transform3D(rot, G4ThreeVector(x, y, 0)),
105 logical, physname.str(),
117 cout <<
"JLeic VTX Detector:" << endl;
118 if (what ==
"ALL" || what ==
"VOLUME")
120 cout <<
"Version 0.1" << endl;