ATLAS Offline Software
MMSpacer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 #include "GeoModelKernel/GeoDefinitions.h"
10 #include "GeoModelKernel/GeoLogVol.h"
11 #include "GeoModelKernel/GeoPhysVol.h"
12 #include "GeoModelKernel/GeoShapeShift.h"
13 #include "GeoModelKernel/GeoShapeSubtraction.h"
14 #include "GeoModelKernel/GeoTrd.h"
15 #include "MuonGeoModel/Component.h"
19 #include "MuonGeoModel/MYSQL.h"
20 
21 #include <GaudiKernel/IMessageSvc.h>
22 #include <GaudiKernel/MsgStream.h>
23 #include <GeoModelKernel/GeoShape.h>
24 #include <string>
25 
26 class GeoMaterial;
27 
28 namespace MuonGM {
29 
31  MMSpacerComponent *s = dynamic_cast<MMSpacerComponent*>(ss);
32  m_component = s;
33  width = s->dx1;
34  longWidth = s->dx2;
35  length = s->dy;
36  name = s->name;
37  thickness = s->GetThickness(mysql);
38  index = s->index;
39  }
40 
41  GeoPhysVol *MMSpacer::build(StoredMaterialManager& matManager,
42  const MYSQL& mysql,
43  int minimalgeo) {
44  std::vector<Cutout *> vcutdef;
45  int cutoutson = 0;
46  return build(matManager, mysql, minimalgeo, cutoutson, vcutdef);
47  }
48 
49  GeoPhysVol *MMSpacer::build(StoredMaterialManager& matManager,
50  const MYSQL& mysql,
51  int minimalgeo, int,
52  const std::vector<Cutout *>&) {
53 
54  const MMSpacer_Technology *t = dynamic_cast<const MMSpacer_Technology*>(mysql.GetTechnology(name));
55  thickness = t->Thickness();
56 
57  // Build Micromegas mother volume out of G10
58  // std::cout<<"creating spacer "<<thickness<<" "<<width<<" "<<longWidth<<" "<<length<<std::endl;
59  const GeoShape *strd = new GeoTrd(thickness / 2, thickness / 2, width / 2, longWidth / 2, length / 2);
60 
61  if (t->lowZCutOuts) {
62  double dy = t->lowZCutOutWidth;
63  double dz = t->lowZCutOutDZ;
64  const GeoShape *sbox = new GeoTrd(thickness, thickness, dy, dy, dz);
65  GeoTrf::Translate3D cut1(0.0, -width / 2., -length / 2.);
66  GeoTrf::Translate3D cut2(0.0, width / 2., -length / 2.);
67  strd = &(strd->subtract((*sbox) << cut1));
68  strd = &(strd->subtract((*sbox) << cut2));
69  }
70 
71  if (t->highZCutOuts) {
72  double dy = t->highZCutOutWidth;
73  double dz = t->highZCutOutDZ;
74  const GeoShape *sbox = new GeoTrd(thickness, thickness, dy, dy, dz);
75  GeoTrf::Translate3D cut1(0.0, -longWidth / 2., length / 2.);
76  GeoTrf::Translate3D cut2(0.0, longWidth / 2., length / 2.);
77  strd = &(strd->subtract((*sbox) << cut1));
78  strd = &(strd->subtract((*sbox) << cut2));
79  }
80 
81  const GeoMaterial *mtrd = matManager.getMaterial("muo::Honeycomb");
82  GeoLogVol *ltrd = new GeoLogVol(logVolName, strd, mtrd);
83  GeoPhysVol *ptrd = new GeoPhysVol(ltrd);
84 
85  if (minimalgeo == 1)
86  return ptrd;
87 
88  return ptrd;
89  }
90 
91  void MMSpacer::print() const {
92  MsgStream log(Athena::getMessageSvc(), "MuonGM::MMSpacer");
93  log << MSG::INFO << " MMSpacer " << name << " :" << endmsg;
94  }
95 
96 } // namespace MuonGM
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
index
Definition: index.py:1
MuonGM::MMSpacer::print
virtual void print() const override
Definition: MMSpacer.cxx:91
MuonGM::MYSQL
Definition: MYSQL.h:43
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MMSpacer_Technology.h
MuonGM::DetectorElement
Definition: DetectorElement.h:15
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonGM::MMSpacer::thickness
double thickness
Definition: MMSpacer.h:26
MuonGM::MMSpacerComponent
Definition: MMSpacerComponent.h:14
MuonGM::Component
Definition: Component.h:11
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Component.h
MuonGM::MMSpacer::m_component
MMSpacerComponent * m_component
Definition: MMSpacer.h:41
MYSQL.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
StoredMaterialManager.h
MuonGM::MMSpacer::width
double width
Definition: MMSpacer.h:24
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
PlotCalibFromCool.cut1
cut1
Definition: PlotCalibFromCool.py:709
MuonGM::MMSpacer::build
GeoPhysVol * build(StoredMaterialManager &matManager, const MYSQL &mysql, int minimalgeo)
Definition: MMSpacer.cxx:41
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonGM::MMSpacer_Technology
Definition: MMSpacer_Technology.h:15
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
MMSpacer.h
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
MuonGM::DetectorElement::logVolName
std::string logVolName
Definition: DetectorElement.h:18
MuonGM::MMSpacer::longWidth
double longWidth
Definition: MMSpacer.h:27
MuonGM::MMSpacer::MMSpacer
MMSpacer(const MYSQL &mysql, Component *s)
Definition: MMSpacer.cxx:30
Technology.h
MuonGM::MMSpacer::length
double length
Definition: MMSpacer.h:25
MMSpacerComponent.h