ATLAS Offline Software
Ded.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 
23 namespace MuonGM {
24 
26  double tol = 1.e-4;
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 
35  GeoVPhysVol *Ded::build(StoredMaterialManager& matManager,
36  const MYSQL& mysql) {
37  std::vector<Cutout *> vcutdef;
38  int cutoutson = 0;
39  return build(matManager, mysql, cutoutson, vcutdef);
40  }
41 
42  GeoVPhysVol *Ded::build(StoredMaterialManager& matManager,
43  const MYSQL& mysql,
44  int cutoutson,
45  const std::vector<Cutout *>& vcutdef) {
46  const DED *r = dynamic_cast<const DED*>(mysql.GetTechnology(name));
47 
48  double tckaluminum = r->AlThickness;
49  double honthickness = r->HoneyCombThickness;
50  const GeoShape *sded = new GeoTrd(thickness / 2, thickness / 2, width / 2, longWidth / 2, length / 2);
51  const GeoShape *shon = new GeoTrd(honthickness / 2, honthickness / 2, width / 2. - tckaluminum, longWidth / 2. - tckaluminum, length / 2. - tckaluminum);
52 
53  const GeoMaterial *mded = matManager.getMaterial("std::Aluminium");
54  GeoLogVol *lded = new GeoLogVol("DedModuleSkin", sded, mded);
55  GeoPhysVol *pded = new GeoPhysVol(lded);
56 
57  // Place honeycomb inside aluminum to make aluminum skin
58  const GeoMaterial *mhon = matManager.getMaterial("muo::RpcPapHonC");
59  GeoLogVol *lhon = new GeoLogVol("DedModulehoneycomb", shon, mhon);
60  GeoPhysVol *phon = new GeoPhysVol(lhon);
61  if (!skip_ded)
62  pded->add(phon);
63 
64  // Apply cutouts
65  if (cutoutson && !vcutdef.empty()) {
66  GeoPhysVol *tempPhys = nullptr;
67  Cutout *cut = nullptr;
68  GeoShape *cutoutShape = nullptr;
69  GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
70  for (unsigned i = 0; i < vcutdef.size(); i++) {
71  cut = vcutdef[i];
72  cutoutShape = new GeoTrd(thickness / 2. + 1., thickness / 2. + 1., cut->widthXs / 2., cut->widthXl / 2., cut->lengthY / 2.);
73  cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -length / 2 + cut->dy + cut->lengthY / 2.);
74 
75  GeoIntrusivePtr<GeoVPhysVol> toCut{pded};
76  GeoCutVolAction cutAction(*cutoutShape, cutTrans);
77  toCut->apply(&cutAction);
78  tempPhys = cutAction.getPV();
79  pded = tempPhys;
80  }
81  }
82 
83  return pded;
84  }
85 
86  void Ded::print() const {
87  MsgStream log(Athena::getMessageSvc(), "MuonGM::Ded");
88  log << MSG::INFO << "Ded " << name.c_str() << " :" << endmsg;
89  }
90 
91 } // namespace MuonGM
beamspotman.r
def r
Definition: beamspotman.py:676
MuonGM::MYSQL::GetTechnology
Technology * GetTechnology(const std::string &name)
Definition: MYSQL.cxx:105
MuonGM::DetectorElement::name
std::string name
Definition: DetectorElement.h:17
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
skip_ded
#define skip_ded
Definition: Ded.cxx:21
MuonGM::Ded::longWidth
double longWidth
Definition: Ded.h:24
MuonGM::Ded::thickness
double thickness
Definition: Ded.h:23
MuonGM::MYSQL
Definition: MYSQL.h:43
MuonGM::DetectorElement
Definition: DetectorElement.h:15
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonGM::StandardComponent
Definition: StandardComponent.h:15
Ded.h
MuonGM::Component
Definition: Component.h:11
MuonGM::Ded::m_component
DedComponent * m_component
Definition: Ded.h:36
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonGM::Ded::Ded
Ded(const MYSQL &mysql, Component *s)
Definition: Ded.cxx:25
Cutout.h
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
MYSQL.h
MuonGM::Ded::build
GeoVPhysVol * build(StoredMaterialManager &matManager, const MYSQL &mysql)
Definition: Ded.cxx:35
MuonGM::DED
Definition: DED_Technology.h:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonGM::Ded::print
virtual void print() const override
Definition: Ded.cxx:86
DED_Technology.h
MuonGM::Ded::width
double width
Definition: Ded.h:21
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
MuonGM::Cutout
Definition: Cutout.h:14
MuonGM::Ded::length
double length
Definition: Ded.h:22