ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonDetDescr
MuonGeoModel
src
Csc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonGeoModel/Csc.h
"
6
7
#include "
AthenaKernel/getMessageSvc.h
"
8
#include "GaudiKernel/MsgStream.h"
9
#include "
GeoModelInterfaces/StoredMaterialManager.h
"
10
#include "GeoModelKernel/GeoFullPhysVol.h"
11
#include "GeoModelKernel/GeoLogVol.h"
12
#include "GeoModelKernel/GeoShapeShift.h"
13
#include "GeoModelKernel/GeoShapeUnion.h"
14
#include "GeoModelKernel/GeoTrd.h"
15
#include "
MuonGeoModel/Component.h
"
16
#include "
MuonGeoModel/CscComponent.h
"
17
#include "
MuonGeoModel/CscMultiLayer.h
"
18
#include "
MuonGeoModel/DetectorElement.h
"
19
20
#include <GaudiKernel/IMessageSvc.h>
21
#include <GeoModelKernel/GeoDefinitions.h>
22
#include <GeoModelKernel/GeoShape.h>
23
#include <GeoModelKernel/GeoVPhysVol.h>
24
#include <string>
25
#include <utility>
26
27
class
GeoMaterial;
28
29
#define skip_csc false
30
31
namespace
MuonGM
{
32
33
Csc::Csc
(
const
MYSQL
& mysql,
Component
*
ss
) :
DetectorElement
(
ss
->
name
) {
34
CscComponent
*s =
static_cast<
CscComponent
*
>
(
ss
);
35
m_component
= s;
36
width
= s->dx1;
37
longWidth
= s->dx2;
38
thickness
= s->GetThickness(mysql);
39
maxwLength
= s->maxwdy;
40
excent
= s->excent;
41
physicalLength
= s->dy;
42
length
=
physicalLength
;
43
double
num =
longWidth
* (
excent
-
physicalLength
);
44
if
(std::abs(num) < 1e-10) {
45
upWidth
= 0;
46
}
else
{
47
upWidth
= num / (
excent
-
maxwLength
);
48
}
49
50
layer
= std::make_unique<CscMultiLayer>(mysql, s->name);
51
layer
->width =
width
;
52
layer
->longWidth =
longWidth
;
53
layer
->upWidth =
upWidth
;
54
layer
->excent =
excent
;
55
layer
->length =
length
;
56
layer
->physicalLength =
physicalLength
;
57
layer
->maxwLength =
maxwLength
;
58
59
index
= s->index;
60
}
61
62
63
GeoFullPhysVol *
Csc::build
(
StoredMaterialManager
& matManager,
64
const
MYSQL
& mysql,
65
int
minimalgeo) {
66
std::vector<Cutout *> vcutdef;
67
int
cutoutson = 0;
68
return
build
(matManager, mysql, minimalgeo, cutoutson, vcutdef);
69
}
70
71
GeoFullPhysVol *
Csc::build
(
StoredMaterialManager
& matManager,
72
const
MYSQL
& mysql,
73
int
minimalgeo,
int
cutoutson,
74
const
std::vector<Cutout *>& vcutdef) {
75
GeoFullPhysVol *pcsc =
nullptr
;
76
GeoLogVol *lcsc =
nullptr
;
77
const
GeoMaterial *mcsc = matManager.
getMaterial
(
"std::Air"
);
78
79
if
(
excent
==
length
) {
80
// CSC is a simple traezoid
81
const
GeoShape *sCSS =
new
GeoTrd(
thickness
/ 2.,
thickness
/ 2.,
width
/ 2.,
longWidth
/ 2.,
length
/ 2.);
82
lcsc =
new
GeoLogVol(
logVolName
, sCSS, mcsc);
83
84
}
else
{
85
// CSC is a union of two trapezoids
86
GeoTrd *downTrd =
new
GeoTrd(
thickness
/ 2.,
thickness
/ 2.,
width
/ 2.,
longWidth
/ 2.,
maxwLength
/ 2.);
87
GeoTrd *upTrd =
new
GeoTrd(
thickness
/ 2.,
thickness
/ 2.,
longWidth
/ 2.,
upWidth
/ 2., (
physicalLength
-
maxwLength
) / 2.);
88
const
GeoShape *sCSL = &((downTrd->add((*upTrd) << GeoTrf::TranslateZ3D(
physicalLength
/ 2.))) << GeoTrf::TranslateZ3D((
maxwLength
-
physicalLength
) / 2.));
89
lcsc =
new
GeoLogVol(
logVolName
, sCSL, mcsc);
90
}
91
92
pcsc =
new
GeoFullPhysVol(lcsc);
93
if
(minimalgeo == 1)
94
return
pcsc;
95
96
GeoVPhysVol *lay =
layer
->build(matManager, mysql, cutoutson, vcutdef);
97
if
(!
skip_csc
)
98
pcsc->add(lay);
99
100
return
pcsc;
101
}
102
103
void
Csc::print
()
const
{
104
MsgStream log(
Athena::getMessageSvc
(),
"MuonGM::Csc"
);
105
log << MSG::INFO <<
" Csc:: Csc "
<<
name
<<
" : "
<<
endmsg
;
106
}
107
108
}
// namespace MuonGM
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
Component.h
CscComponent.h
CscMultiLayer.h
skip_csc
#define skip_csc
Definition
Csc.cxx:29
Csc.h
DetectorElement.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
StoredMaterialManager.h
MuonGM::Component
Definition
Component.h:11
MuonGM::CscComponent
Definition
CscComponent.h:11
MuonGM::Csc::maxwLength
double maxwLength
Definition
Csc.h:32
MuonGM::Csc::length
double length
Definition
Csc.h:27
MuonGM::Csc::upWidth
double upWidth
Definition
Csc.h:33
MuonGM::Csc::excent
double excent
Definition
Csc.h:30
MuonGM::Csc::print
virtual void print() const override
Definition
Csc.cxx:103
MuonGM::Csc::build
GeoFullPhysVol * build(StoredMaterialManager &matManager, const MYSQL &mysql, int minimalgeo)
Definition
Csc.cxx:63
MuonGM::Csc::thickness
double thickness
Definition
Csc.h:28
MuonGM::Csc::width
double width
Definition
Csc.h:26
MuonGM::Csc::longWidth
double longWidth
Definition
Csc.h:29
MuonGM::Csc::m_component
CscComponent * m_component
Definition
Csc.h:52
MuonGM::Csc::Csc
Csc(const MYSQL &mysql, Component *s)
Definition
Csc.cxx:33
MuonGM::Csc::physicalLength
double physicalLength
Definition
Csc.h:31
MuonGM::Csc::layer
std::unique_ptr< CscMultiLayer > layer
Definition
Csc.h:37
MuonGM::DetectorElement::name
std::string name
Definition
DetectorElement.h:17
MuonGM::DetectorElement::DetectorElement
DetectorElement(const std::string &n)
Definition
DetectorElement.h:20
MuonGM::DetectorElement::logVolName
std::string logVolName
Definition
DetectorElement.h:18
MuonGM::MYSQL
Definition
MYSQL.h:43
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition
StoredMaterialManager.h:30
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(std::string_view name)=0
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition
GeoMuonHits.h:27
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0