ATLAS Offline Software
Loading...
Searching...
No Matches
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
25namespace 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)));
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
#define endmsg
DetectorElement(const std::string &n)
virtual void print() const override
Definition DriftTube.cxx:74
std::string gasMaterial
Definition DriftTube.h:19
GeoVPhysVol * build(StoredMaterialManager &matManager)
Definition DriftTube.cxx:41
std::string plugMaterial
Definition DriftTube.h:21
DriftTube(const MYSQL &mysql, const std::string &s)
Definition DriftTube.cxx:27
std::string wireMaterial
Definition DriftTube.h:22
std::string tubeMaterial
Definition DriftTube.h:20
double tubeEndPlugLength
double tubeWallThickness
double innerRadius
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