8 #include <phparameter/PHParameters.h>
10 #include <Geant4/G4Box.hh>
11 #include <Geant4/G4Cons.hh>
12 #include <Geant4/G4LogicalVolume.hh>
13 #include <Geant4/G4PVPlacement.hh>
14 #include <Geant4/G4PVReplica.hh>
15 #include <Geant4/G4RotationMatrix.hh>
16 #include <Geant4/G4String.hh>
17 #include <Geant4/G4SubtractionSolid.hh>
18 #include <Geant4/G4SystemOfUnits.hh>
19 #include <Geant4/G4ThreeVector.hh>
20 #include <Geant4/G4Transform3D.hh>
21 #include <Geant4/G4Trd.hh>
22 #include <Geant4/G4Tubs.hh>
23 #include <Geant4/G4Types.hh>
24 #include <Geant4/G4AssemblyVolume.hh>
25 #include <Geant4/G4NistManager.hh>
26 #include <Geant4/G4RotationMatrix.hh>
37 class G4VPhysicalVolume;
47 , m_Params(parameters)
48 , overlapcheck_sector(
false)
59 if (physvol == (*it).second)
92 G4NistManager* man = G4NistManager::Instance();
93 G4Element *elH =
new G4Element(
"Hydrogen", symbol =
"H", 1., 1.01 *
g / mole);
94 G4Element *elC =
new G4Element(
"Carbon", symbol =
"C", 6., 12.01 *
g / mole);
95 G4Element *elN =
new G4Element(
"Nitrogen", symbol =
"N", 7., 14.01 *
g / mole);
96 G4Element *elO =
new G4Element(
"Oxygen", symbol =
"O", 8., 16.00 *
g / mole);
100 mat_Epoxy =
new G4Material(
"EpoxyTTL", density = 1.16 *
g /
cm3, natoms = 4);
101 mat_Epoxy->AddElement(elH, 32);
102 mat_Epoxy->AddElement(elN, 2);
103 mat_Epoxy->AddElement(elO, 4);
104 mat_Epoxy->AddElement(elC, 15);
110 mat_ALN =
new G4Material(
"AluminiumNitrate", density = 3.255 *
g /
cm3, ncomponents = 2);
112 mat_ALN->AddElement(G4Element::GetElement(
"Al"), 1);
113 mat_ALN->AddElement(G4Element::GetElement(
"N"), 1);
118 mat_Solder_Tin =
new G4Material(
"Tin", z = 50., a = 118.7 *
g / mole, density = 7.310 *
g /
cm3);
123 G4Material *CarbonFiber =
new G4Material(
"CarbonFiber", density = 1.750*
g/
cm3, ncomponents=2);
124 CarbonFiber->AddMaterial(man->FindOrBuildMaterial(
"G4_C"), 74.5*perCent);
125 CarbonFiber->AddMaterial(mat_Epoxy, 25.50*perCent);
129 G4double det_height = 2.1 *
cm;
131 G4ThreeVector detzvec(0, 0, place_z);
135 G4AssemblyVolume* assemblyDetector =
new G4AssemblyVolume();
138 G4double baseplate_length = 43.1 *
mm;
139 G4double baseplate_width = 56.5 *
mm / 2;
140 G4double segmentlength = 6 * baseplate_length;
142 G4VSolid *sol_module_envelope =
new G4Trd(
"sol_module_envelope",
143 sin(
M_PI / 12.) * (rCenter-det_height/2), sin(
M_PI / 12.) * (rCenter + det_height/2),
144 segmentlength / 2, segmentlength / 2,
145 (det_height*1.001) / 2);
147 G4LogicalVolume *log_module_envelope =
new G4LogicalVolume(sol_module_envelope, Air,
"log_module_envelope");
149 G4double diameter_coolingtube = 5 *
mm;
150 G4double cooling_plate_height = 1 *
mm;
151 G4VSolid *sol_cooling_plate_top =
new G4Box(
"sol_cooling_plate_top",
152 sin(
M_PI / 12.) * (rCenter + diameter_coolingtube / 2 ),
154 cooling_plate_height / 2);
155 G4VSolid *sol_cooling_plate_bottom =
new G4Box(
"sol_cooling_plate_top",
156 sin(
M_PI / 12.) * (rCenter - diameter_coolingtube / 2 - cooling_plate_height),
158 cooling_plate_height / 2);
161 G4LogicalVolume *log_cooling_plate_top =
new G4LogicalVolume(sol_cooling_plate_top,
GetDetectorMaterial(
"G4_Al"),
"log_cooling_plate_barrel_top");
162 G4LogicalVolume *log_cooling_plate_bottom =
new G4LogicalVolume(sol_cooling_plate_bottom,
GetDetectorMaterial(
"G4_Al"),
"log_cooling_plate_barrel_bottom");
164 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(0, 0, diameter_coolingtube/2+cooling_plate_height/2), log_cooling_plate_top,
166 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(0, 0, -(diameter_coolingtube/2+cooling_plate_height/2)), log_cooling_plate_bottom,
167 "physical_cooling_plate_bottom", log_module_envelope,
false, 0,
overlapcheck_sector),
false);
173 G4double wallthickness_coolingtube = 1 *
mm;
174 G4VSolid *sol_cutout_tube =
new G4Box(
"sol_cutout_tube",
175 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
176 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
177 (segmentlength * 1.1) / 2);
178 G4VSolid *sol_cooling_tube =
new G4Box(
"sol_cooling_tube_tmp",
179 diameter_coolingtube / 2,
180 diameter_coolingtube / 2,
181 (segmentlength - 0.2 *
mm) / 2);
182 sol_cooling_tube =
new G4SubtractionSolid(G4String(
"sol_cooling_tube"), sol_cooling_tube, sol_cutout_tube, 0, G4ThreeVector(0,0,0));
184 G4LogicalVolume *Log_cooling_tube =
new G4LogicalVolume(sol_cooling_tube,
GetDetectorMaterial(
"G4_Al"),
"Log_cooling_tube");
188 G4VSolid *sol_water_cooling =
new G4Box(
"sol_water_cooling",
189 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
190 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
191 (segmentlength - 0.2 *
mm) / 2);
192 G4LogicalVolume *Log_water_cooling =
new G4LogicalVolume(sol_water_cooling,
197 G4VSolid *sol_internal_support_center =
new G4Box(
"sol_internal_support_center",
198 (1.5 * baseplate_width - diameter_coolingtube)/2,
199 diameter_coolingtube / 2,
202 G4LogicalVolume *Log_internal_support_center =
new G4LogicalVolume(sol_internal_support_center, CarbonFiber,
"Log_internal_support_center");
205 G4VSolid *sol_internal_support_edge =
new G4Box(
"sol_internal_support_edge",
206 (1.5 * baseplate_width - diameter_coolingtube - baseplate_width / 3)/2,
207 diameter_coolingtube / 2,
210 G4LogicalVolume *Log_internal_support_edge =
new G4LogicalVolume(sol_internal_support_edge, CarbonFiber,
"Log_internal_support_edge");
215 G4RotationMatrix *rotcooling =
new G4RotationMatrix();
216 rotcooling->rotateX(
M_PI / 2);
217 G4double leftedgeCU = sin(
M_PI / 12.) * (rCenter + det_height / 2 + cooling_plate_height / 2);
219 for (
int icup = 0; icup < maxicup; icup++)
221 G4double edgeshift = 0;
222 if (icup == 0) edgeshift = baseplate_width / 3;
223 if (icup == (maxicup - 1)) edgeshift = -baseplate_width / 3;
224 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift, 0, 0), Log_cooling_tube,
226 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift, 0, 0), Log_water_cooling,
228 if(icup!=0 && icup<(maxicup-2)){
229 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift + 0.75*baseplate_width, 0, 0), Log_internal_support_center,
231 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift + 0.75*baseplate_width, 2*baseplate_length, 0), Log_internal_support_center,
233 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift + 0.75*baseplate_width, -2*baseplate_length, 0), Log_internal_support_center,
235 }
else if(icup==0 || icup==(maxicup-2)){
236 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift + 0.75*baseplate_width - baseplate_width / 6, 0, 0), Log_internal_support_edge,
238 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift + 0.75*baseplate_width - baseplate_width / 6, 2*baseplate_length, 0), Log_internal_support_edge,
240 RegisterPhysicalVolume(
new G4PVPlacement(rotcooling, G4ThreeVector(-leftedgeCU + icup * 1.5 * baseplate_width + edgeshift + 0.75*baseplate_width - baseplate_width / 6, -2*baseplate_length, 0), Log_internal_support_edge,
247 G4double sensor_width = 21.2 *
mm;
248 G4double sensor_length = 42.0 *
mm;
249 G4double baseSH_width_top = baseplate_width / 2 - (0.1543*
cm/2);
250 G4double baseSH_width = baseplate_width / 2 - (0.232*
cm/2);
252 const int nLayers = 8;
253 std::string strLayerName[nLayers] = {
270 G4double thicknessLayer[nLayers] = {0.25 *
mm, 0.79 *
mm, 0.08 *
mm, 0.25 *
mm, 0.03 *
mm, 0.3 *
mm, 0.08 *
mm, 0.51 *
mm};
271 G4double widthLayer[nLayers] = {
272 baseplate_width - 0.3 *
mm,
274 sensor_width + 1 *
mm,
275 sensor_width + 1 *
mm,
276 sensor_width - 0.2 *
mm,
279 baseplate_width - 4 * mm};
280 G4double offsetLayer[nLayers] = {
283 (baseplate_width - widthLayer[2]) / 2 - 0.2 *
mm,
284 (baseplate_width - widthLayer[3]) / 2 - 0.2 *
mm,
285 (baseplate_width - widthLayer[4]) / 2 - 0.1 *
mm,
286 (baseplate_width - widthLayer[5] - 0.1 *
mm) / 2,
287 (baseplate_width - widthLayer[6] - 0.1 *
mm) / 2,
288 4 *
mm / 2 - 0.2 *
mm};
289 G4double lengthLayer[nLayers] = {
290 baseplate_length - 0.2 *
mm,
292 sensor_length + 0.2 *
mm,
293 sensor_length + 0.2 *
mm,
294 sensor_length - 0.2 *
mm,
297 baseplate_length - 0.2 *
mm};
298 bool layerActive[nLayers] = {
299 false,
false,
false,
false,
false,
true,
false,
false};
301 G4double thicknessDet = 0;
302 for (
int ilay = 0; ilay < nLayers; ilay++)
304 thicknessDet += thicknessLayer[ilay];
308 G4VSolid *sol_sensor_ladder =
new G4Box(
"sol_sensor_ladder",
312 G4LogicalVolume *log_sensor_ladder =
new G4LogicalVolume(sol_sensor_ladder, Air,
"log_sensor_ladder");
315 G4VSolid *sol_sensor_stack =
new G4Box(
"sol_sensor_stack",
317 baseplate_length / 2,
319 G4LogicalVolume *log_sensor_stack =
new G4LogicalVolume(sol_sensor_stack, Air,
"log_sensor_stack");
322 double z_start = -thicknessDet / 2;
323 for (
int ilay = 0; ilay < nLayers; ilay++)
325 const std::string layer_name =
"sensor_stack_" + strLayerName[ilay];
326 const std::string layer_name_Solid =
"sol_" + layer_name;
328 G4VSolid *sol_Module_Layer_Raw =
new G4Box(layer_name_Solid +
"_Raw",
329 widthLayer[ilay] / 2,
330 lengthLayer[ilay] / 2,
331 thicknessLayer[ilay] / 2);
333 G4LogicalVolume *Log_Layer =
new G4LogicalVolume(sol_Module_Layer_Raw,
334 materialLayer[ilay], layer_name +
"_Log");
337 new G4PVPlacement(0, G4ThreeVector(-offsetLayer[ilay], 0, z_start + thicknessLayer[ilay] / 2), Log_Layer,
340 z_start += thicknessLayer[ilay];
344 new G4PVReplica(
"TTL_Replicas_Modules", log_sensor_stack, log_sensor_ladder,
345 kYAxis, 6, baseplate_length);
346 G4double offsety = diameter_coolingtube/2 + cooling_plate_height + thicknessDet / 2;
347 G4double leftedge = sin(
M_PI / 12.) * (rCenter + diameter_coolingtube/2 + cooling_plate_height );
348 G4double leftedgebottom = sin(
M_PI / 12.) * (rCenter - diameter_coolingtube/2 - cooling_plate_height);
350 G4RotationMatrix *rotationSensor =
new G4RotationMatrix();
351 rotationSensor->rotateZ(-
M_PI);
353 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + baseplate_width / 2, 0, offsety), log_sensor_ladder,
356 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + baseplate_width / 2 + 2*baseSH_width_top + baseplate_width , 0, offsety), log_sensor_ladder,
358 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + baseplate_width / 2 + 2*baseSH_width_top + 2* baseplate_width, 0, offsety), log_sensor_ladder,
361 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + baseplate_width / 2 + 4*baseSH_width_top + 3* baseplate_width, 0, offsety), log_sensor_ladder,
363 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + baseplate_width / 2 + 4*baseSH_width_top + 4* baseplate_width, 0, offsety), log_sensor_ladder,
366 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + baseplate_width / 2 + 6*baseSH_width_top + 5* baseplate_width, 0, offsety), log_sensor_ladder,
368 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + baseplate_width / 2 + 6*baseSH_width_top + 6* baseplate_width, 0, offsety), log_sensor_ladder,
371 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + baseplate_width / 2 + 8*baseSH_width_top + 7* baseplate_width, 0, offsety), log_sensor_ladder,
375 G4double offsetyDown = diameter_coolingtube/2 + cooling_plate_height + thicknessDet / 2;
376 G4RotationMatrix *rotationSensorDown =
new G4RotationMatrix();
377 rotationSensorDown->rotateY(-
M_PI);
378 G4RotationMatrix *rotationSensorFlip =
new G4RotationMatrix();
379 rotationSensorFlip->rotateY(-
M_PI);
380 rotationSensorFlip->rotateZ(-
M_PI);
381 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorDown, G4ThreeVector(-leftedgebottom + baseSH_width + baseplate_width/2, 0, -offsetyDown), log_sensor_ladder,
383 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorFlip, G4ThreeVector(-leftedgebottom + baseSH_width + baseplate_width/2 + baseplate_width, 0, -offsetyDown), log_sensor_ladder,
386 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorDown, G4ThreeVector(-leftedgebottom + 3*baseSH_width + baseplate_width/2 + 2*baseplate_width, 0, -offsetyDown), log_sensor_ladder,
388 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorFlip, G4ThreeVector(-leftedgebottom + 3*baseSH_width + baseplate_width/2 + 3*baseplate_width, 0, -offsetyDown), log_sensor_ladder,
391 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorDown, G4ThreeVector(-leftedgebottom + 5*baseSH_width + baseplate_width/2 + 4*baseplate_width, 0, -offsetyDown), log_sensor_ladder,
393 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorFlip, G4ThreeVector(-leftedgebottom + 5*baseSH_width + baseplate_width/2 + 5*baseplate_width, 0, -offsetyDown), log_sensor_ladder,
395 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorDown, G4ThreeVector(-leftedgebottom + 7*baseSH_width + baseplate_width/2 + 6*baseplate_width, 0, -offsetyDown), log_sensor_ladder,
397 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorFlip, G4ThreeVector(-leftedgebottom + 7*baseSH_width + baseplate_width/2 + 7*baseplate_width, 0, -offsetyDown), log_sensor_ladder,
400 const int nLayers_SH = 4;
401 std::string strLayerName_SH[nLayers_SH] = {
406 G4Material *materialLayer_SH[nLayers_SH] = {
411 G4double thicknessLayer_SH[nLayers_SH] = {
416 G4double widthLayer_SH[nLayers_SH] = {
417 baseSH_width - 0.2 *
mm,
418 baseSH_width - 0.2 *
mm,
419 baseSH_width - 0.35 *
mm,
421 G4double offsetLayer_SH[nLayers_SH] = {
426 G4double lengthLayer_SH[nLayers_SH] = {
431 bool layerActive_SH[nLayers_SH] = {
432 false,
false,
false,
false};
434 G4double thicknessDet_SH = 0;
435 for (
int ilay = 0; ilay < nLayers_SH; ilay++)
437 thicknessDet_SH += thicknessLayer_SH[ilay];
441 G4VSolid *sol_SH_ladder =
new G4Box(
"sol_SH_ladder",
444 thicknessDet_SH / 2);
445 G4LogicalVolume *log_SH_ladder =
new G4LogicalVolume(sol_SH_ladder, Air,
"log_SH_ladder");
448 G4VSolid *sol_SH_stack =
new G4Box(
"sol_SH_stack",
450 baseplate_length / 2,
451 thicknessDet_SH / 2);
452 G4LogicalVolume *log_SH_stack =
new G4LogicalVolume(sol_SH_stack, Air,
"log_SH_stack");
455 double z_start_SH = -thicknessDet_SH / 2;
456 for (
int ilay = 0; ilay < nLayers_SH; ilay++)
458 const std::string layer_name =
"SH_stack_" + strLayerName_SH[ilay];
459 const std::string layer_name_Solid =
"sol_" + layer_name;
461 G4VSolid *sol_Module_Layer_Raw =
new G4Box(layer_name_Solid +
"_Raw",
462 widthLayer_SH[ilay] / 2,
463 lengthLayer_SH[ilay] / 2,
464 thicknessLayer_SH[ilay] / 2);
466 G4LogicalVolume *Log_Layer =
new G4LogicalVolume(sol_Module_Layer_Raw,materialLayer_SH[ilay], layer_name +
"_Log");
469 new G4PVPlacement(0, G4ThreeVector(-offsetLayer_SH[ilay], 0, z_start_SH + thicknessLayer_SH[ilay] / 2), Log_Layer,
471 layerActive_SH[ilay]);
472 z_start_SH += thicknessLayer_SH[ilay];
476 new G4PVReplica(
"SH_Replicas_Modules", log_SH_stack, log_SH_ladder,
477 kYAxis, 6, baseplate_length);
479 G4double offsety_SH = diameter_coolingtube/2 + cooling_plate_height + thicknessDet_SH / 2;
480 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + 1 * baseplate_width + baseSH_width_top - baseSH_width/2, 0, offsety_SH), log_SH_ladder,
482 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + 1 * baseplate_width + 1 * baseSH_width_top + baseSH_width / 2, 0, offsety_SH), log_SH_ladder,
485 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + 3 * baseplate_width + 3 * baseSH_width_top - baseSH_width / 2, 0, offsety_SH), log_SH_ladder,
487 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + 3 * baseplate_width + 3 * baseSH_width_top + baseSH_width / 2, 0, offsety_SH), log_SH_ladder,
490 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + 5 * baseplate_width + 5 * baseSH_width_top - baseSH_width / 2, 0, offsety_SH), log_SH_ladder,
492 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + 5 * baseplate_width + 5 * baseSH_width_top + baseSH_width / 2, 0, offsety_SH), log_SH_ladder,
495 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(-leftedge + 7 * baseplate_width + 7 * baseSH_width_top - baseSH_width / 2, 0, offsety_SH), log_SH_ladder,
497 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(-leftedge + 7 * baseplate_width + 7 * baseSH_width_top + baseSH_width / 2, 0, offsety_SH), log_SH_ladder,
500 G4double offsetyDown_SH = diameter_coolingtube/2 + cooling_plate_height + thicknessDet_SH / 2;
504 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorDown, G4ThreeVector(-leftedgebottom + 2 * baseplate_width + 1 * baseSH_width + baseSH_width / 2, 0, -offsetyDown_SH), log_SH_ladder,
506 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorFlip, G4ThreeVector(-leftedgebottom + 2 * baseplate_width + 2 * baseSH_width + baseSH_width / 2, 0, -offsetyDown_SH), log_SH_ladder,
509 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorDown, G4ThreeVector(-leftedgebottom + 4 * baseplate_width + 3 * baseSH_width + baseSH_width / 2, 0, -offsetyDown_SH), log_SH_ladder,
511 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorFlip, G4ThreeVector(-leftedgebottom + 4 * baseplate_width + 4 * baseSH_width + baseSH_width / 2, 0, -offsetyDown_SH), log_SH_ladder,
514 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorDown, G4ThreeVector(-leftedgebottom + 6 * baseplate_width + 5 * baseSH_width + baseSH_width / 2, 0, -offsetyDown_SH), log_SH_ladder,
517 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensorFlip, G4ThreeVector(-leftedgebottom + 6 * baseplate_width + 6 * baseSH_width + baseSH_width / 2, 0, -offsetyDown_SH), log_SH_ladder,
526 G4double moduleShift = 3 *
mm;
528 for (
int isec = 0; isec < 12; isec++)
532 G4RotationMatrix *motherrot =
new G4RotationMatrix();
533 motherrot->rotateX(
M_PI / 2);
534 motherrot->rotateY(
M_PI);
535 motherrot->rotateZ(
M_PI + (isec - 3) * 2 *
M_PI / 12.);
537 G4ThreeVector vec_central_transl((rCenter*
cos(
M_PI / 12.)+moduleShift) *
cos(isec * 2 *
M_PI / 12.), (rCenter*
cos(
M_PI / 12.)+moduleShift) * sin(isec * 2 *
M_PI / 12.), place_z);
538 assemblyDetector->AddPlacedVolume( log_module_envelope,vec_central_transl,motherrot);
539 for (
int ilen = 1; ilen < ((detlength / 2 - segmentlength / 2) / segmentlength); ilen++)
542 G4ThreeVector vec_det_fwdlayers_transl((rCenter*
cos(
M_PI / 12.)+moduleShift) *
cos(isec * 2 *
M_PI / 12.), (rCenter*
cos(
M_PI / 12.)+moduleShift) * sin(isec * 2 *
M_PI / 12.), place_z + ilen * segmentlength);
543 assemblyDetector->AddPlacedVolume(log_module_envelope, vec_det_fwdlayers_transl, motherrot);
545 G4ThreeVector vec_det_bcklayers_transl((rCenter*
cos(
M_PI / 12.)+moduleShift) *
cos(isec * 2 *
M_PI / 12.), (rCenter*
cos(
M_PI / 12.)+moduleShift) * sin(isec * 2 *
M_PI / 12.), place_z -ilen * segmentlength);
546 assemblyDetector->AddPlacedVolume(log_module_envelope, vec_det_bcklayers_transl, motherrot);
563 assemblyDetector->MakeImprint( logicWorld, detzvec,0 );
583 G4Element *elH =
new G4Element(
"Hydrogen", symbol =
"H", 1., 1.01 *
g / mole);
584 G4Element *elC =
new G4Element(
"Carbon", symbol =
"C", 6., 12.01 *
g / mole);
585 G4Element *elN =
new G4Element(
"Nitrogen", symbol =
"N", 7., 14.01 *
g / mole);
586 G4Element *elO =
new G4Element(
"Oxygen", symbol =
"O", 8., 16.00 *
g / mole);
590 mat_Epoxy =
new G4Material(
"EpoxyTTL", density = 1.16 *
g /
cm3, natoms = 4);
591 mat_Epoxy->AddElement(elH, 32);
592 mat_Epoxy->AddElement(elN, 2);
593 mat_Epoxy->AddElement(elO, 4);
594 mat_Epoxy->AddElement(elC, 15);
600 mat_ALN =
new G4Material(
"AluminiumNitrate", density = 3.255 *
g /
cm3, ncomponents = 2);
602 mat_ALN->AddElement(G4Element::GetElement(
"Al"), 1);
603 mat_ALN->AddElement(G4Element::GetElement(
"N"), 1);
608 mat_Solder_Tin =
new G4Material(
"Tin", z = 50., a = 118.7 *
g / mole, density = 7.310 *
g /
cm3);
611 G4double det_height = 2.0 *
cm;
621 G4VSolid *beampipe_cutout =
new G4Cons(
"ttl_beampipe_cutout",
624 det_height * 2 / 2.0,
626 G4VSolid *ttl_envelope_solid =
new G4Cons(
"ttl_envelope_solid_cutout",
631 ttl_envelope_solid =
new G4SubtractionSolid(G4String(
"ttl_envelope_solid"), ttl_envelope_solid, beampipe_cutout, 0, G4ThreeVector(xoffset, 0, 0.));
633 const G4Transform3D transform_Det_to_Hall =
638 G4LogicalVolume *DetectorLog_Det =
new G4LogicalVolume(ttl_envelope_solid, Air,
name_base +
"_Log");
645 G4double cooling_plate_height = 1 *
mm;
646 G4double diameter_coolingtube = 5*
mm;
647 G4double wallthickness_coolingtube = 1 *
mm;
649 G4VSolid *sol_module_envelope =
new G4Cons(
"sol_module_envelope_cutout",
654 sol_module_envelope =
new G4SubtractionSolid(G4String(
"sol_module_envelope_"), sol_module_envelope, beampipe_cutout, 0, G4ThreeVector(xoffset, 0, 0.));
655 G4LogicalVolume *log_module_envelope =
new G4LogicalVolume(sol_module_envelope, Air,
"log_module_envelope");
663 G4VSolid *sol_cooling_plate =
new G4Cons(
"sol_cooling_plate_cutout",
666 cooling_plate_height / 2.0,
668 sol_cooling_plate =
new G4SubtractionSolid(G4String(
"sol_cooling_plate"), sol_cooling_plate, beampipe_cutout, 0, G4ThreeVector(xoffset, 0, 0.));
670 G4LogicalVolume *log_cooling_plate =
new G4LogicalVolume(sol_cooling_plate,
GetDetectorMaterial(
"G4_Al"),
"log_cooling_plate");
671 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(0, 0, diameter_coolingtube/2+cooling_plate_height/2), log_cooling_plate,
673 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(0, 0, -diameter_coolingtube/2-cooling_plate_height/2), log_cooling_plate,
680 G4double sensor_width = 21.2 *
mm;
681 G4double sensor_length = 42.0 *
mm;
682 G4double baseplate_length = 43.1 *
mm;
683 G4double baseplate_width = 56.5 *
mm / 2;
685 const int nLayers = 8;
686 std::string strLayerName[nLayers] = {
696 G4double thicknessLayer[nLayers] = {
697 0.25 *
mm, 0.79 *
mm, 0.08 *
mm, 0.25 *
mm, 0.03 *
mm, 0.3 *
mm, 0.08 *
mm, 0.51 *
mm};
698 G4double widthLayer[nLayers] = {
699 baseplate_width - 0.3 *
mm,
701 sensor_width + 1 *
mm,
702 sensor_width + 1 *
mm,
703 sensor_width - 0.2 *
mm,
706 baseplate_width - 4 * mm};
707 G4double offsetLayer[nLayers] = {
710 (baseplate_width - widthLayer[2]) / 2 - 0.2 *
mm,
711 (baseplate_width - widthLayer[3]) / 2 - 0.2 *
mm,
712 (baseplate_width - widthLayer[4]) / 2 - 0.1 *
mm,
713 (baseplate_width - widthLayer[5] - 0.1 *
mm) / 2,
714 (baseplate_width - widthLayer[6] - 0.1 *
mm) / 2,
715 4 *
mm / 2 - 0.2 *
mm};
716 G4double lengthLayer[nLayers] = {
717 baseplate_length - 0.2 *
mm,
719 sensor_length + 0.2 *
mm,
720 sensor_length + 0.2 *
mm,
721 sensor_length - 0.2 *
mm,
724 baseplate_length - 0.2 *
mm};
725 bool layerActive[nLayers] = {
726 false,
false,
false,
false,
false,
true,
false,
false};
728 G4double thicknessDet = 0;
729 for (
int ilay = 0; ilay < nLayers; ilay++)
731 thicknessDet += thicknessLayer[ilay];
734 G4double segmentlength = baseplate_length;
735 G4VSolid *sol_sensor_stack =
new G4Box(
"sol_sensor_stack",
736 baseplate_length / 2,
739 G4LogicalVolume *log_sensor_stack =
new G4LogicalVolume(sol_sensor_stack, Air,
"log_sensor_stack");
742 double z_start = -thicknessDet / 2;
743 for (
int ilay = 0; ilay < nLayers; ilay++)
745 const std::string layer_name =
"sensor_stack_" + strLayerName[ilay];
746 const std::string layer_name_Solid =
"sol_" + layer_name;
748 G4VSolid *sol_Module_Layer_Raw =
new G4Box(layer_name_Solid +
"_Raw",
749 lengthLayer[ilay] / 2,
750 widthLayer[ilay] / 2,
751 thicknessLayer[ilay] / 2);
753 G4LogicalVolume *Log_Layer =
new G4LogicalVolume(sol_Module_Layer_Raw,
754 materialLayer[ilay], layer_name +
"_Log");
757 new G4PVPlacement(0, G4ThreeVector(0, -offsetLayer[ilay], z_start + thicknessLayer[ilay] / 2), Log_Layer,
760 z_start += thicknessLayer[ilay];
765 G4double baseSH_width = baseplate_width / 2;
766 const int nLayers_SH = 4;
767 std::string strLayerName_SH[nLayers_SH] = {
772 G4Material *materialLayer_SH[nLayers_SH] = {
777 G4double thicknessLayer_SH[nLayers_SH] = {
782 G4double widthLayer_SH[nLayers_SH] = {
783 baseSH_width - 0.2 *
mm,
784 baseSH_width - 0.2 *
mm,
785 baseSH_width - 0.35 *
mm,
787 G4double offsetLayer_SH[nLayers_SH] = {
792 G4double lengthLayer_SH[nLayers_SH] = {
797 bool layerActive_SH[nLayers_SH] = {
798 false,
false,
false,
false};
800 G4double thicknessDet_SH = 0;
801 for (
int ilay = 0; ilay < nLayers_SH; ilay++)
803 thicknessDet_SH += thicknessLayer_SH[ilay];
806 G4VSolid *sol_SH_stack =
new G4Box(
"sol_SH_stack",
807 baseplate_length / 2,
809 thicknessDet_SH / 2);
810 G4LogicalVolume *log_SH_stack =
new G4LogicalVolume(sol_SH_stack, Air,
"log_SH_stack");
813 double z_start_SH = -thicknessDet_SH / 2;
814 for (
int ilay = 0; ilay < nLayers_SH; ilay++)
816 const std::string layer_name =
"SH_stack_" + strLayerName_SH[ilay];
817 const std::string layer_name_Solid =
"sol_" + layer_name;
819 G4VSolid *sol_Module_Layer_Raw =
new G4Box(layer_name_Solid +
"_Raw",
820 lengthLayer_SH[ilay] / 2,
821 widthLayer_SH[ilay] / 2,
822 thicknessLayer_SH[ilay] / 2);
824 G4LogicalVolume *Log_Layer =
new G4LogicalVolume(sol_Module_Layer_Raw,
825 materialLayer_SH[ilay], layer_name +
"_Log");
828 new G4PVPlacement(0, G4ThreeVector(0,-offsetLayer_SH[ilay], z_start_SH + thicknessLayer_SH[ilay] / 2), Log_Layer,
830 layerActive_SH[ilay]);
831 z_start_SH += thicknessLayer_SH[ilay];
835 G4double fullsensor_width = baseSH_width+baseplate_width;
836 G4VSolid *sol_sensor_and_readout =
new G4Box(
"sol_sensor_and_readout",
838 fullsensor_width / 2,
839 thicknessDet_SH / 2);
840 G4LogicalVolume *log_sensor_and_readout =
new G4LogicalVolume(sol_sensor_and_readout, Air,
"log_sensor_and_readout");
843 RegisterPhysicalVolume(
new G4PVPlacement(0, G4ThreeVector(0, -fullsensor_width/2 + baseplate_width/2, -thicknessDet_SH/2+thicknessDet/2),
844 log_sensor_stack,
"SensorPlacedPhysical", log_sensor_and_readout,
false, 0,
overlapcheck_sector),
false);
846 log_SH_stack,
"ServiceHybridPlacedPhysical", log_sensor_and_readout,
false, 0,
overlapcheck_sector),
false);
848 G4double offsetzFront = diameter_coolingtube/2 + cooling_plate_height + thicknessDet_SH / 2;
849 G4double offsetzBack = -diameter_coolingtube/2 - cooling_plate_height - thicknessDet_SH / 2;
851 int rowYdir = (int) ( (rMax-(fullsensor_width/2)) / fullsensor_width);
852 for(
int row=rowYdir;row>=-rowYdir;row--){
856 int numSensorsRow = (int) ( ( 2* sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width + fullsensor_width/2) ,2)) ) / segmentlength );
857 if(numSensorsRow==0)
continue;
859 if ( numSensorsRow % 2 == 0) numSensorsRow-=1;
861 if( ( (
abs(row)*fullsensor_width) -(fullsensor_width/2)) < rMin ){
866 int numSensorLeftAdd = ceil( (xoffset -(segmentlength/2) - sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) ) / segmentlength );
867 int numSensorRightAdd = ceil( (xoffset -(segmentlength/2) + sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) ) / segmentlength );
870 auto TTLDetRowLeftSolid =
new G4Box(
"TTLDetRowLeftBox" +
std::to_string(row), (((numSensorsRow-1) /2 + numSensorLeftAdd)) * segmentlength / 2.0,fullsensor_width / 2.0,thicknessDet_SH / 2.0);
871 auto TTLDetRowLeftLogical =
new G4LogicalVolume(TTLDetRowLeftSolid,Air,
"TTLDetRowLeftLogical" +
std::to_string(row));
873 new G4PVReplica(
"TTLDetRowLeftPhysical" +
std::to_string(row),log_sensor_and_readout,TTLDetRowLeftLogical,
874 kXAxis,((numSensorsRow-1) /2 + numSensorLeftAdd),segmentlength);
877 G4RotationMatrix *rotationSensor =
new G4RotationMatrix();
878 rotationSensor->rotateZ(-
M_PI);
879 new G4PVPlacement(row%2==0 ? rotationSensor : 0, G4ThreeVector( - ( (((numSensorsRow-1) /2 + numSensorLeftAdd)) * segmentlength / 2.0 + segmentlength / 2.0 - (numSensorLeftAdd* segmentlength)), (row*fullsensor_width), offsetzFront),
882 G4RotationMatrix *rotationSensorBck1 =
new G4RotationMatrix();
883 rotationSensorBck1->rotateX(-
M_PI);
884 G4RotationMatrix *rotationSensorBck2 =
new G4RotationMatrix();
885 rotationSensorBck2->rotateZ(-
M_PI);
886 rotationSensorBck2->rotateX(-
M_PI);
887 new G4PVPlacement(row%2==0 ? rotationSensorBck2 : rotationSensorBck1, G4ThreeVector( - ( (((numSensorsRow-1) /2 + numSensorLeftAdd)) * segmentlength / 2.0 + segmentlength / 2.0 - (numSensorLeftAdd* segmentlength)), (row*fullsensor_width), offsetzBack),
890 G4VSolid *sol_cutout_tube_left =
new G4Box(
"sol_cutout_tube_left" +
std::to_string(row),
891 1.3*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) + xoffset)/2,
892 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
893 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
894 G4VSolid *sol_cooling_tube_left =
new G4Box(
"sol_cooling_tube_left_tmp" +
std::to_string(row),
895 0.86*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) + xoffset)/2,
896 diameter_coolingtube / 2,
897 diameter_coolingtube / 2);
898 sol_cooling_tube_left =
new G4SubtractionSolid(G4String(
"sol_cooling_tube_left" +
std::to_string(row)), sol_cooling_tube_left, sol_cutout_tube_left, 0, G4ThreeVector(0,0,0));
899 G4LogicalVolume *Log_cooling_tube_left =
new G4LogicalVolume(sol_cooling_tube_left,
904 G4VSolid *sol_water_cooling_left =
new G4Box(
"sol_water_cooling_left" +
std::to_string(row),
905 0.85*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) + xoffset)/2,
906 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
907 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
908 G4LogicalVolume *Log_water_cooling_left =
new G4LogicalVolume(sol_water_cooling_left,
913 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(- ( (((numSensorsRow-1) /2 + numSensorLeftAdd)) * segmentlength / 2.0 + segmentlength / 2.0 - (numSensorLeftAdd* segmentlength)), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_cooling_tube_left,
915 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(- ( (((numSensorsRow-1) /2 + numSensorLeftAdd)) * segmentlength / 2.0 + segmentlength / 2.0 - (numSensorLeftAdd* segmentlength)), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_water_cooling_left,
920 auto TTLDetRowRightSolid =
new G4Box(
"TTLDetRowRightBox" +
std::to_string(row), (((numSensorsRow-1) /2 - numSensorRightAdd)) * segmentlength / 2.0,fullsensor_width / 2.0,thicknessDet_SH / 2.0);
921 auto TTLDetRowRightLogical =
new G4LogicalVolume(TTLDetRowRightSolid,Air,
"TTLDetRowRightLogical" +
std::to_string(row));
924 new G4PVReplica(
"TTLDetRowRightPhysical" +
std::to_string(row),log_sensor_and_readout,TTLDetRowRightLogical,
925 kXAxis,((numSensorsRow-1) /2 - numSensorRightAdd ),segmentlength);
927 new G4PVPlacement(row%2==0 ? rotationSensor : 0, G4ThreeVector(( (((numSensorsRow-1) /2 - numSensorRightAdd)) * segmentlength / 2.0 + segmentlength / 2.0 + (numSensorRightAdd* segmentlength)), (row*fullsensor_width), offsetzFront),
930 new G4PVPlacement(row%2==0 ? rotationSensorBck2 : rotationSensorBck1, G4ThreeVector(( (((numSensorsRow-1) /2 - numSensorRightAdd)) * segmentlength / 2.0 + segmentlength / 2.0 + (numSensorRightAdd* segmentlength)), (row*fullsensor_width), offsetzBack),
934 G4VSolid *sol_cutout_tube_right =
new G4Box(
"sol_cutout_tube_right" +
std::to_string(row),
935 1.3*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) - xoffset)/2,
936 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
937 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
938 G4VSolid *sol_cooling_tube_right =
new G4Box(
"sol_cooling_tube_right_tmp" +
std::to_string(row),
939 0.86*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) - xoffset)/2,
940 diameter_coolingtube / 2,
941 diameter_coolingtube / 2);
942 sol_cooling_tube_right =
new G4SubtractionSolid(G4String(
"sol_cooling_tube_right" +
std::to_string(row)), sol_cooling_tube_right, sol_cutout_tube_right, 0, G4ThreeVector(0,0,0));
943 G4LogicalVolume *Log_cooling_tube_right =
new G4LogicalVolume(sol_cooling_tube_right,
948 G4VSolid *sol_water_cooling_right =
new G4Box(
"sol_water_cooling_right" +
std::to_string(row),
949 0.85*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) - xoffset)/2,
950 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
951 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
952 G4LogicalVolume *Log_water_cooling_right =
new G4LogicalVolume(sol_water_cooling_right,
957 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(( (((numSensorsRow-1) /2 - numSensorRightAdd)) * segmentlength / 2.0 + segmentlength / 2.0 + (numSensorRightAdd* segmentlength)), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_cooling_tube_right,
959 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(( (((numSensorsRow-1) /2 - numSensorRightAdd)) * segmentlength / 2.0 + segmentlength / 2.0 + (numSensorRightAdd* segmentlength)), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_water_cooling_right,
965 int numSensorsInner = ceil( ( 2* sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2)) ) / segmentlength );
967 if ( numSensorsInner % 2 == 0) numSensorsInner+=1;
970 auto TTLDetRowSolid =
new G4Box(
"TTLDetRowBox" +
std::to_string(row), (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0,fullsensor_width / 2.0,thicknessDet_SH / 2.0);
971 auto TTLDetRowLogical =
new G4LogicalVolume(TTLDetRowSolid,Air,
"TTLDetRowLogical" +
std::to_string(row));
974 new G4PVReplica(
"TTLDetRowPhysical" +
std::to_string(row),log_sensor_and_readout,TTLDetRowLogical,
975 kXAxis,(numSensorsRow - numSensorsInner) / 2,segmentlength);
977 G4RotationMatrix *rotationSensor =
new G4RotationMatrix();
978 rotationSensor->rotateZ(-
M_PI);
979 RegisterPhysicalVolume(
new G4PVPlacement(row%2==0 ? rotationSensor : 0, G4ThreeVector( - ( ( numSensorsInner / 2.0 ) * segmentlength ) - ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), (row*fullsensor_width), offsetzFront),
982 RegisterPhysicalVolume(
new G4PVPlacement(row%2==0 ? rotationSensor : 0, G4ThreeVector( ( ( numSensorsInner / 2.0 ) * segmentlength ) + ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), (row*fullsensor_width), offsetzFront),
985 G4RotationMatrix *rotationSensorBck1 =
new G4RotationMatrix();
986 rotationSensorBck1->rotateX(-
M_PI);
987 G4RotationMatrix *rotationSensorBck2 =
new G4RotationMatrix();
988 rotationSensorBck2->rotateZ(-
M_PI);
989 rotationSensorBck2->rotateX(-
M_PI);
991 RegisterPhysicalVolume(
new G4PVPlacement(row%2==0 ? rotationSensorBck2 : rotationSensorBck1, G4ThreeVector( - ( ( numSensorsInner / 2.0 ) * segmentlength ) - ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), (row*fullsensor_width), offsetzBack),
994 RegisterPhysicalVolume(
new G4PVPlacement(row%2==0 ? rotationSensorBck2 : rotationSensorBck1, G4ThreeVector( ( ( numSensorsInner / 2.0 ) * segmentlength ) + ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), (row*fullsensor_width), offsetzBack),
998 G4VSolid *sol_cutout_tube_bothsides =
new G4Box(
"sol_cutout_tube_bothsides" +
std::to_string(row),
999 1.3*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) )/2,
1000 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
1001 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
1002 G4VSolid *sol_cooling_tube_bothsides =
new G4Box(
"sol_cooling_tube_bothsides_tmp" +
std::to_string(row),
1003 0.96*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)) )/2,
1004 diameter_coolingtube / 2,
1005 diameter_coolingtube / 2);
1006 sol_cooling_tube_bothsides =
new G4SubtractionSolid(G4String(
"sol_cooling_tube_bothsides" +
std::to_string(row)), sol_cooling_tube_bothsides, sol_cutout_tube_bothsides, 0, G4ThreeVector(0,0,0));
1007 G4LogicalVolume *Log_cooling_tube_bothsides =
new G4LogicalVolume(sol_cooling_tube_bothsides,
1012 G4VSolid *sol_water_cooling_bothsides =
new G4Box(
"sol_water_cooling_bothsides" +
std::to_string(row),
1013 0.95*(sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) ,2))- sqrt(pow(rMin,2)-pow( (
abs(row)*fullsensor_width)-(fullsensor_width/2) ,2)))/2,
1014 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
1015 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
1016 G4LogicalVolume *Log_water_cooling_bothsides =
new G4LogicalVolume(sol_water_cooling_bothsides,
1021 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(- ( ( numSensorsInner / 2.0 ) * segmentlength ) - ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_cooling_tube_bothsides,
1023 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(( ( numSensorsInner / 2.0 ) * segmentlength ) + ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_cooling_tube_bothsides,
1025 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(- ( ( numSensorsInner / 2.0 ) * segmentlength ) - ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_water_cooling_bothsides,
1027 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(( ( numSensorsInner / 2.0 ) * segmentlength ) + ( (numSensorsRow - numSensorsInner) / 2 * segmentlength / 2.0 ), row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_water_cooling_bothsides,
1032 auto TTLDetRowSolid =
new G4Box(
"TTLDetRowBox" +
std::to_string(row), numSensorsRow * segmentlength / 2.0,fullsensor_width / 2.0,thicknessDet_SH / 2.0);
1033 auto TTLDetRowLogical =
new G4LogicalVolume(TTLDetRowSolid,Air,
"TTLDetRowLogical" +
std::to_string(row));
1036 new G4PVReplica(
"TTLDetRowPhysicalReplica" +
std::to_string(row),log_sensor_and_readout,TTLDetRowLogical,
1037 kXAxis,numSensorsRow,segmentlength);
1039 G4RotationMatrix *rotationSensor =
new G4RotationMatrix();
1040 rotationSensor->rotateZ(-
M_PI);
1041 RegisterPhysicalVolume(
new G4PVPlacement(row%2==0 ? rotationSensor : 0, G4ThreeVector(0, (row*fullsensor_width), offsetzFront),
1044 G4RotationMatrix *rotationSensorBck1 =
new G4RotationMatrix();
1045 rotationSensorBck1->rotateX(-
M_PI);
1046 G4RotationMatrix *rotationSensorBck2 =
new G4RotationMatrix();
1047 rotationSensorBck2->rotateZ(-
M_PI);
1048 rotationSensorBck2->rotateX(-
M_PI);
1049 RegisterPhysicalVolume(
new G4PVPlacement(row%2==0 ? rotationSensorBck2 : rotationSensorBck1, G4ThreeVector(0, (row*fullsensor_width), offsetzBack),
1053 G4VSolid *sol_cutout_tube =
new G4Box(
"sol_cutout_tube" +
std::to_string(row),
1054 2.5*sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) + diameter_coolingtube ,2))/2,
1055 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
1056 (diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
1057 G4VSolid *sol_cooling_tube =
new G4Box(
"sol_cooling_tube_tmp" +
std::to_string(row),
1058 0.98*2*sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) + diameter_coolingtube ,2))/2,
1059 diameter_coolingtube / 2,
1060 diameter_coolingtube / 2);
1061 sol_cooling_tube =
new G4SubtractionSolid(G4String(
"sol_cooling_tube" +
std::to_string(row)), sol_cooling_tube, sol_cutout_tube, 0, G4ThreeVector(0,0,0));
1062 G4LogicalVolume *Log_cooling_tube =
new G4LogicalVolume(sol_cooling_tube,
1067 G4VSolid *sol_water_cooling =
new G4Box(
"sol_water_cooling" +
std::to_string(row),
1068 0.97*2*sqrt(pow(rMax,2)-pow( (
abs(row)*fullsensor_width) - (fullsensor_width/2.0) + diameter_coolingtube ,2))/2,
1069 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2,
1070 0.99*(diameter_coolingtube - 2*wallthickness_coolingtube) / 2);
1071 G4LogicalVolume *Log_water_cooling =
new G4LogicalVolume(sol_water_cooling,
1076 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(0, row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_cooling_tube,
1078 RegisterPhysicalVolume(
new G4PVPlacement(rotationSensor, G4ThreeVector(0, row>0 ? (row*fullsensor_width) - (fullsensor_width/2.0) : (row*fullsensor_width) + (fullsensor_width/2.0), 0), Log_water_cooling,
1091 <<
"PHG4TTLDetector::RegisterVolume - Error - invalid volume!"
1097 std::cout <<
"PHG4TTLDetector::RegisterVolume - Warning - replacing " << v->GetName() << std::endl;
1112 <<
"PHG4TTLDetector::RegisterPhysicalVolume - Error - invalid volume!"
1122 <<
"PHG4TTLDetector::RegisterPhysicalVolume - Warning - replacing "
1123 << v->GetName() <<
"[" << v->GetCopyNo() <<
"]" << std::endl;