ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonDetDescr
MuonGeoModel
src
Micromegas.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/Micromegas.h
"
6
7
#include "
AGDDKernel/AGDDDetectorStore.h
"
8
#include "
AGDDControl/AGDDController.h
"
9
#include "
AthenaKernel/getMessageSvc.h
"
10
#include "
GeoModelInterfaces/StoredMaterialManager.h
"
11
#include "GeoModelKernel/GeoDefinitions.h"
12
#include "GeoModelKernel/GeoFullPhysVol.h"
13
#include "GeoModelKernel/GeoIdentifierTag.h"
14
#include "GeoModelKernel/GeoLogVol.h"
15
#include "GeoModelKernel/GeoNameTag.h"
16
#include "GeoModelKernel/GeoPhysVol.h"
17
#include "GeoModelKernel/GeoSerialIdentifier.h"
18
#include "GeoModelKernel/GeoShapeShift.h"
19
#include "GeoModelKernel/GeoShapeSubtraction.h"
20
#include "GeoModelKernel/GeoTransform.h"
21
#include "GeoModelKernel/GeoTrd.h"
22
#include "
MuonAGDDDescription/MMDetectorDescription.h
"
23
#include "
MuonAGDDDescription/MMDetectorHelper.h
"
24
#include "
MuonAGDDDescription/MM_Technology.h
"
25
#include "
MuonGeoModel/Component.h
"
26
#include "
MuonGeoModel/MicromegasComponent.h
"
27
28
#include <GaudiKernel/IMessageSvc.h>
29
#include <GaudiKernel/MsgStream.h>
30
#include <GeoModelKernel/GeoShape.h>
31
#include <string>
32
33
class
GeoMaterial;
34
35
namespace
MuonGM
{
36
37
Micromegas::Micromegas
(
Component
*
ss
) :
DetectorElement
(
ss
->
name
) {
38
MicromegasComponent
*s =
static_cast<
MicromegasComponent
*
>
(
ss
);
39
m_component
= s;
40
width
= s->dx1;
41
longWidth
= s->dx2;
42
length
= s->dy;
43
name
= s->name;
44
index
= s->index;
45
}
46
47
GeoFullPhysVol *
Micromegas::build
(
StoredMaterialManager
& matManager,
48
int
minimalgeo) {
49
std::vector<Cutout *> vcutdef;
50
int
cutoutson = 0;
51
return
build
(matManager, minimalgeo, cutoutson, vcutdef);
52
}
53
54
GeoFullPhysVol *
Micromegas::build
(
StoredMaterialManager
& matManager,
55
int
minimalgeo,
int
,
56
const
std::vector<Cutout *>&)
57
{
58
MMDetectorHelper
mmHelper;
59
IAGDDtoGeoSvc::LockedController
c = mmHelper.
Get_Controller
();
60
AGDDDetectorStore
& ds = c->GetDetectorStore();
61
MMDetectorDescription
*mm_descr = mmHelper.
Get_MMDetectorSubType
(
m_component
->subType);
62
63
MM_Technology
*t =
static_cast<
MM_Technology
*
>
(ds.GetTechnology(
name
));
64
thickness
= t->Thickness();
65
double
gasTck = t->gasThickness;
66
double
pcbTck = t->pcbThickness;
67
double
roTck = t->roThickness;
68
double
f1 = mm_descr->
ylFrame
();
69
double
f2 = mm_descr->
ysFrame
();
70
double
f3 = mm_descr->
xFrame
();
71
72
minimalgeo = t->geoLevel;
73
74
// Build Micromegas mother volume out of G10
75
const
GeoShape *strd =
new
GeoTrd(
thickness
/ 2,
thickness
/ 2,
width
/ 2,
longWidth
/ 2,
length
/ 2);
76
77
logVolName
=
name
;
78
if
(!(
m_component
->subType).empty())
79
logVolName
+= (
"-"
+
m_component
->subType);
80
// std::FR4 is not always available. Fallback to sct::PCB
81
const
GeoMaterial *mtrd = matManager.
getMaterial
(
"std::FR4"
) !=
nullptr
?
82
matManager.
getMaterial
(
"std::FR4"
) : matManager.
getMaterial
(
"sct::PCB"
);
83
GeoLogVol *ltrd =
new
GeoLogVol(
logVolName
, strd, mtrd);
84
GeoFullPhysVol *ptrd =
new
GeoFullPhysVol(ltrd);
85
86
if
(!minimalgeo)
87
return
ptrd;
88
89
double
newpos = -
thickness
/ 2.;
90
ptrd->add(
new
GeoSerialIdentifier(0));
91
92
int
igl = 0;
93
94
// Loop over Micromegas layers
95
for
(
int
i = 0; i < t->nlayers; i++) {
96
// std::cout<<"loop over layers"<<std::endl;
97
double
widthActive;
98
double
longWidthActive;
99
double
lengthActive;
100
101
// sensitive volume
102
igl++;
103
ptrd->add(
new
GeoIdentifierTag(igl));
104
105
widthActive =
width
;
106
longWidthActive =
longWidth
;
107
lengthActive =
length
;
108
109
if
(i == 0)
110
newpos += gasTck / 2.;
111
else
112
newpos += gasTck;
113
if
((i + 1) % 2)
114
newpos += pcbTck;
115
else
116
newpos += roTck;
117
double
newXPos = newpos;
118
119
const
GeoShape *sGasVolume =
new
GeoTrd(gasTck / 2, gasTck / 2, widthActive / 2, longWidthActive / 2, lengthActive / 2);
120
121
GeoLogVol *ltrdtmp =
new
GeoLogVol(
"MM_Sensitive"
, sGasVolume, matManager.
getMaterial
(
"muo::ArCO2"
));
122
GeoPhysVol *ptrdtmp =
new
GeoPhysVol(ltrdtmp);
123
GeoNameTag *ntrdtmp =
new
GeoNameTag(
name
+
"muo::ArCO2"
);
124
GeoTransform *ttrdtmp =
new
GeoTransform(GeoTrf::TranslateX3D(newXPos));
125
126
// Place gas volume inside G10 mother volume so that
127
// subtractions from gas volume now become G10
128
129
ptrd->add(ntrdtmp);
130
ptrd->add(ttrdtmp);
131
ptrd->add(ptrdtmp);
132
133
double
lW =
longWidth
/ 2. - ((
longWidth
-
width
) / 2.) * f1 /
length
;
134
double
W =
width
/ 2. + ((
longWidth
-
width
) / 2.) * f2 /
length
;
135
const
GeoShape *trd1 =
new
GeoTrd(gasTck / 2, gasTck / 2,
width
/ 2,
longWidth
/ 2,
length
/ 2);
136
const
GeoShape *trd2 =
new
GeoTrd(gasTck, gasTck, W - f3, lW - f3,
length
/ 2 - (f1 + f2) / 2.);
137
GeoTrf::Translate3D c(0, 0, (f2 - f1) / 2.);
138
trd1 = &(trd1->subtract((*trd2) << c));
139
GeoLogVol *ltrdframe =
new
GeoLogVol(
"MM_Frame"
, trd1, matManager.
getMaterial
(
"std::Aluminium"
));
140
GeoPhysVol *ptrdframe =
new
GeoPhysVol(ltrdframe);
141
142
ptrdtmp->add(ptrdframe);
143
144
}
// Loop over tgc layers
145
146
return
ptrd;
147
}
148
149
void
Micromegas::print
()
const
{
150
MsgStream log(
Athena::getMessageSvc
(),
"MuonGM::Micromegas"
);
151
log << MSG::INFO <<
" Micromegas "
<<
name
<<
" :"
<<
endmsg
;
152
}
153
154
}
// namespace MuonGM
AGDDController.h
AGDDDetectorStore.h
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
Component.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
MMDetectorDescription.h
MMDetectorHelper.h
MicromegasComponent.h
Micromegas.h
MM_Technology.h
StoredMaterialManager.h
AGDDDetectorStore
Definition
AGDDDetectorStore.h:18
IAGDDtoGeoSvc::LockedController
CxxUtils::LockedPointer< AGDDController > LockedController
Definition
IAGDD2GeoSvc.h:26
MMDetectorDescription
Definition
MMDetectorDescription.h:45
MMDetectorDescription::xFrame
void xFrame(double y)
Definition
MMDetectorDescription.h:56
MMDetectorDescription::ysFrame
void ysFrame(double y)
Definition
MMDetectorDescription.h:59
MMDetectorDescription::ylFrame
void ylFrame(double y)
Definition
MMDetectorDescription.h:62
MMDetectorHelper
Definition
MMDetectorHelper.h:24
MMDetectorHelper::Get_MMDetectorSubType
MMDetectorDescription * Get_MMDetectorSubType(const std::string &type)
Definition
MMDetectorHelper.cxx:119
MMDetectorHelper::Get_Controller
IAGDDtoGeoSvc::LockedController Get_Controller()
Definition
MMDetectorHelper.cxx:126
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::DetectorElement::logVolName
std::string logVolName
Definition
DetectorElement.h:18
MuonGM::MM_Technology
Definition
MuonAGDDDescription/MuonAGDDDescription/MM_Technology.h:16
MuonGM::MicromegasComponent
Definition
MicromegasComponent.h:15
MuonGM::Micromegas::Micromegas
Micromegas(Component *s)
Definition
Micromegas.cxx:37
MuonGM::Micromegas::print
virtual void print() const override
Definition
Micromegas.cxx:149
MuonGM::Micromegas::m_component
MicromegasComponent * m_component
Definition
Micromegas.h:38
MuonGM::Micromegas::width
double width
Definition
Micromegas.h:23
MuonGM::Micromegas::longWidth
double longWidth
Definition
Micromegas.h:26
MuonGM::Micromegas::thickness
double thickness
Definition
Micromegas.h:25
MuonGM::Micromegas::build
GeoFullPhysVol * build(StoredMaterialManager &matManager, int minimalgeo)
Definition
Micromegas.cxx:47
MuonGM::Micromegas::length
double length
Definition
Micromegas.h:24
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