ATLAS Offline Software
DriftTube.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 #include "GeoModelKernel/GeoDefinitions.h"
10 #include "GeoModelKernel/GeoLogVol.h"
11 #include "GeoModelKernel/GeoNameTag.h"
12 #include "GeoModelKernel/GeoPhysVol.h"
13 #include "GeoModelKernel/GeoSerialDenominator.h"
14 #include "GeoModelKernel/GeoTransform.h"
15 #include "GeoModelKernel/GeoTube.h"
17 #include "MuonGeoModel/MYSQL.h"
18 
19 #include <GaudiKernel/IMessageSvc.h>
20 #include <GaudiKernel/MsgStream.h>
21 #include <iostream>
22 #include <string>
23 #include <utility>
24 
25 namespace MuonGM {
26 
27  DriftTube::DriftTube(const MYSQL& mysql, const std::string& n)
28  : DetectorElement(n),
29  gasMaterial ("muo::ArCO2"),
30  tubeMaterial ("std::Aluminium"),
31  plugMaterial ("std::Bakelite"),
32  wireMaterial ("std::Aluminium"),
33  length(0.) // length is set in MultiLayer.cxx
34  {
35  const MDT *md = dynamic_cast<const MDT*>(mysql.GetTechnology(name.substr(0, 5)));
36  gasRadius = md->innerRadius;
39  }
40 
41  GeoVPhysVol *DriftTube::build(StoredMaterialManager& matManager) {
42  const GeoTube *stube = new GeoTube(0.0, outerRadius, length / 2.0);
43  const GeoMaterial *mtube = matManager.getMaterial(tubeMaterial);
44  const GeoLogVol *ltube = new GeoLogVol("MDTDriftWall", stube, mtube);
45  GeoPhysVol *ptube = new GeoPhysVol(ltube);
46 
47  const GeoTube *splug = new GeoTube(0.0, outerRadius, plugLength / 2.0);
48  const GeoMaterial *mplug = matManager.getMaterial(plugMaterial);
49  const GeoLogVol *lplug = new GeoLogVol("Endplug", splug, mplug);
50  GeoPhysVol *pplug = new GeoPhysVol(lplug);
51 
52  const GeoTube *sgas = new GeoTube(0, gasRadius, length / 2.0 - plugLength);
53  const GeoMaterial *mgas = matManager.getMaterial(gasMaterial);
54  const GeoLogVol *lgas = new GeoLogVol("SensitiveGas", sgas, mgas);
55  GeoPhysVol *pgas = new GeoPhysVol(lgas);
56 
57  GeoSerialDenominator *plugDenominator = new GeoSerialDenominator("Tube Endplug");
58  GeoTransform *ec0X = new GeoTransform(GeoTrf::TranslateZ3D(+(length - plugLength) / 2));
59  GeoTransform *ec1X = new GeoTransform(GeoTrf::TranslateZ3D(-(length - plugLength) / 2));
60  std::string sGasName = "SensitiveGas";
61  GeoNameTag *gasDenominator = new GeoNameTag(sGasName);
62 
63  ptube->add(plugDenominator);
64  ptube->add(ec0X);
65  ptube->add(pplug);
66  ptube->add(ec1X);
67  ptube->add(pplug);
68  ptube->add(gasDenominator);
69  ptube->add(pgas);
70 
71  return ptube;
72  }
73 
74  void DriftTube::print() const {
75  MsgStream log(Athena::getMessageSvc(), "MuonGM::DriftTube");
76 
77  log << MSG::INFO << "Drift tube " << name.c_str() << " :" << std::endl
78  << " Tube material : " << tubeMaterial.c_str() << std::endl
79  << " Radius : " << outerRadius << std::endl
80  << " Length : " << length << std::endl
81  << " Thickness : " << outerRadius - gasRadius << " mm" << std::endl
82  << " Gas material : " << gasMaterial.c_str() << std::endl
83  << " EP length : " << plugLength << endmsg;
84  }
85 
86 } // 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
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MuonGM::DriftTube::outerRadius
double outerRadius
Definition: DriftTube.h:24
MuonGM::DriftTube::tubeMaterial
std::string tubeMaterial
Definition: DriftTube.h:20
MuonGM::MDT::tubeEndPlugLength
double tubeEndPlugLength
Definition: MDT_Technology.h:22
MuonGM::MYSQL
Definition: MYSQL.h:43
MuonGM::MDT::tubeWallThickness
double tubeWallThickness
Definition: MDT_Technology.h:23
MuonGM::DriftTube::plugMaterial
std::string plugMaterial
Definition: DriftTube.h:21
MuonGM::DetectorElement
Definition: DetectorElement.h:15
MuonGM::DriftTube::build
GeoVPhysVol * build(StoredMaterialManager &matManager)
Definition: DriftTube.cxx:41
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonGM::MDT
Definition: MDT_Technology.h:15
MuonGM::DriftTube::gasMaterial
std::string gasMaterial
Definition: DriftTube.h:19
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonGM::MDT::innerRadius
double innerRadius
Definition: MDT_Technology.h:19
MuonGM::DriftTube::gasRadius
double gasRadius
Definition: DriftTube.h:25
MuonGM::DriftTube::plugLength
double plugLength
Definition: DriftTube.h:26
MYSQL.h
StoredMaterialManager.h
MDT_Technology.h
MuonGM::DriftTube::print
virtual void print() const override
Definition: DriftTube.cxx:74
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::DriftTube::DriftTube
DriftTube(const MYSQL &mysql, const std::string &s)
Definition: DriftTube.cxx:27
MuonGM::DriftTube::length
double length
Definition: DriftTube.h:23
DriftTube.h
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26