ATLAS Offline Software
Loading...
Searching...
No Matches
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"
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
26class GeoMaterial;
27
28namespace 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
#define endmsg
DetectorElement(const std::string &n)
GeoPhysVol * build(StoredMaterialManager &matManager, const MYSQL &mysql, int minimalgeo)
Definition MMSpacer.cxx:41
MMSpacer(const MYSQL &mysql, Component *s)
Definition MMSpacer.cxx:30
double thickness
Definition MMSpacer.h:26
MMSpacerComponent * m_component
Definition MMSpacer.h:41
double longWidth
Definition MMSpacer.h:27
virtual void print() const override
Definition MMSpacer.cxx:91
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
IMessageSvc * getMessageSvc(bool quiet=false)
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27
Definition index.py:1