69 int minimalgeo,
int cutoutson,
70 const std::vector<Cutout *>& vcutdef) {
82 double extSupThick =
r->externalSupPanelThickness;
83 double extAlSupThick =
r->externalAlSupPanelThickness;
84 double rpcLayerThickness =
r->rpcLayerThickness;
85 double centSupThick =
r->centralSupPanelThickness;
86 double centAlSupThick =
r->centralAlSupPanelThickness;
92 rpcLayerThickness = rpc3GapLayerThickness;
96 log << MSG::VERBOSE <<
" RPC build: " <<
name <<
" has thickness = " <<
thickness <<
" long width = " <<
longWidth <<
" width = " <<
width <<
" length = " <<
length
103 if (cutoutson && !vcutdef.empty()) {
105 GeoShape *cutoutShape =
nullptr;
106 GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
107 for (
unsigned i = 0; i < vcutdef.size(); i++) {
109 cutoutShape =
new GeoTrd(
thickness / 2. + 1.,
thickness / 2. + 1., cut->widthXs / 2., cut->widthXl / 2., cut->lengthY / 2.);
110 cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -
length / 2 + cut->dy + cut->lengthY / 2.);
111 srpc = &(srpc->subtract((*cutoutShape) << cutTrans));
115 const GeoMaterial *mrpc = matManager.
getMaterial(
"std::Air");
116 GeoLogVol *lrpc =
new GeoLogVol(
logVolName, srpc, mrpc);
117 GeoIntrusivePtr<GeoFullPhysVol> prpc =
new GeoFullPhysVol(lrpc);
122 if (geometry_version.compare(0, 1,
"M") != 0) {
135 GeoTrd *slpan =
new GeoTrd(extSupThick / 2, extSupThick / 2,
width / 2,
longWidth / 2,
length / 2);
137 new GeoTrd(extSupThick / 2 - extAlSupThick, extSupThick / 2 - extAlSupThick,
width / 2 - extAlSupThick,
longWidth / 2 - extAlSupThick,
length / 2 - extAlSupThick);
138 const GeoShape *sallpan = slpan;
139 const GeoShape *sholpan2 = sholpan;
140 const GeoMaterial *mallpan = matManager.
getMaterial(
"std::Aluminium");
141 GeoLogVol *lallpan =
new GeoLogVol(
"RPC_AL_extsuppanel", sallpan, mallpan);
142 PVLink pallpan =
new GeoPhysVol(lallpan);
143 const GeoMaterial *mholpan = matManager.
getMaterial(
"muo::RpcAlHonC");
144 GeoLogVol *lholpan =
new GeoLogVol(
"RPC_honeyc_extsuppanel", sholpan2, mholpan);
145 PVLink pholpan =
new GeoPhysVol(lholpan);
146 pallpan->add(pholpan);
149 if (cutoutson && !vcutdef.empty()) {
151 GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
152 for (
unsigned i = 0; i < vcutdef.size(); i++) {
155 cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -
length / 2 + cut->dy + cut->lengthY / 2.);
157 GeoCutVolAction cutAction(*cutoutShape, cutTrans);
158 pallpan->apply(&cutAction);
159 pallpan = cutAction.getPV();
164 newpos += extSupThick / 2.;
165 GeoTransform *tlpan =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
167 log << MSG::VERBOSE <<
" Rpc:: put ext.sup panel at " << newpos <<
" from centre" <<
endmsg;
175 newpos += extSupThick / 2.;
179 std::unique_ptr<RpcLayer> rl = std::make_unique<RpcLayer>(
name,
this);
181 if (cutoutson && !vcutdef.empty()) {
182 plowergg = rl->build(matManager, mysql, cutoutson, vcutdef);
184 plowergg = rl->build(matManager, mysql);
187 newpos += rpcLayerThickness / 2.;
188 GeoTransform *tlgg =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
190 log << MSG::VERBOSE <<
" Rpc:: put lower RPC layer at " << newpos <<
" from centre " <<
endmsg;
193 prpc->add(
new GeoIdentifierTag(1));
199 newpos += rpcLayerThickness / 2.;
200 GeoTrd *scpan =
new GeoTrd(centSupThick / 2, centSupThick / 2,
width / 2,
longWidth / 2,
length / 2);
201 GeoTrd *shocpan =
new GeoTrd(centSupThick / 2 - centAlSupThick, centSupThick / 2 - centAlSupThick,
width / 2 - centAlSupThick,
longWidth / 2 - centAlSupThick,
202 length / 2 - centAlSupThick);
204 const GeoShape *salcpan = scpan;
205 const GeoShape *shocpan2 = shocpan;
206 GeoLogVol *lalcpan =
new GeoLogVol(
"RPC_AL_midsuppanel", salcpan, mallpan);
207 PVLink palcpan =
new GeoPhysVol(lalcpan);
208 const GeoMaterial *mhocpan = matManager.
getMaterial(
"muo::RpcPapHonC");
209 GeoLogVol *lhocpan =
new GeoLogVol(
"RPC_honeyc_midsuppanel", shocpan2, mhocpan);
210 PVLink phocpan =
new GeoPhysVol(lhocpan);
211 palcpan->add(phocpan);
214 if (cutoutson && !vcutdef.empty()) {
216 GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
217 for (
unsigned i = 0; i < vcutdef.size(); i++) {
220 cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -
length / 2 + cut->dy + cut->lengthY / 2.);
222 GeoCutVolAction cutAction(*cutoutShape, cutTrans);
223 palcpan->apply(&cutAction);
224 palcpan = cutAction.getPV();
229 newpos += centSupThick / 2.;
230 GeoTransform *tcpan =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
232 log << MSG::VERBOSE <<
" Rpc:: put central sup panel at " << newpos <<
" from centre" <<
endmsg;
238 newpos += centSupThick / 2.;
242 std::unique_ptr<RpcLayer> ru = std::make_unique<RpcLayer>(
name,
this);
244 if (cutoutson && !vcutdef.empty()) {
249 for (
unsigned int i = 0; i < vcutdef.size(); i++) {
250 subtype = vcutdef[i]->subtype;
251 ijob = vcutdef[i]->ijob;
254 if (
name ==
"RPC06" && ijob == 3) {
257 }
else if (subtype == 13) {
258 vcutdef[i]->dy = this->
length - vcutdef[i]->lengthY;
263 if (
name ==
"RPC07") {
266 vcutdef[i]->dy = this->
length - vcutdef[i]->lengthY;
269 }
else if (subtype == 9) {
271 vcutdef[i]->dy = this->
length - vcutdef[i]->lengthY;
279 if (ijob == 29 &&
name ==
"RPC07")
280 vcutdef[i]->dy = this->
length - vcutdef[i]->lengthY;
281 if (ijob == 21 &&
name ==
"RPC08")
283 }
else if (subtype == 11) {
284 if (ijob == 29 &&
name ==
"RPC07")
286 if (ijob == 21 &&
name ==
"RPC08")
287 vcutdef[i]->dy = this->
length - vcutdef[i]->lengthY - vcutdef[i]->dy;
291 puppergg = ru->build(matManager, mysql, cutoutson, vcutdef);
293 puppergg = ru->build(matManager, mysql);
296 newpos += rpcLayerThickness / 2.;
297 GeoTransform *tugg =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
299 log << MSG::VERBOSE <<
" Rpc:: put upper RPC layer at " << newpos <<
" from centre " <<
endmsg;
302 prpc->add(
new GeoIdentifierTag(2));
305 GeoTransform *rugg =
new GeoTransform(GeoTrf::RotateY3D(180 * Gaudi::Units::deg));
313 newpos += rpcLayerThickness / 2.;
316 if (cutoutson && !vcutdef.empty()) {
317 pthirdgg = rthird.
build(matManager, mysql, cutoutson, vcutdef);
319 pthirdgg = rthird.
build(matManager, mysql);
322 newpos += rpcLayerThickness / 2.;
323 GeoTransform *tthirdgg =
new GeoTransform(GeoTrf::TranslateX3D(newpos));
325 log << MSG::VERBOSE <<
" Rpc:: put upper RPC layer at " << newpos <<
" from centre " <<
endmsg;
327 prpc->add(
new GeoIdentifierTag(3));