115 GeoTrf::Vector3D
a(0.0, 0.5 * sensorWidth, 0.5 * sensorLength);
116 GeoTrf::Vector3D b(0.0, -0.5 * sensorWidth,
a.z());
117 GeoTrf::Vector3D c(0.0, b.y(),-0.5 * sensorLength);
118 GeoTrf::Vector3D d(0.0,
a.y(), c.z());
121 GeoTrf::Vector3D e(0.0,
a.y(),
a.z());
122 GeoTrf::Vector3D f(0.0, b.y(), b.z());
123 GeoTrf::Vector3D g(0.0, c.y(), c.z());
124 GeoTrf::Vector3D
h(0.0, d.y(), d.z());
127 GeoTrf::Vector3D u(0.0,
132 GeoTrf::Vector3D
x(0.0, u.y(),w.z());
135 GeoTrf::Vector3D i(0.0,
136 0.5*outerSideHybridWidth,
137 m_outerSide->hybridOffsetZ() + 0.5*outerSidePigtailLength);
138 GeoTrf::Vector3D l(0.0,
139 -0.5*outerSideHybridWidth -
m_outerSide->pigtail()->width(), i.z());
140 GeoTrf::Vector3D m(0.0, l.y(),
141 m_outerSide->hybridOffsetZ() - 0.5*outerSidePigtailLength);
142 GeoTrf::Vector3D p(0.0, i.y(),
148 GeoTrf::Vector3D q(0.0, 0.5*outerSideHybridWidth,
m_outerSide->hybridOffsetZ() + 0.5*outerSideHybridLength );
149 GeoTrf::Vector3D
r(0.0, -0.5*innerSideHybridWidth, q.z());
150 GeoTrf::Vector3D s(0.0,
r.y(),
m_innerSide->hybridOffsetZ() - 0.5*innerSideHybridLength);
151 GeoTrf::Vector3D t(0.0, q.y(), s.z());
177 const double z_ab = std::max(
a.z(), b.z());
178 const double z_ef = std::max(e.z(), f.z());
179 const double z_cd = std::min(c.z(), d.z());
180 const double z_gh = std::min(g.z(),
h.z());
182 const double y_ad = std::max(
a.y(), d.y());
183 const double y_eh = std::max(e.y(),
h.y());
184 const double y_bc = std::min(b.y(), c.y());
185 const double y_fg = std::min(f.y(), g.y());
187 const double zmaxEnv1 = std::max(z_ab, z_ef);
188 const double zminEnv1 = std::min(z_cd, z_gh);
190 const double ypre_maxEnv1 = std::max(y_ad, y_eh);
191 const double ypre_minEnv1 = std::min(y_bc, y_fg);
193 const double ymaxEnv1 = std::max(ypre_maxEnv1, u.y());
194 const double yminEnv1 = std::min(ypre_minEnv1, v.y());
198 const double lengthEnv1 = zmaxEnv1 - zminEnv1;
199 const double widthEnv1 = ymaxEnv1 - yminEnv1;
202 const double xCenterEnv1 = 0.0;
203 const double yCenterEnv1 = yminEnv1 + 0.5*widthEnv1;
204 const double zCenterEnv1 = zmaxEnv1 - 0.5*lengthEnv1;
206 m_env1RefPointVector = std::make_unique<GeoTrf::Vector3D>(-xCenterEnv1, -yCenterEnv1, -zCenterEnv1);
209 const double z_ikl = std::max(i.z(), l.z());
210 const double z_qr = std::max(q.z(),
r.z());
211 const double z_mnp = std::min(m.z(), p.z());
212 const double z_st = std::min(s.z(), t.z());
214 const double y_ip = std::max(i.y(), p.y());
215 const double y_qt = std::max(q.y(), t.y());
216 const double y_lm = std::min(l.y(), m.y());
217 const double y_rs = std::min(
r.y(), s.y());
219 const double zmaxEnv2 = std::max(z_ikl, z_qr);
220 const double zminEnv2 = std::min(z_mnp, z_st);
222 const double ymaxEnv2 = std::max(y_ip, y_qt);
223 const double yminEnv2 = std::min(y_lm, y_rs);
225 const double thicknessEnv2 = 2.0*(
m_outerSide->hybridOffsetX() +
229 const double lengthEnv2 = zmaxEnv2 - zminEnv2;
230 const double widthEnv2 = ymaxEnv2 - yminEnv2;
233 const double xCenterEnv2 = 0.0;
234 const double yCenterEnv2 = ymaxEnv2 - 0.5*widthEnv2;
235 const double zCenterEnv2 = zmaxEnv2 - 0.5*lengthEnv2;
237 m_env2RefPointVector = std::make_unique<GeoTrf::Vector3D>(-xCenterEnv2, -yCenterEnv2, -zCenterEnv2);
241 const double xminSubBox = - 0.5*thicknessEnv2 - 2.0*
m_safety;
243 const double ymaxSubBox = std::min(
r.y(), s.y()) -
m_safety;
244 const double yminSubBox = yminEnv2 - 2.0*
m_safety;
246 const double zmaxSubBox = zmaxEnv1 + 2.0*
m_safety;
247 const double zminSubBox = zminEnv1 - 2.0*
m_safety;
249 const double thicknessSubBox = xmaxSubBox - xminSubBox;
250 const double widthSubBox = ymaxSubBox - yminSubBox;
251 const double lengthSubBox = zmaxSubBox - zminSubBox;
254 const double xCenterSubBox = xmaxSubBox - 0.5*thicknessSubBox;
255 const double yCenterSubBox = ymaxSubBox - 0.5*widthSubBox;
256 const double zCenterSubBox = zmaxSubBox - 0.5*lengthSubBox;
284 const GeoBox * subBox =
new GeoBox(0.5*thicknessSubBox, 0.5*widthSubBox, 0.6*lengthSubBox);
287 const GeoShape & moduleEnvelope = (*envelope1 << GeoTrf::Translate3D(xCenterEnv1, yCenterEnv1, zCenterEnv1)).
288 add(*envelope2 << GeoTrf::Translate3D(xCenterEnv2, yCenterEnv2, zCenterEnv2)).
289 subtract(*subBox << GeoTrf::Translate3D(xCenterSubBox, yCenterSubBox, zCenterSubBox));
291 const GeoLogVol * moduleLog =
new GeoLogVol(
getName(), &moduleEnvelope,
m_materials->gasMaterial());
296 GeoTrf::Transform3D rotInner = GeoTrf::RotateX3D(
m_stereoInner) * GeoTrf::RotateZ3D(180*Gaudi::Units::deg);
297 m_innerSidePos = std::make_unique<GeoTrf::Transform3D>(GeoTrf::Transform3D(GeoTrf::Translation3D(ISPosX, 0.0, 0.0)*rotInner));
303 m_outerSidePos = std::make_unique<GeoTrf::Transform3D>(GeoTrf::Transform3D(GeoTrf::Translation3D(OSPosX, 0.0, 0.0)*rotOuter));
310 m_baseBoardPos = std::make_unique<GeoTrf::Translate3D>(0.0, baseBoardPosY, baseBoardPosZ);
319 GeoFullPhysVol * module=
nullptr;
323 module=new GeoFullPhysVol(m_logVolume);
334 GeoTransform * baseBoardTransform =
new GeoTransform(*
m_baseBoardPos);
335 module->add(baseBoardTransform);
336 module->add(m_baseBoard->getVolume());
339 GeoAlignableTransform * innerTransform =
new GeoAlignableTransform(*
m_innerSidePos);
340 module->add(innerTransform);
342 module->add(new GeoNameTag("Side#"+intToString(innerSideNumber)));
343 module->add(new GeoIdentifierTag(innerSideNumber));
344 id.setSide(innerSideNumber);
347 module->add(innerSide);
352 GeoAlignableTransform * outerTransform =
new GeoAlignableTransform(*
m_outerSidePos);
353 module->add(outerTransform);
355 module->add(new GeoNameTag("Side#"+intToString(outerSideNumber)));
356 module->add(new GeoIdentifierTag(outerSideNumber));
357 id.setSide(outerSideNumber);
360 module->add(outerSide);
368 id.setSide(innerSideNumber);
373 std::string key=
"Side#"+
intToString(innerSideNumber)+
"_"+std::to_string(
id.getBarrelEC())+
"_"+std::to_string(
id.getLayerDisk())+
"_"+std::to_string(
id.getEtaModule())+
"_"+std::to_string(
id.getPhiModule());
379 id.setSide(outerSideNumber);
384 key=
"Side#"+
intToString(outerSideNumber)+
"_"+std::to_string(
id.getBarrelEC())+
"_"+std::to_string(
id.getLayerDisk())+
"_"+std::to_string(
id.getEtaModule())+
"_"+std::to_string(
id.getPhiModule());