7 #include "GeoModelKernel/GeoShape.h"
8 #include "GeoModelKernel/GeoBox.h"
9 #include "GeoModelKernel/GeoTube.h"
10 #include "GeoModelKernel/GeoLogVol.h"
11 #include "GeoModelKernel/GeoNameTag.h"
12 #include "GeoModelKernel/GeoPhysVol.h"
13 #include "GeoModelKernel/GeoFullPhysVol.h"
14 #include "GeoModelKernel/GeoTransform.h"
15 #include "GeoModelKernel/GeoIdentifierTag.h"
16 #include "GeoModelKernel/GeoAlignableTransform.h"
17 #include "GeoModelKernel/GeoDefinitions.h"
18 #include "GeoModelKernel/Units.h"
20 #include "GeoModelKernel/GeoMaterial.h"
21 #include "GaudiKernel/SystemOfUnits.h"
22 #include "GaudiKernel/MsgStream.h"
25 #include "CLHEP/Geometry/Transform3D.h"
32 const GeoMaterial *Aluminum = materialManager->
getMaterial(
"std::Aluminium");
33 const GeoMaterial *OpAir = materialManager->
getMaterial(
"ZDC::opticalAir");
34 const GeoMaterial *OpSilicaCore = materialManager->
getMaterial(
"ZDC::opticalSilica");
35 const GeoMaterial *OpSilicaClad = materialManager->
getMaterial(
"ZDC::opticalSilicaClad");
36 const GeoMaterial *OpKapton = materialManager->
getMaterial(
"ZDC::opticalKapton");
41 const float coreDia = 0.60;
42 const float cladDia = 0.66;
43 const float buffDia = 0.71;
44 const float fiberPitchX = 1.425;
45 const float fiberPitchZ = 1.63;
46 const float tileSize = 11.4;
47 const float housingThickness = 5;
48 const float detectorInnerWidth = 4 * tileSize;
49 const float detectorInnerDepth = 8 * fiberPitchZ + buffDia;
50 const float footWidth = 91;
51 const float footDepth = 75;
52 const float footHeight = 10;
53 const float posY =
m_trf.translation().y();
55 const GeoBox* motherBox =
dynamic_cast<const GeoBox*
>(mother->getLogVol()->getShape());
57 throw (std::runtime_error(
"ZDC_RPDModule::create: motherBox is a nullptr"));
59 const float halfY = motherBox->getYHalfLength();
62 const float detectorHeight = 2*halfY - footHeight;
63 const float readoutFiberLength = halfY -
posY - 2*tileSize;
75 GeoBox *Housing_Box =
new GeoBox((detectorInnerWidth + 2 * housingThickness) *
Gaudi::Units::mm * 0.5,
79 GeoLogVol *Housing_Logical =
new GeoLogVol(
"RPD_Housing_Logical", Housing_Box, Aluminum);
80 GeoFullPhysVol *Housing_Physical =
new GeoFullPhysVol(Housing_Logical);
87 GeoLogVol *Module_Logical =
new GeoLogVol(
"RPD_Module_Logical", Module_Box, OpAir);
88 GeoPhysVol *Module_Physical =
new GeoPhysVol(Module_Logical);
95 GeoLogVol *Foot_Logical =
new GeoLogVol(
"RPD_Foot_Logical", Foot_Box, Aluminum);
96 GeoPhysVol *Foot_Physical =
new GeoPhysVol(Foot_Logical);
101 GeoLogVol *Readout_Core_Logical =
new GeoLogVol(
"RPD_Core_Readout_Logical", Readout_Core_Tube, OpSilicaCore);
102 GeoPhysVol *Readout_Core_Physical =
new GeoPhysVol(Readout_Core_Logical);
106 GeoLogVol *Readout_Clad_Logical =
new GeoLogVol(
"RPD_Clad_Readout_Logical", Readout_Clad_Tube, OpSilicaClad);
107 GeoPhysVol *Readout_Clad_Physical =
new GeoPhysVol(Readout_Clad_Logical);
111 GeoLogVol *Readout_Buffer_Logical =
new GeoLogVol(
"RPD_Buff_Readout_Logical", Readout_Buffer_Tube, OpKapton);
112 GeoPhysVol *Readout_Buffer_Physical =
new GeoPhysVol(Readout_Buffer_Logical);
143 float startX = tileSize *
nCols * 0.5 - fiberPitchX / 4;
144 float startZ = -fiberPitchZ * (
nCols - 0.5) * 0.5;
145 const unsigned int NFIBERS = 64;
148 float fiberLength = (1 +
row) * tileSize;
153 sprintf(volName,
"RPD_Core_Active_Logical %d",
row);
155 GeoLogVol *Active_Core_Logical=
new GeoLogVol(volName, Active_Core_Tube, OpSilicaCore);
156 GeoPhysVol *Active_Core_Physical =
new GeoPhysVol(Active_Core_Logical);
159 sprintf(volName,
"RPD_Clad_Active_Logical %d",
row);
161 GeoLogVol *Active_Clad_Logical =
new GeoLogVol(volName, Active_Clad_Tube, OpSilicaClad);
162 GeoPhysVol *Active_Clad_Physical =
new GeoPhysVol(Active_Clad_Logical);
165 sprintf(volName,
"RPD_Buff_Active_Logical %d",
row);
167 GeoLogVol *Active_Buffer_Logical =
new GeoLogVol(volName, Active_Buffer_Tube, OpKapton);
168 GeoPhysVol *Active_Buffer_Physical =
new GeoPhysVol(Active_Buffer_Logical);
174 int index = fiber * 0.5;
178 float cycleOffset =
cycle *
nCols * fiberPitchX;
179 float patternOffsetX = -
pattern * fiberPitchX * 0.5;
180 float patternOffsetZ =
pattern * fiberPitchZ * 0.5;
182 float x = startX - tileSize *
col - cycleOffset + patternOffsetX -
index % 4 * fiberPitchX;
183 float z = startZ + fiberPitchZ * ((
row +
index % 4 + 2 *
pattern) % 4) + patternOffsetZ;
198 sprintf(volName,
"ZDC::RPD_Core_Active %s", channelHashStr.c_str());
199 Housing_Physical->add(
new GeoNameTag(volName));
200 Housing_Physical->add(
new GeoIdentifierTag(channelHash));
202 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
203 Housing_Physical->add(Active_Core_Physical);
206 sprintf(volName,
"ZDC::RPD_Core_Readout %s", channelHashStr.c_str());
207 Module_Physical->add(
new GeoNameTag(volName));
208 Module_Physical->add(
new GeoIdentifierTag(channelHash));
210 Module_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
211 Module_Physical->add(Readout_Core_Physical);
218 sprintf(volName,
"ZDC::RPD_Clad_Active %s", channelHashStr.c_str());
219 Housing_Physical->add(
new GeoNameTag(volName));
220 Housing_Physical->add(
new GeoIdentifierTag(channelHash));
222 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
223 Housing_Physical->add(Active_Clad_Physical);
226 sprintf(volName,
"ZDC::RPD_Clad_Readout %s", channelHashStr.c_str());
227 Module_Physical->add(
new GeoNameTag(volName));
229 Module_Physical->add(
new GeoIdentifierTag(channelHash));
230 Module_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
231 Module_Physical->add(Readout_Clad_Physical);
238 sprintf(volName,
"ZDC::RPD_Buffer_Active %s", channelHashStr.c_str());
239 Housing_Physical->add(
new GeoNameTag(volName));
240 Housing_Physical->add(
new GeoIdentifierTag(channelHash));
242 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
243 Housing_Physical->add(Active_Buffer_Physical);
246 sprintf(volName,
"ZDC::RPD_Buffer_Readout %s", channelHashStr.c_str());
247 Module_Physical->add(
new GeoNameTag(volName));
249 Module_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
250 Module_Physical->add(
new GeoIdentifierTag(channelHash));
251 Module_Physical->add(Readout_Buffer_Physical);
260 sprintf(volName,
"ZDC::RPD_Air_Cavity %s",
id.getString().c_str());
261 Housing_Physical->add(
new GeoNameTag(volName));
262 Housing_Physical->add(
new GeoIdentifierTag(
id.get_identifier32().get_compact()));
263 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::TranslateY3D( 0.5 * (detectorHeight - readoutFiberLength) *
Gaudi::Units::mm)));
264 Housing_Physical->add(Module_Physical);
268 sprintf(volName,
"ZDC::RPD_Foot %s",
id.getString().c_str());
269 mother->add(
new GeoNameTag(volName));
270 mother->add(
new GeoIdentifierTag(
id.get_identifier32().get_compact()));
271 mother->add(
new GeoAlignableTransform( footTrf ));
272 mother->add(Foot_Physical);
276 sprintf(volName,
"Zdc::RPD_Mod %s",
id.getString().c_str());
277 mother->add(
new GeoNameTag(volName));
278 mother->add(
new GeoIdentifierTag(
id.get_identifier32().get_compact()));
279 mother->add(
new GeoAlignableTransform( moduleTrf));
280 mother->add(Housing_Physical);