7 #include <Geant4/G4Box.hh>
8 #include <Geant4/G4Colour.hh>
9 #include <Geant4/G4LogicalVolume.hh>
10 #include <Geant4/G4PVPlacement.hh>
11 #include <Geant4/G4RotationMatrix.hh>
12 #include <Geant4/G4String.hh>
13 #include <Geant4/G4SystemOfUnits.hh>
14 #include <Geant4/G4ThreeVector.hh>
15 #include <Geant4/G4Transform3D.hh>
16 #include <Geant4/G4Tubs.hh>
17 #include <Geant4/G4Types.hh>
18 #include <Geant4/G4VisAttributes.hh>
47 , tower_angular_coverage(NAN)
48 , cemc_angular_coverage(NAN)
49 , active_scinti_fraction(0.78)
50 , sandwiches_per_tower(12)
65 for (
int i = 0;
i < 4;
i++)
96 G4LogicalVolume* cemc_log =
new G4LogicalVolume(cemc_tub, Air, G4String(
"CEmc"),
nullptr,
nullptr,
nullptr);
98 G4RotationMatrix cemc_rotm;
103 cemc_rotm.rotateX(
x_rot);
104 cemc_rotm.rotateY(
y_rot);
105 cemc_rotm.rotateZ(
z_rot);
108 G4LogicalVolume* tower_log =
new G4LogicalVolume(tower_tub, Air, G4String(
"CEmcTower"),
nullptr,
nullptr,
nullptr);
115 ostringstream tower_vol_name;
116 for (
int i = 0;
i < 7;
i++)
118 tower_vol_name <<
"CEmcTower_" <<
i;
120 G4RotationMatrix* tower_rotm =
new G4RotationMatrix();
121 tower_rotm->rotateZ(phi *
rad);
122 new G4PVPlacement(tower_rotm, G4ThreeVector(0, 0, 0), tower_log, tower_vol_name.str(), cemc_log,
false,
i,
OverlapCheck());
123 tower_vol_name.str(
"");
134 G4VSolid* sandwich_box =
new G4Box(
"Sandwich_box",
137 G4LogicalVolume* sandwich_log =
new G4LogicalVolume(sandwich_box,
139 G4String(
"CEmcSandwich"),
140 nullptr,
nullptr,
nullptr);
141 G4VisAttributes* sandwichVisAtt =
new G4VisAttributes();
142 sandwichVisAtt->SetVisibility(
true);
143 sandwichVisAtt->SetForceSolid(
true);
144 sandwichVisAtt->SetColour(G4Colour::White());
145 sandwich_log->SetVisAttributes(sandwichVisAtt);
146 ostringstream sandwich_name;
147 for (
int i = 0;
i < 12;
i++)
149 G4RotationMatrix* sandwich_rotm =
new G4RotationMatrix();
151 sandwich_rotm->rotateZ(phi *
rad);
152 sandwich_name <<
"CEmcSandwich_" <<
i;
160 new G4PVPlacement(sandwich_rotm, G4ThreeVector(xshift + xcorr, yshift + ycorr, 0),
164 sandwich_name.str(
"");
173 vector<G4LogicalVolume*> block_logic;
180 <<
" try between 0 and 1" << endl;
184 double sc_passive_thickness =
sc_dimension[1] - sc_active_thickness;
186 G4VSolid* block_w =
new G4Box(
"Tungsten_box",
188 G4VSolid* block_sc =
new G4Box(
"Scinti_box",
190 G4VSolid* block_passive_sc =
nullptr;
191 block_logic.push_back(
new G4LogicalVolume(block_w,
194 nullptr,
nullptr,
nullptr));
195 block_logic.push_back(
new G4LogicalVolume(block_sc,
198 nullptr,
nullptr,
nullptr));
199 G4VisAttributes* matVis =
new G4VisAttributes();
200 G4VisAttributes* matVis1 =
new G4VisAttributes();
201 matVis->SetVisibility(
true);
202 matVis->SetForceSolid(
true);
203 matVis->SetColour(G4Colour::Red());
204 matVis1->SetVisibility(
true);
205 matVis1->SetForceSolid(
true);
206 matVis1->SetColour(G4Colour::Green());
207 block_logic[0]->SetVisAttributes(matVis);
208 block_logic[1]->SetVisAttributes(matVis1);
240 sandwich_vol[2] =
new G4PVPlacement(
nullptr, G4ThreeVector(0, -sc_passive_thickness / 2., 0),
245 if (sc_passive_thickness > 0)
247 G4VisAttributes* matVis2 =
new G4VisAttributes();
248 matVis1->SetVisibility(
true);
249 matVis1->SetForceSolid(
true);
250 matVis1->SetColour(G4Colour::Blue());
251 block_passive_sc =
new G4Box(
"Passive_Scinti_box",
253 block_logic.push_back(
new G4LogicalVolume(block_passive_sc,
255 "Plate_log_Passive_Sc",
256 nullptr,
nullptr,
nullptr));
257 block_logic[2]->SetVisAttributes(matVis2);
261 sandwich_vol[3] =
new G4PVPlacement(
nullptr, G4ThreeVector(0, sc_active_thickness / 2., 0),
263 "CEmc_Passive_Si_plate",