ATLAS Offline Software
CscMultilayer.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/GeoIdentifierTag.h"
11 #include "GeoModelKernel/GeoNameTag.h"
12 #include "GeoModelKernel/GeoPhysVol.h"
13 #include "GeoModelKernel/GeoShapeShift.h"
14 #include "GeoModelKernel/GeoShapeUnion.h"
15 #include "GeoModelKernel/GeoTransform.h"
16 #include "GeoModelKernel/GeoTrd.h"
19 #include "MuonGeoModel/MYSQL.h"
20 
21 #include <GaudiKernel/IMessageSvc.h>
22 #include <GaudiKernel/MsgStream.h>
23 #include <GeoModelKernel/GeoLogVol.h>
24 #include <GeoModelKernel/GeoShape.h>
25 #include <cmath>
26 #include <cstddef>
27 #include <string>
28 #include <utility>
29 #include <vector>
30 
31 class GeoMaterial;
32 class GeoVPhysVol;
33 namespace MuonGM {
34  class Cutout;
35 }
36 
37 namespace MuonGM {
38 
39  CscMultiLayer::CscMultiLayer(const MYSQL& mysql, const std::string& n) : DetectorElement(n) {
40  const CSC *md = dynamic_cast<const CSC*>(mysql.GetTechnology(name));
41  nrOfLayers = md->numOfLayers;
44  }
45 
46  GeoVPhysVol *CscMultiLayer::build(StoredMaterialManager& matManager,
47  const MYSQL& mysql) {
48  std::vector<Cutout *> vcutdef;
49  int cutoutson = 0;
50  return build(matManager, mysql, cutoutson, vcutdef);
51  }
52 
53  GeoVPhysVol *CscMultiLayer::build(StoredMaterialManager& matManager,
54  const MYSQL& mysql,
55  int /*cutoutson*/,
56  const std::vector<Cutout *>& /*vcutdef*/) {
57  const CSC *md = dynamic_cast<const CSC*>(mysql.GetTechnology(name));
58 
59  // define the chamber volumes --- for CSS and CSL
60 
61  //-------------internal CSC layer structure-------------4 layers ------
62 
63  // The dimensions of the panel
64  double hon_thick = md->honeycombthick;
65  double gasThickness = 2.0 * md->anocathodist;
66  double newpos = cscthickness / 2.;
67  double g10thi = (2. * md->g10thick + md->honeycombthick);
68 
69  // define the volumes
70  // g10, honeycomb, and the gas
71  // gas mixture: 80% Ar + 20% CO2:
72  // at 1 atmosphere, 20 deg. Celcius:
73  // density Ar = 1.699 g cm-3
74  // density CO2 = 1.902 g cm-3
75  // density of mixture = 0.8 d1 + 0.2 d2 = 1.740 gcm-3
76 
77  // Create CSC layer envelope made of air
78  const GeoShape *sml = new GeoTrd(thickness / 2., thickness / 2., width / 2., longWidth / 2., maxwLength / 2.);
79  if (excent != length) {
80  const GeoShape *smlt = new GeoTrd(thickness / 2., thickness / 2., longWidth / 2., upWidth / 2., (physicalLength - maxwLength) / 2.);
81  sml = &((sml->add((*smlt) << GeoTrf::TranslateZ3D(physicalLength / 2.))) << GeoTrf::TranslateZ3D((maxwLength - physicalLength) / 2.));
82  }
83 
84  const GeoMaterial *mhon = matManager.getMaterial("muo::Honeycomb");
85  const GeoLogVol *lml = new GeoLogVol("CscMultilayer", sml, mhon);
86  GeoPhysVol *pml = new GeoPhysVol(lml);
87 
88  // Create G10 and honeycomb volumes
89  const GeoShape *shon = new GeoTrd(hon_thick / 2., hon_thick / 2., width / 2., longWidth / 2., maxwLength / 2.);
90  const GeoShape *sg10hon = new GeoTrd(g10thi / 2., g10thi / 2., width / 2., longWidth / 2., maxwLength / 2.);
91  if (excent != length) {
92  const GeoShape *shont = new GeoTrd(hon_thick / 2., hon_thick / 2., longWidth / 2., upWidth / 2., (physicalLength - maxwLength) / 2.);
93  shon = &((shon->add((*shont) << GeoTrf::TranslateZ3D(physicalLength / 2.))) << GeoTrf::TranslateZ3D((maxwLength - physicalLength) / 2.));
94  const GeoShape *sg10hont = new GeoTrd(g10thi / 2., g10thi / 2., longWidth / 2., upWidth / 2., (physicalLength - maxwLength) / 2.);
95  sg10hon = &((sg10hon->add((*sg10hont) << GeoTrf::TranslateZ3D(physicalLength / 2.))) << GeoTrf::TranslateZ3D((maxwLength - physicalLength) / 2.));
96  }
97 
98  const GeoLogVol *lhon = new GeoLogVol("Honeycomb", shon, mhon);
99  GeoPhysVol *phon = new GeoPhysVol(lhon);
100 
101  const GeoMaterial *mg10 = matManager.getMaterial("std::G10");
102  const GeoLogVol *lg10hon = new GeoLogVol("G10", sg10hon, mg10);
103  GeoPhysVol *pg10hon = new GeoPhysVol(lg10hon);
104  // Put honeycomb inside G10
105  pg10hon->add(phon);
106 
107  // Create gas volume
108  const GeoShape *sgas = nullptr;
109  double beta = atan((longWidth - width) / (2. * maxwLength));
110  double gShortWidth = width - 2 * md->fullwirefixbarwidth * (1 - sin(beta)) / cos(beta);
111  double gLongWidth = longWidth - 2 * md->fullwirefixbarwidth * (1 + sin(beta)) / cos(beta);
112  if (excent == length) {
113  double gLength = maxwLength - 2 * md->fullwirefixbarwidth;
114  sgas = new GeoTrd(gasThickness / 2., gasThickness / 2., gShortWidth / 2., gLongWidth / 2., gLength / 2.);
115  } else {
116  double alpha = atan((excent - maxwLength) / (longWidth / 2.));
117  double gmaxwLength = maxwLength - md->fullwirefixbarwidth;
118  double gLength = length - 2. * md->fullwirefixbarwidth;
119  double gupWidth = upWidth - 2 * md->fullwirefixbarwidth * (1 - cos(alpha)) / sin(alpha);
120 
121  sgas = new GeoTrd(gasThickness / 2., gasThickness / 2., gShortWidth / 2., gLongWidth / 2., gmaxwLength / 2.);
122  const GeoShape *sgast = new GeoTrd(gasThickness / 2., gasThickness / 2., gLongWidth / 2., gupWidth / 2., (gLength - gmaxwLength) / 2.);
123  sgas = &((sgas->add((*sgast) << GeoTrf::TranslateZ3D(gLength / 2.))) << GeoTrf::TranslateZ3D((gmaxwLength - gLength) / 2.));
124  }
125  const GeoMaterial *mgas = matManager.getMaterial("muo::CscArCO2");
126  const GeoLogVol *lgas = nullptr;
127 
128  // Place G10/honeycomb and gas volumes in CSC envelop, starting at top
129  // G10 - gas - G10 - gas - G10 - gas - G10 - gas - G10
130  for (int i = 0; i < nrOfLayers + 1; i++) {
131  GeoNameTag *np = new GeoNameTag("panel");
132  GeoTransform *xp = new GeoTransform(GeoTrf::TranslateX3D(newpos - g10thi / 2.));
133  pml->add(new GeoIdentifierTag(i));
134  pml->add(np);
135  pml->add(xp);
136  pml->add(pg10hon);
137  newpos -= g10thi;
138 
139  if (i < nrOfLayers) {
140  lgas = new GeoLogVol("CscArCO2", sgas, mgas);
141  GeoPhysVol *pgas = new GeoPhysVol(lgas);
142  // the gas Gap
143  // correct the position within the chamber
144  GeoNameTag *ng = new GeoNameTag("CscArCO2");
145  GeoTransform *xg = new GeoTransform(GeoTrf::TranslateX3D(newpos - gasThickness / 2.));
146  pml->add(new GeoIdentifierTag(i));
147  pml->add(ng);
148  pml->add(xg);
149  pml->add(pgas);
150  newpos -= gasThickness;
151  }
152  }
153 
154  return pml;
155  }
156 
157  void CscMultiLayer::print() const {
158  MsgStream log(Athena::getMessageSvc(), "MuonGM::CscMultiLayer");
159  log << MSG::INFO << "CscMulti Layer:: CscMulti Layer " << name << " :" << endmsg;
160  }
161 
162 } // namespace MuonGM
MuonGM::CscMultiLayer::length
double length
Definition: CscMultiLayer.h:29
MuonGM::MYSQL::GetTechnology
Technology * GetTechnology(const std::string &name)
Definition: MYSQL.cxx:105
DetectorElement.h
MuonGM::CscMultiLayer::cscthickness
double cscthickness
Definition: CscMultiLayer.h:34
MuonGM::DetectorElement::name
std::string name
Definition: DetectorElement.h:17
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
CscMultiLayer.h
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MuonGM::CscMultiLayer::maxwLength
double maxwLength
Definition: CscMultiLayer.h:31
MuonGM::CSC::fullwirefixbarwidth
double fullwirefixbarwidth
Definition: CSC_Technology.h:32
MuonGM::MYSQL
Definition: MYSQL.h:43
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
PlotPulseshapeFromCool.np
np
Definition: PlotPulseshapeFromCool.py:64
MuonGM::DetectorElement
Definition: DetectorElement.h:15
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
MuonGM::CSC
Definition: CSC_Technology.h:13
MuonGM::CSC::anocathodist
double anocathodist
Definition: CSC_Technology.h:23
MuonGM::CscMultiLayer::excent
double excent
Definition: CscMultiLayer.h:28
MuonGM::CSC::g10thick
double g10thick
Definition: CSC_Technology.h:21
MuonGM::CscMultiLayer::upWidth
double upWidth
Definition: CscMultiLayer.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonGM::CscMultiLayer::width
double width
Definition: CscMultiLayer.h:24
MuonGM::CscMultiLayer::physicalLength
double physicalLength
Definition: CscMultiLayer.h:30
MuonGM::CscMultiLayer::build
GeoVPhysVol * build(StoredMaterialManager &matManager, const MYSQL &mysql)
Definition: CscMultilayer.cxx:46
CSC_Technology.h
MuonGM::CSC::totalThickness
double totalThickness
Definition: CSC_Technology.h:18
MYSQL.h
MuonGM::CscMultiLayer::print
virtual void print() const override
Definition: CscMultilayer.cxx:157
StoredMaterialManager.h
MuonGM::CSC::numOfLayers
int numOfLayers
Definition: CSC_Technology.h:16
MuonGM::CSC::honeycombthick
double honeycombthick
Definition: CSC_Technology.h:20
MuonGM::CscMultiLayer::thickness
double thickness
Definition: CscMultiLayer.h:33
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::CscMultiLayer::CscMultiLayer
CscMultiLayer(const MYSQL &mysql, const std::string &n)
Definition: CscMultilayer.cxx:39
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
MuonGM::CscMultiLayer::nrOfLayers
int nrOfLayers
Definition: CscMultiLayer.h:22
ReadFromCoolCompare.ng
ng
Definition: ReadFromCoolCompare.py:234
MuonGM::CscMultiLayer::longWidth
double longWidth
Definition: CscMultiLayer.h:25