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"
24 #include "CLHEP/Geometry/Transform3D.h"
33 LogStream << MSG::ERROR <<
"execute: Could not retrieve StoredMaterialManager object from the detector store" <<
endmsg;
37 const GeoMaterial *Aluminum = materialManager->
getMaterial(
"std::Aluminium");
38 const GeoMaterial *OpAir = materialManager->
getMaterial(
"ZDC::opticalAir");
39 const GeoMaterial *OpSilicaCore = materialManager->
getMaterial(
"ZDC::opticalSilica");
40 const GeoMaterial *OpSilicaClad = materialManager->
getMaterial(
"ZDC::opticalSilicaClad");
41 const GeoMaterial *OpKapton = materialManager->
getMaterial(
"ZDC::opticalKapton");
46 const float coreDia = 0.60;
47 const float cladDia = 0.66;
48 const float buffDia = 0.71;
49 const float fiberPitchX = 1.425;
50 const float fiberPitchZ = 1.63;
51 const float tileSize = 11.4;
52 const float housingThickness = 5;
53 const float detectorInnerWidth = 4 * tileSize;
54 const float detectorInnerDepth = 8 * fiberPitchZ + buffDia;
55 const float footWidth = 91;
56 const float footDepth = 75;
57 const float footHeight = 10;
58 const float posX =
trf->getTransform().translation().x();
59 const float posY =
trf->getTransform().translation().y();
60 const float posZ =
trf->getTransform().translation().z();
62 const GeoBox* motherBox =
dynamic_cast<const GeoBox*
>(mother->getLogVol()->getShape());
63 const float halfY = motherBox->getYHalfLength();
66 const float detectorHeight = 2*halfY - footHeight;
67 const float readoutFiberLength = halfY -
posY - 2*tileSize;
72 GeoBox *Housing_Box =
new GeoBox((detectorInnerWidth + 2 * housingThickness) *
Gaudi::Units::mm * 0.5,
76 GeoLogVol *Housing_Logical =
new GeoLogVol(
"RPD_Housing_Logical", Housing_Box, Aluminum);
77 GeoFullPhysVol *Housing_Physical =
new GeoFullPhysVol(Housing_Logical);
84 GeoLogVol *Module_Logical =
new GeoLogVol(
"RPD_Module_Logical", Module_Box, OpAir);
85 GeoPhysVol *Module_Physical =
new GeoPhysVol(Module_Logical);
92 GeoLogVol *Foot_Logical =
new GeoLogVol(
"RPD_Foot_Logical", Foot_Box, Aluminum);
93 GeoPhysVol *Foot_Physical =
new GeoPhysVol(Foot_Logical);
98 GeoLogVol *Readout_Core_Logical =
new GeoLogVol(
"RPD_Core_Readout_Logical", Readout_Core_Tube, OpSilicaCore);
99 GeoPhysVol *Readout_Core_Physical =
new GeoPhysVol(Readout_Core_Logical);
103 GeoLogVol *Readout_Clad_Logical =
new GeoLogVol(
"RPD_Clad_Readout_Logical", Readout_Clad_Tube, OpSilicaClad);
104 GeoPhysVol *Readout_Clad_Physical =
new GeoPhysVol(Readout_Clad_Logical);
108 GeoLogVol *Readout_Buffer_Logical =
new GeoLogVol(
"RPD_Buff_Readout_Logical", Readout_Buffer_Tube, OpKapton);
109 GeoPhysVol *Readout_Buffer_Physical =
new GeoPhysVol(Readout_Buffer_Logical);
140 float startX = tileSize *
nCols * 0.5 - fiberPitchX / 4;
141 float startZ = -fiberPitchZ * (
nCols - 0.5) * 0.5;
142 const unsigned int NFIBERS = 64;
145 float fiberLength = (1 +
row) * tileSize;
150 sprintf(volName,
"RPD_Core_Active_Logical %d",
row);
152 GeoLogVol *Active_Core_Logical=
new GeoLogVol(volName, Active_Core_Tube, OpSilicaCore);
153 GeoPhysVol *Active_Core_Physical =
new GeoPhysVol(Active_Core_Logical);
156 sprintf(volName,
"RPD_Clad_Active_Logical %d",
row);
158 GeoLogVol *Active_Clad_Logical =
new GeoLogVol(volName, Active_Clad_Tube, OpSilicaClad);
159 GeoPhysVol *Active_Clad_Physical =
new GeoPhysVol(Active_Clad_Logical);
162 sprintf(volName,
"RPD_Buff_Active_Logical %d",
row);
164 GeoLogVol *Active_Buffer_Logical =
new GeoLogVol(volName, Active_Buffer_Tube, OpKapton);
165 GeoPhysVol *Active_Buffer_Physical =
new GeoPhysVol(Active_Buffer_Logical);
171 int index = fiber * 0.5;
175 float cycleOffset =
cycle *
nCols * fiberPitchX;
176 float patternOffsetX = -
pattern * fiberPitchX * 0.5;
177 float patternOffsetZ =
pattern * fiberPitchZ * 0.5;
179 float x = startX - tileSize *
col - cycleOffset + patternOffsetX -
index % 4 * fiberPitchX;
180 float z = startZ + fiberPitchZ * ((
row +
index % 4 + 2 *
pattern) % 4) + patternOffsetZ;
195 sprintf(volName,
"ZDC::RPD_Core_Active %s", channelHashStr.c_str());
196 Housing_Physical->add(
new GeoNameTag(volName));
197 Housing_Physical->add(
new GeoIdentifierTag(channelHash));
199 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
200 Housing_Physical->add(Active_Core_Physical);
203 sprintf(volName,
"ZDC::RPD_Core_Readout %s", channelHashStr.c_str());
204 Module_Physical->add(
new GeoNameTag(volName));
205 Module_Physical->add(
new GeoIdentifierTag(channelHash));
207 Module_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
208 Module_Physical->add(Readout_Core_Physical);
215 sprintf(volName,
"ZDC::RPD_Clad_Active %s", channelHashStr.c_str());
216 Housing_Physical->add(
new GeoNameTag(volName));
217 Housing_Physical->add(
new GeoIdentifierTag(channelHash));
219 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
220 Housing_Physical->add(Active_Clad_Physical);
223 sprintf(volName,
"ZDC::RPD_Clad_Readout %s", channelHashStr.c_str());
224 Module_Physical->add(
new GeoNameTag(volName));
226 Module_Physical->add(
new GeoIdentifierTag(channelHash));
227 Module_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
228 Module_Physical->add(Readout_Clad_Physical);
235 sprintf(volName,
"ZDC::RPD_Buffer_Active %s", channelHashStr.c_str());
236 Housing_Physical->add(
new GeoNameTag(volName));
237 Housing_Physical->add(
new GeoIdentifierTag(channelHash));
239 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
240 Housing_Physical->add(Active_Buffer_Physical);
243 sprintf(volName,
"ZDC::RPD_Buffer_Readout %s", channelHashStr.c_str());
244 Module_Physical->add(
new GeoNameTag(volName));
246 Module_Physical->add(
new GeoAlignableTransform(GeoTrf::RotateX3D(90 *
Gaudi::Units::deg)));
247 Module_Physical->add(
new GeoIdentifierTag(channelHash));
248 Module_Physical->add(Readout_Buffer_Physical);
257 sprintf(volName,
"ZDC::RPD_Air_Cavity %s",
id.getString().c_str());
258 Housing_Physical->add(
new GeoNameTag(volName));
259 Housing_Physical->add(
new GeoIdentifierTag(
id.get_identifier32().get_compact()));
260 Housing_Physical->add(
new GeoAlignableTransform(GeoTrf::TranslateY3D( 0.5 * (detectorHeight - readoutFiberLength) *
Gaudi::Units::mm)));
261 Housing_Physical->add(Module_Physical);
265 sprintf(volName,
"ZDC::RPD_Foot %s",
id.getString().c_str());
266 mother->add(
new GeoNameTag(volName));
267 mother->add(
new GeoIdentifierTag(
id.get_identifier32().get_compact()));
269 mother->add(Foot_Physical);
273 sprintf(volName,
"Zdc::RPD_Mod %s",
id.getString().c_str());
274 mother->add(
new GeoNameTag(volName));
275 mother->add(
new GeoIdentifierTag(
id.get_identifier32().get_compact()));
277 mother->add(Housing_Physical);