7 #include "GaudiKernel/SystemOfUnits.h"
8 #include "GeoModelKernel/GeoCutVolAction.h"
9 #include "GeoModelKernel/GeoDefinitions.h"
10 #include "GeoModelKernel/GeoIdentifierTag.h"
11 #include "GeoModelKernel/GeoLogVol.h"
12 #include "GeoModelKernel/GeoMaterial.h"
13 #include "GeoModelKernel/GeoNameTag.h"
14 #include "GeoModelKernel/GeoPhysVol.h"
15 #include "GeoModelKernel/GeoShapeIntersection.h"
16 #include "GeoModelKernel/GeoShapeShift.h"
17 #include "GeoModelKernel/GeoShapeSubtraction.h"
18 #include "GeoModelKernel/GeoTransform.h"
19 #include "GeoModelKernel/GeoTrd.h"
20 #include "GeoModelKernel/GeoVFullPhysVol.h"
30 #define skip_rpc false
34 const std::array<std::string, 7> biRpcs = {
"RPC26",
"RPC27",
"RPC28",
"RPC29",
"RPC30",
"RPC31",
"RPC32"};
35 constexpr
double const &rpc3GapLayerThickness = 11.8;
36 constexpr
double const &rpc3GapMaxThickness = 36.0;
64 std::vector<Cutout *> vcutdef;
66 return build(matManager, mysql, minimalgeo, cutoutson, vcutdef);
71 int minimalgeo,
int cutoutson,
72 const std::vector<Cutout *>& vcutdef) {
84 double extSupThick =
r->externalSupPanelThickness;
85 double extAlSupThick =
r->externalAlSupPanelThickness;
86 double rpcLayerThickness =
r->rpcLayerThickness;
87 double centSupThick =
r->centralSupPanelThickness;
88 double centAlSupThick =
r->centralAlSupPanelThickness;
94 rpcLayerThickness = rpc3GapLayerThickness;
105 if (cutoutson && !vcutdef.empty()) {
107 GeoShape *cutoutShape =
nullptr;
109 for (
unsigned i = 0;
i < vcutdef.size();
i++) {
112 cutTrans = GeoTrf::Translate3D(0.0,
cut->dx, -
length / 2 +
cut->dy +
cut->lengthY / 2.);
113 srpc = &(srpc->subtract((*cutoutShape) << cutTrans));
117 const GeoMaterial *mrpc = matManager.
getMaterial(
"std::Air");
118 GeoLogVol *lrpc =
new GeoLogVol(
logVolName, srpc, mrpc);
119 GeoFullPhysVol *prpc =
new GeoFullPhysVol(lrpc);
124 if (geometry_version.compare(0, 1,
"M") != 0) {
137 GeoTrd *slpan =
new GeoTrd(extSupThick / 2, extSupThick / 2,
width / 2,
longWidth / 2,
length / 2);
139 new GeoTrd(extSupThick / 2 - extAlSupThick, extSupThick / 2 - extAlSupThick,
width / 2 - extAlSupThick,
longWidth / 2 - extAlSupThick,
length / 2 - extAlSupThick);
140 const GeoShape *sallpan = slpan;
141 const GeoShape *sholpan2 = sholpan;
142 const GeoMaterial *mallpan = matManager.
getMaterial(
"std::Aluminium");
143 GeoLogVol *lallpan =
new GeoLogVol(
"RPC_AL_extsuppanel", sallpan, mallpan);
144 PVRef pallpan =
PVRef (
new GeoPhysVol(lallpan));
145 const GeoMaterial *mholpan = matManager.
getMaterial(
"muo::RpcAlHonC");
146 GeoLogVol *lholpan =
new GeoLogVol(
"RPC_honeyc_extsuppanel", sholpan2, mholpan);
147 GeoPhysVol *pholpan =
new GeoPhysVol(lholpan);
148 pallpan->add(pholpan);
151 if (cutoutson && !vcutdef.empty()) {
154 for (
unsigned i = 0;
i < vcutdef.size();
i++) {
157 cutTrans = GeoTrf::Translate3D(0.0,
cut->dx, -
length / 2 +
cut->dy +
cut->lengthY / 2.);
159 GeoCutVolAction cutAction(*cutoutShape, cutTrans);
160 pallpan->apply(&cutAction);
161 pallpan =
PVRef (cutAction.getPV());
166 newpos += extSupThick / 2.;
167 GeoTransform *tlpan =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
177 newpos += extSupThick / 2.;
181 std::unique_ptr<RpcLayer>
rl = std::make_unique<RpcLayer>(
name,
this);
182 GeoVPhysVol *plowergg;
183 if (cutoutson && !vcutdef.empty()) {
184 plowergg =
rl->build(matManager, mysql, cutoutson, vcutdef);
186 plowergg =
rl->build(matManager, mysql);
189 newpos += rpcLayerThickness / 2.;
190 GeoTransform *tlgg =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
195 prpc->add(
new GeoIdentifierTag(1));
201 newpos += rpcLayerThickness / 2.;
202 GeoTrd *scpan =
new GeoTrd(centSupThick / 2, centSupThick / 2,
width / 2,
longWidth / 2,
length / 2);
203 GeoTrd *shocpan =
new GeoTrd(centSupThick / 2 - centAlSupThick, centSupThick / 2 - centAlSupThick,
width / 2 - centAlSupThick,
longWidth / 2 - centAlSupThick,
204 length / 2 - centAlSupThick);
206 const GeoShape *salcpan = scpan;
207 const GeoShape *shocpan2 = shocpan;
208 GeoLogVol *lalcpan =
new GeoLogVol(
"RPC_AL_midsuppanel", salcpan, mallpan);
209 PVRef palcpan =
PVRef (
new GeoPhysVol(lalcpan));
210 const GeoMaterial *mhocpan = matManager.
getMaterial(
"muo::RpcPapHonC");
211 GeoLogVol *lhocpan =
new GeoLogVol(
"RPC_honeyc_midsuppanel", shocpan2, mhocpan);
212 GeoPhysVol *phocpan =
new GeoPhysVol(lhocpan);
213 palcpan->add(phocpan);
216 if (cutoutson && !vcutdef.empty()) {
219 for (
unsigned i = 0;
i < vcutdef.size();
i++) {
222 cutTrans = GeoTrf::Translate3D(0.0,
cut->dx, -
length / 2 +
cut->dy +
cut->lengthY / 2.);
224 GeoCutVolAction cutAction(*cutoutShape, cutTrans);
225 palcpan->apply(&cutAction);
226 palcpan =
PVRef (cutAction.getPV());
231 newpos += centSupThick / 2.;
232 GeoTransform *tcpan =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
240 newpos += centSupThick / 2.;
244 std::unique_ptr<RpcLayer> ru = std::make_unique<RpcLayer>(
name,
this);
245 GeoVPhysVol *puppergg;
246 if (cutoutson && !vcutdef.empty()) {
251 for (
unsigned int i = 0;
i < vcutdef.size();
i++) {
253 ijob = vcutdef[
i]->ijob;
256 if (
name ==
"RPC06" && ijob == 3) {
260 vcutdef[
i]->dy = this->
length - vcutdef[
i]->lengthY;
265 if (
name ==
"RPC07") {
268 vcutdef[
i]->dy = this->
length - vcutdef[
i]->lengthY;
273 vcutdef[
i]->dy = this->
length - vcutdef[
i]->lengthY;
281 if (ijob == 29 &&
name ==
"RPC07")
282 vcutdef[
i]->dy = this->
length - vcutdef[
i]->lengthY;
283 if (ijob == 21 &&
name ==
"RPC08")
286 if (ijob == 29 &&
name ==
"RPC07")
288 if (ijob == 21 &&
name ==
"RPC08")
289 vcutdef[
i]->dy = this->
length - vcutdef[
i]->lengthY - vcutdef[
i]->dy;
293 puppergg = ru->build(matManager, mysql, cutoutson, vcutdef);
295 puppergg = ru->build(matManager, mysql);
298 newpos += rpcLayerThickness / 2.;
299 GeoTransform *tugg =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
304 prpc->add(
new GeoIdentifierTag(2));
307 GeoTransform *rugg =
new GeoTransform(GeoTrf::RotateY3D(180 *
Gaudi::Units::deg));
315 newpos += rpcLayerThickness / 2.;
317 GeoVPhysVol *pthirdgg;
318 if (cutoutson && !vcutdef.empty()) {
319 pthirdgg = rthird.
build(matManager, mysql, cutoutson, vcutdef);
321 pthirdgg = rthird.
build(matManager, mysql);
324 newpos += rpcLayerThickness / 2.;
325 GeoTransform *tthirdgg =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
329 prpc->add(
new GeoIdentifierTag(3));
340 log << MSG::INFO <<
"Rpc " <<
name.c_str() <<
" :" <<
endmsg;