ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
SCT_GeoModel
src
SCT_Sensor.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 <utility>
6
7
#include "
SCT_Sensor.h
"
8
9
#include "
SCT_GeometryManager.h
"
10
#include "
SCT_MaterialManager.h
"
11
12
#include "
SCT_BarrelModuleParameters.h
"
13
14
#include "GeoModelRead/ReadGeoModel.h"
15
#include "GeoModelKernel/GeoBox.h"
16
#include "GeoModelKernel/GeoLogVol.h"
17
#include "GeoModelKernel/GeoFullPhysVol.h"
18
#include "GeoModelKernel/GeoMaterial.h"
19
20
#include "
SCT_ReadoutGeometry/SCT_DetectorManager.h
"
21
#include "
SCT_ReadoutGeometry/SCT_BarrelModuleSideDesign.h
"
22
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
23
#include "
ReadoutGeometryBase/InDetDD_Defs.h
"
24
#include "
ReadoutGeometryBase/SiCommonItems.h
"
25
26
#include "GaudiKernel/SystemOfUnits.h"
27
28
using namespace
InDetDD
;
29
30
SCT_Sensor::SCT_Sensor
(
const
std::string & name,
31
InDetDD::SCT_DetectorManager
* detectorManager,
32
SCT_GeometryManager
* geometryManager,
33
SCT_MaterialManager
* materials,
34
GeoModelIO::ReadGeoModel* sqliteReader,
35
std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
36
std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
37
:
SCT_UniqueComponentFactory
(name, detectorManager, geometryManager, materials, sqliteReader,
std
::move(mapFPV),
std
::move(mapAX)),
38
m_noElementWarning
{true}
39
{
40
getParameters
();
41
m_logVolume
=
SCT_Sensor::preBuild
();
42
43
}
44
45
46
void
47
SCT_Sensor::getParameters
()
48
{
49
50
const
SCT_BarrelModuleParameters
* parameters =
m_geometryManager
->barrelModuleParameters();
51
if
(!
m_sqliteReader
)
m_material
=
m_materials
->getMaterial(parameters->sensorMaterial());
52
m_thickness
= parameters->sensorThickness();
53
m_length
= 0;
54
if
(parameters->sensorNumWafers() == 2) {
55
m_length
= parameters->sensorLength() + parameters->sensorDistCenterToCenter();
56
}
else
{
57
m_length
= parameters->sensorLength();
58
}
59
m_width
= parameters->sensorWidth();
60
61
}
62
63
const
GeoLogVol *
64
SCT_Sensor::preBuild
()
65
{
66
67
// Make the moduleside design for this sensor
68
makeDesign
();
69
if
(
m_sqliteReader
)
return
nullptr
;
70
71
// Build the sensor. Just a simple box.
72
const
GeoBox * sensorShape =
new
GeoBox(0.5*
m_thickness
, 0.5*
m_width
, 0.5*
m_length
);
73
GeoLogVol * sensorLog =
new
GeoLogVol(
getName
(), sensorShape,
m_material
);
74
75
76
77
return
sensorLog;
78
}
79
80
81
void
82
SCT_Sensor::makeDesign
()
83
{
84
//SiDetectorDesign::Axis etaAxis = SiDetectorDesign::zAxis;
85
//SiDetectorDesign::Axis phiAxis = SiDetectorDesign::yAxis;
86
//SiDetectorDesign::Axis depthAxis = SiDetectorDesign::xAxis;
87
const
SCT_BarrelModuleParameters
* parameters =
m_geometryManager
->barrelModuleParameters();
88
89
double
stripPitch = parameters->sensorStripPitch();
90
double
stripLength = parameters->sensorStripLength();
91
int
crystals = parameters->sensorNumWafers();
92
double
distCenterToCenter = parameters->sensorDistCenterToCenter();
93
94
//int cells = parameters->sensorNumReadoutStrips();
95
//int diodes = parameters->sensorNumStrips();
96
//int shift = parameters->sensorStripShift();
97
98
// For consistency with older version we keep shift = 0.
99
int
cells = parameters->sensorNumReadoutStrips();
100
int
diodes = cells;
101
int
shift = 0;
102
103
double
totalDeadLength = distCenterToCenter - stripLength;
104
105
double
xEtaStripPatternCenter = 0;
106
double
xPhiStripPatternCenter = 0;
107
108
// Readout direction is in same direction as local phi direction
109
bool
swapStripReadout =
false
;
110
111
// The readout side is at the +ve depth direction
112
int
readoutSide = +1;
113
114
// m_design will be owned and deleted by SCT_DetectorManager
115
std::unique_ptr<SCT_BarrelModuleSideDesign> design = std::make_unique<SCT_BarrelModuleSideDesign>(
m_thickness
,
116
crystals,
117
diodes,
118
cells,
119
shift,
120
swapStripReadout,
121
InDetDD::holes
,
122
stripPitch,
123
stripLength,
124
xEtaStripPatternCenter,
125
xPhiStripPatternCenter,
126
totalDeadLength,
127
readoutSide);
128
129
m_design
=
m_detectorManager
->addDesign(std::move(design));
130
131
//
132
// Flags to signal if axis can be swapped.
133
// For rectangular detector these are all true.
134
// This is the default and no action is required.
135
// Can force axes not to be swapped by setting to false.
136
//
137
// bool phiSyGaudi::Units::mmetric = true;
138
// bool etaSyGaudi::Units::mmetric = true;
139
// bool depthSyGaudi::Units::mmetric = true;
140
// m_design->setSyGaudi::Units::mmetry(phiSyGaudi::Units::mmetric, etaSyGaudi::Units::mmetric, depthSyGaudi::Units::mmetric,
141
//
142
}
143
144
145
146
GeoVPhysVol *
147
SCT_Sensor::build
(
SCT_Identifier
id
)
148
{
149
GeoFullPhysVol * sensor{};
150
if
(
m_sqliteReader
){
151
std::string key=std::format(
"Sensor_Side#{}_{}_{}_{}_{}"
,
id
.getSide(),
id
.getBarrelEC(),
id
.getLayerDisk(),
id
.getEtaModule(),
id
.getPhiModule());
152
sensor=(*m_mapFPV)[key];
153
}
154
else
{
155
sensor=
new
GeoFullPhysVol(
m_logVolume
);
156
}
157
158
// Make detector element and add to collection
159
// Only do so if we have a valid id helper.
160
161
//id.print(); // for debugging only
162
163
const
SiCommonItems
* commonItems =
m_geometryManager
->commonItems();
164
165
if
(commonItems->
getIdHelper
()) {
166
167
SiDetectorElement
* detElement;
168
169
// detElement will be owned by SCT_DetectorManager
170
// and will be deleted in destructor of SiDetectorElementCollection in SCT_DetectorManager
171
detElement =
new
SiDetectorElement
(
id
.getWaferId(),
172
m_design
,
173
sensor,
174
commonItems);
175
176
// Add the detector element.
177
m_detectorManager
->addDetectorElement(detElement);
178
179
}
else
{
180
if
(
m_noElementWarning
) {
181
std::cout <<
"WARNING!!!!: No SCT id helper and so no elements being produced."
<< std::endl;
182
m_noElementWarning
=
false
;
183
}
184
}
185
return
sensor;
186
}
InDetDD_Defs.h
SCT_BarrelModuleParameters.h
SCT_BarrelModuleSideDesign.h
SCT_DetectorManager.h
SCT_GeometryManager.h
SCT_MaterialManager.h
SCT_Sensor.h
SiCommonItems.h
SiDetectorElement.h
InDetDD::SCT_DetectorManager
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
Definition
SCT_DetectorManager.h:50
InDetDD::SiCommonItems
Helper class to concentrate common items, such as the pointer to the IdHelper, the lorentzAngle tool ...
Definition
SiCommonItems.h:45
InDetDD::SiCommonItems::getIdHelper
const AtlasDetectorID * getIdHelper() const
Definition
SiCommonItems.h:83
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
SCT_BarrelModuleParameters
Definition
SCT_BarrelModuleParameters.h:12
SCT_ComponentFactory::getName
const std::string & getName() const
Definition
SCT_ComponentFactory.h:35
SCT_ComponentFactory::m_detectorManager
InDetDD::SCT_DetectorManager * m_detectorManager
Definition
SCT_ComponentFactory.h:38
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition
SCT_ComponentFactory.h:39
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition
SCT_ComponentFactory.h:40
SCT_GeometryManager
Definition
SCT_GeometryManager.h:25
SCT_Identifier
Definition
SCT_Identifier.h:12
SCT_MaterialManager
Definition
SCT_MaterialManager.h:21
SCT_Sensor::m_width
double m_width
Definition
SCT_Sensor.h:43
SCT_Sensor::makeDesign
void makeDesign()
Definition
SCT_Sensor.cxx:82
SCT_Sensor::build
virtual GeoVPhysVol * build(SCT_Identifier id)
Definition
SCT_Sensor.cxx:147
SCT_Sensor::m_thickness
double m_thickness
Definition
SCT_Sensor.h:42
SCT_Sensor::getParameters
void getParameters()
Definition
SCT_Sensor.cxx:47
SCT_Sensor::m_material
const GeoMaterial * m_material
Definition
SCT_Sensor.h:41
SCT_Sensor::m_design
const InDetDD::SiDetectorDesign * m_design
Definition
SCT_Sensor.h:46
SCT_Sensor::preBuild
virtual const GeoLogVol * preBuild()
Definition
SCT_Sensor.cxx:64
SCT_Sensor::m_length
double m_length
Definition
SCT_Sensor.h:44
SCT_Sensor::m_noElementWarning
std::atomic_bool m_noElementWarning
Definition
SCT_Sensor.h:48
SCT_Sensor::SCT_Sensor
SCT_Sensor(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX)
Definition
SCT_Sensor.cxx:30
SCT_UniqueComponentFactory::SCT_UniqueComponentFactory
SCT_UniqueComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials=nullptr, GeoModelIO::ReadGeoModel *sqliteReader=nullptr, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV=nullptr, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX=nullptr)
Definition
SCT_ComponentFactory.cxx:34
SCT_UniqueComponentFactory::m_logVolume
const GeoLogVol * m_logVolume
Definition
SCT_ComponentFactory.h:86
SCT_UniqueComponentFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition
SCT_ComponentFactory.h:87
InDetDD
Message Stream Member.
Definition
FakeTrackBuilder.h:8
InDetDD::holes
@ holes
Definition
InDetDD_Defs.h:17
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0