ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_Sensor Class Reference

#include <SCT_Sensor.h>

Inheritance diagram for SCT_Sensor:
Collaboration diagram for SCT_Sensor:

Public Member Functions

 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)
const GeoMaterial * material () const
double thickness () const
double width () const
double length () const
virtual GeoVPhysVol * build (SCT_Identifier id)
const std::string & getName () const
std::string intToString (int i) const

Protected Member Functions

double epsilon () const

Protected Attributes

const GeoLogVol * m_logVolume
GeoModelIO::ReadGeoModel * m_sqliteReader
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
InDetDD::SCT_DetectorManagerm_detectorManager
SCT_GeometryManagerm_geometryManager
SCT_MaterialManagerm_materials

Private Member Functions

void getParameters ()
virtual const GeoLogVol * preBuild ()
void makeDesign ()

Private Attributes

const GeoMaterial * m_material = nullptr
double m_thickness = 0.0
double m_width = 0.0
double m_length = 0.0
const InDetDD::SiDetectorDesignm_design = nullptr
std::atomic_bool m_noElementWarning
std::string m_name

Static Private Attributes

static const double s_epsilon = 1.0e-6 * Gaudi::Units::mm

Detailed Description

Definition at line 17 of file SCT_Sensor.h.

Constructor & Destructor Documentation

◆ 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 at line 30 of file SCT_Sensor.cxx.

37 : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials, sqliteReader, std::move(mapFPV), std::move(mapAX)),
39{
42
43}
void getParameters()
virtual const GeoLogVol * preBuild()
std::atomic_bool m_noElementWarning
Definition SCT_Sensor.h:48
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)

Member Function Documentation

◆ build()

GeoVPhysVol * SCT_Sensor::build ( SCT_Identifier id)
virtual

Implements SCT_UniqueComponentFactory.

Definition at line 147 of file SCT_Sensor.cxx.

148{
149 GeoFullPhysVol * sensor;
150 if(m_sqliteReader){
151
152 std::string key="Sensor_Side#"+std::to_string(id.getSide())+"_"+std::to_string(id.getBarrelEC())+"_"+std::to_string(id.getLayerDisk())+"_"+std::to_string(id.getEtaModule())+"_"+std::to_string(id.getPhiModule());
153
154 sensor=(*m_mapFPV)[key];
155
156 }
157 else sensor= new GeoFullPhysVol(m_logVolume);
158
159 // Make detector element and add to collection
160 // Only do so if we have a valid id helper.
161
162 //id.print(); // for debugging only
163
164 const SiCommonItems* commonItems = m_geometryManager->commonItems();
165
166 if (commonItems->getIdHelper()) {
167
168 SiDetectorElement * detElement;
169
170 // detElement will be owned by SCT_DetectorManager
171 // and will be deleted in destructor of SiDetectorElementCollection in SCT_DetectorManager
172 detElement = new SiDetectorElement(id.getWaferId(),
173 m_design,
174 sensor,
175 commonItems);
176
177 // Add the detector element.
178 m_detectorManager->addDetectorElement(detElement);
179
180 } else {
181 if (m_noElementWarning) {
182 std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl;
183 m_noElementWarning = false;
184 }
185 }
186 return sensor;
187}
const AtlasDetectorID * getIdHelper() const
InDetDD::SCT_DetectorManager * m_detectorManager
SCT_GeometryManager * m_geometryManager
const InDetDD::SiDetectorDesign * m_design
Definition SCT_Sensor.h:46
GeoModelIO::ReadGeoModel * m_sqliteReader

◆ epsilon()

double SCT_ComponentFactory::epsilon ( ) const
protectedinherited

Definition at line 38 of file SCT_ComponentFactory.cxx.

39{
40 return s_epsilon;
41}
static const double s_epsilon

◆ getName()

const std::string & SCT_ComponentFactory::getName ( ) const
inlineinherited

Definition at line 35 of file SCT_ComponentFactory.h.

35{return m_name;}

◆ getParameters()

void SCT_Sensor::getParameters ( )
private

Definition at line 47 of file SCT_Sensor.cxx.

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}
SCT_MaterialManager * m_materials
double m_width
Definition SCT_Sensor.h:43
double m_thickness
Definition SCT_Sensor.h:42
const GeoMaterial * m_material
Definition SCT_Sensor.h:41
double m_length
Definition SCT_Sensor.h:44

◆ intToString()

std::string SCT_ComponentFactory::intToString ( int i) const
inherited

Definition at line 30 of file SCT_ComponentFactory.cxx.

31{
32 std::ostringstream str;
33 str << i;
34 return str.str();
35}

◆ length()

double SCT_Sensor::length ( ) const
inline

Definition at line 32 of file SCT_Sensor.h.

32{return m_length;}

◆ makeDesign()

void SCT_Sensor::makeDesign ( )
private

Definition at line 82 of file SCT_Sensor.cxx.

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,
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}

◆ material()

const GeoMaterial * SCT_Sensor::material ( ) const
inline

Definition at line 29 of file SCT_Sensor.h.

29{return m_material;}

◆ preBuild()

const GeoLogVol * SCT_Sensor::preBuild ( )
privatevirtual

Implements SCT_UniqueComponentFactory.

Definition at line 64 of file SCT_Sensor.cxx.

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}
const std::string & getName() const
void makeDesign()

◆ thickness()

double SCT_Sensor::thickness ( ) const
inline

Definition at line 30 of file SCT_Sensor.h.

30{return m_thickness;}

◆ width()

double SCT_Sensor::width ( ) const
inline

Definition at line 31 of file SCT_Sensor.h.

31{return m_width;}

Member Data Documentation

◆ m_design

const InDetDD::SiDetectorDesign* SCT_Sensor::m_design = nullptr
private

Definition at line 46 of file SCT_Sensor.h.

◆ m_detectorManager

InDetDD::SCT_DetectorManager* SCT_ComponentFactory::m_detectorManager
protectedinherited

Definition at line 41 of file SCT_ComponentFactory.h.

◆ m_geometryManager

SCT_GeometryManager* SCT_ComponentFactory::m_geometryManager
protectedinherited

Definition at line 42 of file SCT_ComponentFactory.h.

◆ m_length

double SCT_Sensor::m_length = 0.0
private

Definition at line 44 of file SCT_Sensor.h.

◆ m_logVolume

const GeoLogVol* SCT_UniqueComponentFactory::m_logVolume
protectedinherited

Definition at line 90 of file SCT_ComponentFactory.h.

◆ m_mapAX

std::shared_ptr<std::map<std::string, GeoAlignableTransform*> > SCT_UniqueComponentFactory::m_mapAX
protectedinherited

Definition at line 96 of file SCT_ComponentFactory.h.

◆ m_mapFPV

std::shared_ptr<std::map<std::string, GeoFullPhysVol*> > SCT_UniqueComponentFactory::m_mapFPV
protectedinherited

Definition at line 95 of file SCT_ComponentFactory.h.

◆ m_material

const GeoMaterial* SCT_Sensor::m_material = nullptr
private

Definition at line 41 of file SCT_Sensor.h.

◆ m_materials

SCT_MaterialManager* SCT_ComponentFactory::m_materials
protectedinherited

Definition at line 43 of file SCT_ComponentFactory.h.

◆ m_name

std::string SCT_ComponentFactory::m_name
privateinherited

Definition at line 49 of file SCT_ComponentFactory.h.

◆ m_noElementWarning

std::atomic_bool SCT_Sensor::m_noElementWarning
mutableprivate

Definition at line 48 of file SCT_Sensor.h.

◆ m_sqliteReader

GeoModelIO::ReadGeoModel* SCT_UniqueComponentFactory::m_sqliteReader
protectedinherited

Definition at line 91 of file SCT_ComponentFactory.h.

◆ m_thickness

double SCT_Sensor::m_thickness = 0.0
private

Definition at line 42 of file SCT_Sensor.h.

◆ m_width

double SCT_Sensor::m_width = 0.0
private

Definition at line 43 of file SCT_Sensor.h.

◆ s_epsilon

const double SCT_ComponentFactory::s_epsilon = 1.0e-6 * Gaudi::Units::mm
staticprivateinherited

Definition at line 50 of file SCT_ComponentFactory.h.


The documentation for this class was generated from the following files: