ATLAS Offline Software
Loading...
Searching...
No Matches
Ded.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "MuonGeoModel/Ded.h"
6
7#include "GeoModelKernel/GeoCutVolAction.h"
8#include "GeoModelKernel/GeoDefinitions.h"
9#include "GeoModelKernel/GeoLogVol.h"
10#include "GeoModelKernel/GeoMaterial.h"
11#include "GeoModelKernel/GeoPhysVol.h"
12#include "GeoModelKernel/GeoShapeIntersection.h"
13#include "GeoModelKernel/GeoShapeSubtraction.h"
14#include "GeoModelKernel/GeoTrd.h"
15#include "GeoModelKernel/GeoVPhysVol.h"
16#include "MuonGeoModel/Cutout.h"
18#include "MuonGeoModel/MYSQL.h"
20
21#define skip_ded false
22
23namespace MuonGM {
24
25 Ded::Ded(const MYSQL& mysql, Component *ss) : DetectorElement(ss->name) {
26 double tol = 1.e-4;
27 DedComponent *s = static_cast<DedComponent *>(ss);
28 width = s->dx1;
29 longWidth = s->dx2;
30 thickness = s->GetThickness(mysql) - tol;
31 length = s->dy - tol;
32 m_component = s;
33 }
34
36 const MYSQL& mysql) {
37 std::vector<Cutout *> vcutdef;
38 int cutoutson = 0;
39 return build(matManager, mysql, cutoutson, vcutdef);
40 }
41
42 PVLink Ded::build(StoredMaterialManager& matManager, const MYSQL& mysql,
43 int cutoutson, const std::vector<Cutout *>& vcutdef) {
44 const DED *r = dynamic_cast<const DED*>(mysql.GetTechnology(name));
45
46 double tckaluminum = r->AlThickness;
47 double honthickness = r->HoneyCombThickness;
48 const GeoShape *sded = new GeoTrd(thickness / 2, thickness / 2, width / 2, longWidth / 2, length / 2);
49 const GeoShape *shon = new GeoTrd(honthickness / 2, honthickness / 2, width / 2. - tckaluminum, longWidth / 2. - tckaluminum, length / 2. - tckaluminum);
50
51 const GeoMaterial *mded = matManager.getMaterial("std::Aluminium");
52 GeoLogVol *lded = new GeoLogVol("DedModuleSkin", sded, mded);
53 PVLink pded = new GeoPhysVol(lded);
54
55 // Place honeycomb inside aluminum to make aluminum skin
56 const GeoMaterial *mhon = matManager.getMaterial("muo::RpcPapHonC");
57 GeoLogVol *lhon = new GeoLogVol("DedModulehoneycomb", shon, mhon);
58 PVLink phon = new GeoPhysVol(lhon);
59 if (!skip_ded)
60 pded->add(phon);
61
62 // Apply cutouts
63 if (cutoutson && !vcutdef.empty()) {
64 GeoIntrusivePtr<GeoPhysVol> tempPhys{};
65 Cutout *cut = nullptr;
66 GeoShape *cutoutShape = nullptr;
67 GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
68 for (unsigned i = 0; i < vcutdef.size(); i++) {
69 cut = vcutdef[i];
70 cutoutShape = new GeoTrd(thickness / 2. + 1., thickness / 2. + 1., cut->widthXs / 2., cut->widthXl / 2., cut->lengthY / 2.);
71 cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -length / 2 + cut->dy + cut->lengthY / 2.);
72
73 GeoIntrusivePtr<GeoVPhysVol> toCut{pded};
74 GeoCutVolAction cutAction(*cutoutShape, cutTrans);
75 toCut->apply(&cutAction);
76 tempPhys = cutAction.getPV();
77 pded = tempPhys;
78 }
79 }
80
81 return pded;
82 }
83
84 void Ded::print() const {
85 MsgStream log(Athena::getMessageSvc(), "MuonGM::Ded");
86 log << MSG::INFO << "Ded " << name.c_str() << " :" << endmsg;
87 }
88
89} // namespace MuonGM
#define endmsg
#define skip_ded
Definition Ded.cxx:21
virtual void print() const override
Definition Ded.cxx:84
PVLink build(StoredMaterialManager &matManager, const MYSQL &mysql)
Definition Ded.cxx:35
double thickness
Definition Ded.h:23
double longWidth
Definition Ded.h:24
DedComponent * m_component
Definition Ded.h:34
double length
Definition Ded.h:22
double width
Definition Ded.h:21
Ded(const MYSQL &mysql, Component *s)
Definition Ded.cxx:25
DetectorElement(const std::string &n)
Technology * GetTechnology(const std::string &name)
Definition MYSQL.cxx:105
This class holds one or more material managers and makes them storeable, under StoreGate.
virtual const GeoMaterial * getMaterial(const std::string &name)=0
singleton-like access to IMessageSvc via open function and helper
int r
Definition globals.cxx:22
IMessageSvc * getMessageSvc(bool quiet=false)
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27
StandardComponent DedComponent