ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonDetDescr
MuonGeoModel
src
SpacerBeam.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonGeoModel/SpacerBeam.h
"
6
7
#include "
AthenaKernel/getMessageSvc.h
"
8
#include "GeoModelKernel/GeoBox.h"
9
#include "GeoModelKernel/GeoDefinitions.h"
10
#include "GeoModelKernel/GeoLogVol.h"
11
#include "GeoModelKernel/GeoMaterial.h"
12
#include "GeoModelKernel/GeoPhysVol.h"
13
#include "GeoModelKernel/GeoShapeShift.h"
14
#include "GeoModelKernel/GeoShapeSubtraction.h"
15
#include "GeoModelKernel/GeoVPhysVol.h"
16
#include "
MuonGeoModel/CHV_Technology.h
"
17
#include "
MuonGeoModel/CMI_Technology.h
"
18
#include "
MuonGeoModel/CRO_Technology.h
"
19
#include "
MuonGeoModel/CbmComponent.h
"
20
#include "
MuonGeoModel/LBI_Technology.h
"
21
#include "
MuonGeoModel/LbiComponent.h
"
22
#include "
MuonGeoModel/MYSQL.h
"
23
#include "
MuonGeoModel/StandardComponent.h
"
24
#include "
MuonGeoModel/Technology.h
"
25
26
namespace
MuonGM
{
27
28
SpacerBeam::SpacerBeam
(
const
MYSQL
& mysql,
29
Component
*
ss
) :
DetectorElement
(
ss
->
name
) {
30
StandardComponent
*s =
static_cast<
StandardComponent
*
>
(
ss
);
31
std::string_view componentType = std::string_view(s->name).substr(0, 3);
32
33
double
tol = 1.e-4;
34
35
width
= s->dx1;
36
longWidth
= s->dx2;
37
length
= s->dy - tol;
38
excent
= s->excent;
39
40
m_cy
= s->posy;
41
if
(componentType ==
"CRO"
|| componentType ==
"CMI"
|| componentType ==
"CHV"
) {
42
CbmComponent
*ccbm =
static_cast<
CbmComponent
*
>
(s);
43
m_hole_pos1
= ccbm->
hole_pos1
-
length
/ 2. -
m_cy
- tol / 2.;
44
m_hole_pos2
= ccbm->
hole_pos2
-
length
/ 2. -
m_cy
- tol / 2.;
45
m_lb_height
= ccbm->
lb_height
;
46
m_lb_width
= ccbm->
lb_width
;
47
}
48
49
lowerThickness
= 0.;
50
51
if
(componentType ==
"CHV"
) {
52
const
CHV
*ch =
static_cast<
const
CHV
*
>
(mysql.
GetTechnology
(s->name));
53
thickness
= ch->thickness;
54
largeness
= ch->largeness;
55
height
= ch->height - tol;
56
57
}
else
if
(componentType ==
"CRO"
) {
58
const
CRO
*cr =
static_cast<
const
CRO
*
>
(mysql.
GetTechnology
(s->name));
59
thickness
= cr->
thickness
;
60
largeness
= cr->
largeness
;
61
height
= cr->
height
- tol;
62
63
}
else
if
(componentType ==
"CMI"
) {
64
const
CMI
*cn =
static_cast<
const
CMI
*
>
(mysql.
GetTechnology
(s->name));
65
thickness
= cn->
thickness
;
66
largeness
= cn->
largeness
;
67
height
= cn->
height
- tol;
68
69
}
else
if
(componentType.substr(0, 2) ==
"LB"
) {
70
const
LBI
*
lb
=
static_cast<
const
LBI
*
>
(mysql.
GetTechnology
(s->name));
71
thickness
=
lb
->thickness;
72
lowerThickness
=
lb
->lowerThickness;
73
largeness
=
thickness
;
74
height
=
lb
->height;
75
m_cross_excent
= 0;
// Place holder
76
}
77
}
78
79
GeoVPhysVol *
SpacerBeam::build
(
StoredMaterialManager
& matManager,
80
bool
is_barrel) {
81
int
cutoutson = 0;
82
return
build
(matManager, cutoutson, is_barrel);
83
}
84
85
GeoVPhysVol *
SpacerBeam::build
(
StoredMaterialManager
& matManager,
86
int
/*cutoutson*/
,
bool
is_barrel) {
87
GeoPhysVol *pvol =
nullptr
;
88
GeoLogVol *lvol =
nullptr
;
89
const
GeoMaterial *mat = matManager.
getMaterial
(
"std::Aluminium"
);
90
if
(
name
.compare(0, 3,
"CHV"
) == 0 ||
name
.compare(0, 3,
"CRO"
) == 0 ||
name
.compare(0, 3,
"CMI"
) == 0) {
91
double
sinexc = 0.;
92
double
cosexc = 1.;
93
double
volumelargeness =
largeness
;
94
if
((
name
.compare(0, 3,
"CHV"
) == 0 ||
name
.compare(0, 3,
"CRO"
) == 0) && !is_barrel) {
95
double
ltemp = std::sqrt(
length
*
length
+
excent
*
excent
);
96
sinexc = std::abs(
excent
) / ltemp;
97
cosexc =
length
/ ltemp;
98
length
= ltemp -
largeness
* std::abs(
excent
) /
length
;
99
}
100
101
if
(
thickness
> 0.) {
102
// I-beam shape
103
volumelargeness =
largeness
;
104
const
GeoShape *IBeamShape =
new
GeoBox(
height
/ 2, volumelargeness / 2,
length
/ 2);
105
GeoBox *sideBox =
new
GeoBox(
height
/ 2. -
thickness
, volumelargeness / 4.,
length
/ 2 + 1.);
106
double
yshift = volumelargeness / 4. +
thickness
/ 2.;
107
IBeamShape = &(IBeamShape->subtract((*sideBox) << GeoTrf::TranslateY3D(yshift)));
108
IBeamShape = &(IBeamShape->subtract((*sideBox) << GeoTrf::TranslateY3D(-yshift)));
109
110
// Cut holes for LB
111
GeoBox *holeBox =
new
GeoBox(
m_lb_height
/ 2. + 1.,
thickness
/ 2. + 1.,
m_lb_width
/ cosexc / 2. +
thickness
* sinexc / cosexc + 6.);
112
IBeamShape = &(IBeamShape->subtract((*holeBox) << GeoTrf::TranslateZ3D(
m_hole_pos1
/ cosexc)));
113
IBeamShape = &(IBeamShape->subtract((*holeBox) << GeoTrf::TranslateZ3D(
m_hole_pos2
/ cosexc)));
114
lvol =
new
GeoLogVol(
name
, IBeamShape, mat);
115
pvol =
new
GeoPhysVol(lvol);
116
117
}
else
{
118
// Box shape
119
120
volumelargeness =
width
;
121
const
GeoBox *Cbox =
new
GeoBox(
height
/ 2, volumelargeness / 2,
length
/ 2);
122
lvol =
new
GeoLogVol(
name
, Cbox, mat);
123
pvol =
new
GeoPhysVol(lvol);
124
}
125
return
pvol;
126
127
}
else
if
(
name
.compare(0, 2,
"LB"
) == 0) {
128
const
GeoShape *LBbox =
new
GeoBox(
height
/ 2., (
width
-
length
/ 4.) / 2.,
length
/ 2.);
129
// (width - length/4) is temporary until excent parameter is put into LbiComponent
130
GeoBox *innerBox =
new
GeoBox(
height
/ 2. -
thickness
,
width
/ 2. + 1.,
length
/ 2. -
lowerThickness
);
131
LBbox = &(LBbox->subtract((*innerBox)));
132
lvol =
new
GeoLogVol(
name
, LBbox, mat);
133
pvol =
new
GeoPhysVol(lvol);
134
return
pvol;
135
136
}
else
{
137
return
nullptr
;
138
}
139
}
140
141
void
SpacerBeam::print
()
const
{
142
MsgStream log(
Athena::getMessageSvc
(),
"MuGM::SpacerBeam"
);
143
log << MSG::INFO <<
" SpacerBeam "
<<
name
<<
" :"
<<
endmsg
;
144
}
145
146
}
// namespace MuonGM
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CHV_Technology.h
CMI_Technology.h
CRO_Technology.h
CbmComponent.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
LBI_Technology.h
LbiComponent.h
MYSQL.h
SpacerBeam.h
StandardComponent.h
Technology.h
MuonGM::CHV
Definition
CHV_Technology.h:13
MuonGM::CMI
Definition
CMI_Technology.h:13
MuonGM::CMI::largeness
double largeness
Definition
CMI_Technology.h:16
MuonGM::CMI::height
double height
Definition
CMI_Technology.h:17
MuonGM::CRO
Definition
CRO_Technology.h:13
MuonGM::CRO::largeness
double largeness
Definition
CRO_Technology.h:16
MuonGM::CRO::height
double height
Definition
CRO_Technology.h:17
MuonGM::CbmComponent
Definition
CbmComponent.h:12
MuonGM::CbmComponent::hole_pos1
double hole_pos1
Definition
CbmComponent.h:17
MuonGM::CbmComponent::lb_height
double lb_height
Definition
CbmComponent.h:15
MuonGM::CbmComponent::lb_width
double lb_width
Definition
CbmComponent.h:16
MuonGM::CbmComponent::hole_pos2
double hole_pos2
Definition
CbmComponent.h:18
MuonGM::Component
Definition
Component.h:11
MuonGM::DetectorElement::name
std::string name
Definition
DetectorElement.h:17
MuonGM::DetectorElement::DetectorElement
DetectorElement(const std::string &n)
Definition
DetectorElement.h:20
MuonGM::LBI
Definition
LBI_Technology.h:13
MuonGM::MYSQL
Definition
MYSQL.h:43
MuonGM::MYSQL::GetTechnology
Technology * GetTechnology(const std::string &name)
Definition
MYSQL.cxx:105
MuonGM::SpacerBeam::largeness
double largeness
Definition
SpacerBeam.h:31
MuonGM::SpacerBeam::lowerThickness
double lowerThickness
Definition
SpacerBeam.h:28
MuonGM::SpacerBeam::m_hole_pos1
double m_hole_pos1
Definition
SpacerBeam.h:37
MuonGM::SpacerBeam::length
double length
Definition
SpacerBeam.h:26
MuonGM::SpacerBeam::width
double width
Definition
SpacerBeam.h:25
MuonGM::SpacerBeam::excent
double excent
Definition
SpacerBeam.h:32
MuonGM::SpacerBeam::print
virtual void print() const override
Definition
SpacerBeam.cxx:141
MuonGM::SpacerBeam::longWidth
double longWidth
Definition
SpacerBeam.h:29
MuonGM::SpacerBeam::m_cy
double m_cy
Definition
SpacerBeam.h:36
MuonGM::SpacerBeam::SpacerBeam
SpacerBeam(const MYSQL &mysql, Component *s)
Definition
SpacerBeam.cxx:28
MuonGM::SpacerBeam::m_cross_excent
double m_cross_excent
Definition
SpacerBeam.h:41
MuonGM::SpacerBeam::thickness
double thickness
Definition
SpacerBeam.h:27
MuonGM::SpacerBeam::height
double height
Definition
SpacerBeam.h:30
MuonGM::SpacerBeam::build
GeoVPhysVol * build(StoredMaterialManager &matManager, bool)
Definition
SpacerBeam.cxx:79
MuonGM::SpacerBeam::m_lb_width
double m_lb_width
Definition
SpacerBeam.h:40
MuonGM::SpacerBeam::m_hole_pos2
double m_hole_pos2
Definition
SpacerBeam.h:38
MuonGM::SpacerBeam::m_lb_height
double m_lb_height
Definition
SpacerBeam.h:39
MuonGM::StandardComponent
Definition
StandardComponent.h:15
MuonGM::Technology::thickness
double thickness
Definition
Technology.h:20
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
lb
int lb
Definition
globals.cxx:23
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition
GeoMuonHits.h:27
Generated on
for ATLAS Offline Software by
1.17.0