ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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 28 of file SCT_Sensor.cxx.

35  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials, sqliteReader, mapFPV, mapAX),
36  m_noElementWarning{true}
37 {
38  getParameters();
40 
41 }

Member Function Documentation

◆ build()

GeoVPhysVol * SCT_Sensor::build ( SCT_Identifier  id)
virtual

Implements SCT_UniqueComponentFactory.

Definition at line 145 of file SCT_Sensor.cxx.

146 {
147  GeoFullPhysVol * sensor;
148  if(m_sqliteReader){
149 
150  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());
151 
152  sensor=(*m_mapFPV)[key];
153 
154  }
155  else sensor= new GeoFullPhysVol(m_logVolume);
156 
157  // Make detector element and add to collection
158  // Only do so if we have a valid id helper.
159 
160  //id.print(); // for debugging only
161 
162  const SiCommonItems* commonItems = m_geometryManager->commonItems();
163 
164  if (commonItems->getIdHelper()) {
165 
166  SiDetectorElement * detElement;
167 
168  // detElement will be owned by SCT_DetectorManager
169  // and will be deleted in destructor of SiDetectorElementCollection in SCT_DetectorManager
170  detElement = new SiDetectorElement(id.getWaferId(),
171  m_design,
172  sensor,
173  commonItems);
174 
175  // Add the detector element.
177 
178  } else {
179  if (m_noElementWarning) {
180  std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl;
181  m_noElementWarning = false;
182  }
183  }
184  return sensor;
185 }

◆ epsilon()

double SCT_ComponentFactory::epsilon ( ) const
protectedinherited

Definition at line 37 of file SCT_ComponentFactory.cxx.

38 {
39  return s_epsilon;
40 }

◆ 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 45 of file SCT_Sensor.cxx.

46 {
47 
49  if(!m_sqliteReader) m_material = m_materials->getMaterial(parameters->sensorMaterial());
50  m_thickness = parameters->sensorThickness();
51  m_length = 0;
52  if (parameters->sensorNumWafers() == 2) {
53  m_length = parameters->sensorLength() + parameters->sensorDistCenterToCenter();
54  } else {
55  m_length = parameters->sensorLength();
56  }
57  m_width = parameters->sensorWidth();
58 
59 }

◆ intToString()

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

Definition at line 29 of file SCT_ComponentFactory.cxx.

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

◆ 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 80 of file SCT_Sensor.cxx.

81 {
82  //SiDetectorDesign::Axis etaAxis = SiDetectorDesign::zAxis;
83  //SiDetectorDesign::Axis phiAxis = SiDetectorDesign::yAxis;
84  //SiDetectorDesign::Axis depthAxis = SiDetectorDesign::xAxis;
86 
87  double stripPitch = parameters->sensorStripPitch();
88  double stripLength = parameters->sensorStripLength();
89  int crystals = parameters->sensorNumWafers();
90  double distCenterToCenter = parameters->sensorDistCenterToCenter();
91 
92  //int cells = parameters->sensorNumReadoutStrips();
93  //int diodes = parameters->sensorNumStrips();
94  //int shift = parameters->sensorStripShift();
95 
96  // For consistency with older version we keep shift = 0.
97  int cells = parameters->sensorNumReadoutStrips();
98  int diodes = cells;
99  int shift = 0;
100 
101  double totalDeadLength = distCenterToCenter - stripLength;
102 
103  double xEtaStripPatternCenter = 0;
104  double xPhiStripPatternCenter = 0;
105 
106  // Readout direction is in same direction as local phi direction
107  bool swapStripReadout = false;
108 
109  // The readout side is at the +ve depth direction
110  int readoutSide = +1;
111 
112  // m_design will be owned and deleted by SCT_DetectorManager
113  std::unique_ptr<SCT_BarrelModuleSideDesign> design = std::make_unique<SCT_BarrelModuleSideDesign>(m_thickness,
114  crystals,
115  diodes,
116  cells,
117  shift,
118  swapStripReadout,
120  stripPitch,
121  stripLength,
122  xEtaStripPatternCenter,
123  xPhiStripPatternCenter,
124  totalDeadLength,
125  readoutSide);
126 
127  m_design = m_detectorManager->addDesign(std::move(design));
128 
129  //
130  // Flags to signal if axis can be swapped.
131  // For rectangular detector these are all true.
132  // This is the default and no action is required.
133  // Can force axes not to be swapped by setting to false.
134  //
135  // bool phiSyGaudi::Units::mmetric = true;
136  // bool etaSyGaudi::Units::mmetric = true;
137  // bool depthSyGaudi::Units::mmetric = true;
138  // m_design->setSyGaudi::Units::mmetry(phiSyGaudi::Units::mmetric, etaSyGaudi::Units::mmetric, depthSyGaudi::Units::mmetric,
139  //
140 }

◆ 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 62 of file SCT_Sensor.cxx.

63 {
64 
65  // Make the moduleside design for this sensor
66  makeDesign();
67  if(m_sqliteReader) return nullptr;
68 
69  // Build the sensor. Just a simple box.
70  const GeoBox * sensorShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length);
71  GeoLogVol * sensorLog = new GeoLogVol(getName(), sensorShape, m_material);
72 
73 
74 
75  return sensorLog;
76 }

◆ 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:
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition: SCT_ComponentFactory.h:42
SCT_ComponentFactory::m_name
std::string m_name
Definition: SCT_ComponentFactory.h:49
InDetDD::SiCommonItems::getIdHelper
const AtlasDetectorID * getIdHelper() const
Definition: SiCommonItems.h:83
InDetDD::holes
@ holes
Definition: InDetDD_Defs.h:17
SCT_GeometryManager::commonItems
const InDetDD::SiCommonItems * commonItems() const
Definition: SCT_GeometryManager.cxx:66
SCT_Sensor::m_length
double m_length
Definition: SCT_Sensor.h:44
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:43
InDetDD::SiDetectorManager::addDesign
const SiDetectorDesign * addDesign(std::unique_ptr< const SiDetectorDesign > &&)
Access to module design; returns an observer pointer.
Definition: SiDetectorManager.cxx:134
SCT_Sensor::m_width
double m_width
Definition: SCT_Sensor.h:43
SCT_ComponentFactory::m_detectorManager
InDetDD::SCT_DetectorManager * m_detectorManager
Definition: SCT_ComponentFactory.h:41
SCT_Sensor::m_material
const GeoMaterial * m_material
Definition: SCT_Sensor.h:41
lumiFormat.i
int i
Definition: lumiFormat.py:92
SCT_Sensor::m_noElementWarning
std::atomic_bool m_noElementWarning
Definition: SCT_Sensor.h:48
SCT_ComponentFactory::s_epsilon
static const double s_epsilon
Definition: SCT_ComponentFactory.h:50
SCT_GeometryManager::barrelModuleParameters
const SCT_BarrelModuleParameters * barrelModuleParameters() const
Definition: SCT_GeometryManager.cxx:84
SCT_Sensor::makeDesign
void makeDesign()
Definition: SCT_Sensor.cxx:80
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition: SCT_ComponentFactory.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
InDetDD::SiCommonItems
Definition: SiCommonItems.h:45
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SCT_Sensor::getParameters
void getParameters()
Definition: SCT_Sensor.cxx:45
SCT_BarrelModuleParameters
Definition: SCT_BarrelModuleParameters.h:12
SCT_UniqueComponentFactory::m_logVolume
const GeoLogVol * m_logVolume
Definition: SCT_ComponentFactory.h:90
SCT_MaterialManager::getMaterial
const GeoMaterial * getMaterial(const std::string &materialName)
Definition: SCT_MaterialManager.cxx:51
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
InDetDD::SCT_DetectorManager::addDetectorElement
virtual void addDetectorElement(SiDetectorElement *element) override
Add elememts during construction.
Definition: SCT_DetectorManager.cxx:104
SCT_Sensor::m_design
const InDetDD::SiDetectorDesign * m_design
Definition: SCT_Sensor.h:46
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
str
Definition: BTagTrackIpAccessor.cxx:11
SCT_Sensor::preBuild
virtual const GeoLogVol * preBuild()
Definition: SCT_Sensor.cxx:62
SCT_UniqueComponentFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition: SCT_ComponentFactory.h:91
SCT_ComponentFactory::getName
const std::string & getName() const
Definition: SCT_ComponentFactory.h:35
SCT_Sensor::m_thickness
double m_thickness
Definition: SCT_Sensor.h:42
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37