Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  PVLink 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  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
beamspotman.r
def r
Definition: beamspotman.py:676
MuonGM::MYSQL::GetTechnology
Technology * GetTechnology(const std::string &name)
Definition: MYSQL.cxx:105
MuonGM::Ded::build
PVLink build(StoredMaterialManager &matManager, const MYSQL &mysql)
Definition: Ded.cxx:35
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:34
lumiFormat.i
int i
Definition: lumiFormat.py:85
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
Definition: DED_Technology.h:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonGM::Ded::print
virtual void print() const override
Definition: Ded.cxx:84
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