ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
GeoPixelSiCrystal Class Reference

#include <GeoPixelSiCrystal.h>

Inheritance diagram for GeoPixelSiCrystal:
Collaboration diagram for GeoPixelSiCrystal:

Public Member Functions

 GeoPixelSiCrystal (InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * >> mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * >> mapAX, bool isBLayer, bool isModule3D=false)
 
virtual GeoVPhysVol * Build () override
 
Identifier getID ()
 
bool GetModule3DFlag ()
 

Protected Attributes

PixelGeometryManagerm_gmt_mgr
 
InDetMaterialManagerm_mat_mgr
 
InDetDD::PixelDetectorManagerm_DDmgr
 
GeoModelIO::ReadGeoModel * m_sqliteReader
 
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
 
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
 
const double m_epsilon
 

Private Attributes

Identifier m_id
 
const InDetDD::SiDetectorDesignm_design {nullptr}
 
bool m_isBLayer = false
 
bool m_isModule3D = false
 

Detailed Description

Definition at line 19 of file GeoPixelSiCrystal.h.

Constructor & Destructor Documentation

◆ GeoPixelSiCrystal()

GeoPixelSiCrystal::GeoPixelSiCrystal ( InDetDD::PixelDetectorManager ddmgr,
PixelGeometryManager mgr,
GeoModelIO::ReadGeoModel *  sqliteReader,
std::shared_ptr< std::map< std::string, GeoFullPhysVol * >>  mapFPV,
std::shared_ptr< std::map< std::string, GeoAlignableTransform * >>  mapAX,
bool  isBLayer,
bool  isModule3D = false 
)

Definition at line 44 of file GeoPixelSiCrystal.cxx.

50  : GeoVPixelFactory (ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX))
51 {
52  //
53  //Builds the design for this crystal
54  m_isBLayer = isBLayer;
55  m_isModule3D = isModule3D;
56 
57  // Dimensions
58  const double thickness = m_gmt_mgr->PixelBoardThickness(m_isModule3D);
61 
62  int circuitsPerPhi = m_gmt_mgr->DesignCircuitsPhi(m_isModule3D); // Warning col/row naming opposite to chip
63  int circuitsPerEta = m_gmt_mgr->DesignCircuitsEta(m_isModule3D); // Warning col/row naming opposite to chip
64  int cellRowPerCirc = m_gmt_mgr->DesignCellRowsPerCircuit(m_isModule3D);
65  int cellColPerCirc = m_gmt_mgr->DesignCellColumnsPerCircuit(m_isModule3D);
66  int rowsPerCircuit = m_gmt_mgr->DesignDiodeRowsPerCircuit(m_isModule3D);
67  int columnsPerCircuit = m_gmt_mgr->DesignDiodeColumnsPerCircuit(m_isModule3D);
68  int readoutSide = m_gmt_mgr->DesignReadoutSide(m_isModule3D);
69 
70  double pitchEtaLongEnd = m_gmt_mgr->DesignPitchZLongEnd(m_isModule3D);
71  double pitchEtaLong = m_gmt_mgr->DesignPitchZLong(m_isModule3D);
72  double pitchPhi = m_gmt_mgr->DesignPitchRP(m_isModule3D);
73  double pitchEta = m_gmt_mgr->DesignPitchZ(m_isModule3D);
74 
75  auto readoutTechnology = getPixelReadoutTechnology(rowsPerCircuit,columnsPerCircuit );
76  auto circuitsPerPhi_corr = circuitsPerPhi;
77  auto rowsPerCircuit_corr = rowsPerCircuit;
78  if (readoutTechnology==InDetDD::PixelReadoutTechnology::FEI3 && circuitsPerPhi==1 && rowsPerCircuit==328) {
79  // FEI3 has 2x8 circuits and 160 + 4 rows per circuit not 1x8 circuits with 328 rows
80  // without this correction it is not possible to use the attribute associated to sub-matrices
81  // to assign FE numbers to sub-matrices.
82  circuitsPerPhi_corr*=2;
83  rowsPerCircuit_corr/=2;
84  }
88  readoutTechnology,
89  std::array<int,kNDirections>{circuitsPerPhi_corr,circuitsPerEta}, // [0]=phi/row, [1]=eta/column
90  std::array<int,kNDirections>{rowsPerCircuit_corr,columnsPerCircuit}, // [0]=phi/row, [1]=eta/column
91  std::array<std::array<double,kNDirections>,kNPixelLocations>{ // regular/central,longEnd/outer,long/inner
92  std::array<double,kNDirections>{pitchPhi,pitchEta},
93  std::array<double,kNDirections>{0.,pitchEtaLongEnd},
94  std::array<double,kNDirections>{0.,pitchEtaLong}});
95 
96  std::unique_ptr<PixelModuleDesign> p_barrelDesign2 = std::make_unique<PixelModuleDesign>(thickness,
97  circuitsPerPhi,
98  circuitsPerEta,
99  cellColPerCirc,
100  cellRowPerCirc,
101  columnsPerCircuit,
102  rowsPerCircuit,
103  std::move(diode_tree),
105  readoutSide,
106  false, /* 3D */
107  InDetDD::Undefined, /* detector type */
108  readoutTechnology);
109 
110  // Multiple connections (ganged pixels)
111  if (m_gmt_mgr->NumberOfEmptyRows() > 0) {
112  int minRow = m_gmt_mgr->EmptyRows(0);
113  int maxRow = minRow;
114  for (int iConnect = 0; iConnect < m_gmt_mgr->NumberOfEmptyRows(); iConnect++){
115  minRow = std::min(minRow, m_gmt_mgr->EmptyRows(iConnect));
116  minRow = std::min(minRow, m_gmt_mgr->EmptyRowConnections(iConnect));
117  maxRow = std::max(maxRow, m_gmt_mgr->EmptyRows(iConnect));
118  maxRow = std::max(maxRow, m_gmt_mgr->EmptyRowConnections(iConnect));
119  }
120 
121  std::vector <int> connections(maxRow-minRow+1);
122 
123  // We fill them all with a one to one correspondence first.
124  for (unsigned int iRow = 0; iRow < connections.size(); iRow++){
125  connections[iRow] = iRow + minRow;
126  }
127 
128  // Now make the connections.
129  for (int iConnect = 0; iConnect < m_gmt_mgr->NumberOfEmptyRows(); iConnect++){
130  connections[m_gmt_mgr->EmptyRows(iConnect)-minRow] = m_gmt_mgr->EmptyRowConnections(iConnect);
131  }
132 
133  p_barrelDesign2->addMultipleRowConnection(minRow, connections);
134 
135  } else {
136  // No empty rows.
137  if (!m_gmt_mgr->ibl()) {
138  m_gmt_mgr->msg(MSG::WARNING) << "GeoPixelSiCrystal: No ganged pixels" << endmsg;
139  } else {
140  if (m_gmt_mgr->msgLvl(MSG::DEBUG)) m_gmt_mgr->msg(MSG::DEBUG) << "GeoPixelSiCrystal: No ganged pixels" << endmsg;
141  }
142  }
143 
144  // Check that the active area seems reasonable
145 
150  m_gmt_mgr->msg(MSG::WARNING) << "GeoPixelSiCrystal: Active area not consistent with sensor size. Sensor: "
151  << width/Gaudi::Units::mm << " x " << length/Gaudi::Units::mm << ", Active: "
153  << endmsg;
154  } else {
156  << "GeoPixelSiCrystal: Sensor: "
157  << width/Gaudi::Units::mm << " x " << length/Gaudi::Units::mm << ", Active: "
159  << endmsg;
160  }
161 
162 
163  m_design = m_DDmgr->addDesign(std::move(p_barrelDesign2));
164 
165 
166 }

Member Function Documentation

◆ Build()

GeoVPhysVol * GeoPixelSiCrystal::Build ( )
overridevirtual

Implements GeoVPixelFactory.

Definition at line 167 of file GeoPixelSiCrystal.cxx.

167  {
168 
169  GeoFullPhysVol* siPhys{nullptr};
170  int brl_ec= m_gmt_mgr->isEndcap() ? 2*m_gmt_mgr->GetSide() : 0;
171 
172  if(m_sqliteReader) {
173  std::string siName ="SiPhys_" + std::to_string(brl_ec) +"_"+ std::to_string(m_gmt_mgr->GetLD()) +"_"+ std::to_string(m_gmt_mgr->Phi()) +"_"+ std::to_string(m_gmt_mgr->Eta());
174  siPhys = (*m_mapFPV)[siName];
175  }
176  else {
177  //(sar) code moved from c'tor..
178  const double thickness = m_gmt_mgr->PixelBoardThickness(m_isModule3D);
180  const double width = m_gmt_mgr->PixelBoardWidth(m_isModule3D);
181  //
182  std::string matName = m_gmt_mgr->getMaterialName("Sensor");
183  const GeoMaterial* siMat = m_mat_mgr->getMaterial(matName);
184  const GeoBox* siBox = new GeoBox(thickness*0.5,width*0.5,length*0.5);
185  std::string logname{"siLog"};
186  // There is not a strong need to give the blayer a different name but leave it for now.
187  if(m_isBLayer) logname = "siBLayLog";
188  auto *logVolume = new GeoLogVol(logname,siBox,siMat);
189  //(sar) ...to here
190 
191 
192  siPhys = new GeoFullPhysVol(logVolume);
193  }
194 
195  // Build the Identifier for the silicon:
196  //
197  const PixelID * idHelper = m_gmt_mgr->getIdHelper();
198  m_id = idHelper->wafer_id(brl_ec,m_gmt_mgr->GetLD(),m_gmt_mgr->Phi(),m_gmt_mgr->Eta());
200 
201  // add the element to the manager
202  m_DDmgr->addDetectorElement(element);
203  return siPhys;
204 }

◆ getID()

Identifier GeoPixelSiCrystal::getID ( )
inline

Definition at line 28 of file GeoPixelSiCrystal.h.

28 {return m_id;}

◆ GetModule3DFlag()

bool GeoPixelSiCrystal::GetModule3DFlag ( )
inline

Definition at line 30 of file GeoPixelSiCrystal.h.

30 { return m_isModule3D; };

Member Data Documentation

◆ m_DDmgr

InDetDD::PixelDetectorManager* GeoVPixelFactory::m_DDmgr
protectedinherited

Definition at line 45 of file GeoVPixelFactory.h.

◆ m_design

const InDetDD::SiDetectorDesign* GeoPixelSiCrystal::m_design {nullptr}
private

Definition at line 34 of file GeoPixelSiCrystal.h.

◆ m_epsilon

const double GeoVPixelFactory::m_epsilon
protectedinherited

Definition at line 49 of file GeoVPixelFactory.h.

◆ m_gmt_mgr

PixelGeometryManager* GeoVPixelFactory::m_gmt_mgr
protectedinherited

Definition at line 43 of file GeoVPixelFactory.h.

◆ m_id

Identifier GeoPixelSiCrystal::m_id
private

Definition at line 33 of file GeoPixelSiCrystal.h.

◆ m_isBLayer

bool GeoPixelSiCrystal::m_isBLayer = false
private

Definition at line 35 of file GeoPixelSiCrystal.h.

◆ m_isModule3D

bool GeoPixelSiCrystal::m_isModule3D = false
private

Definition at line 36 of file GeoPixelSiCrystal.h.

◆ m_mapAX

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

Definition at line 48 of file GeoVPixelFactory.h.

◆ m_mapFPV

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

Definition at line 47 of file GeoVPixelFactory.h.

◆ m_mat_mgr

InDetMaterialManager* GeoVPixelFactory::m_mat_mgr
protectedinherited

Definition at line 44 of file GeoVPixelFactory.h.

◆ m_sqliteReader

GeoModelIO::ReadGeoModel* GeoVPixelFactory::m_sqliteReader
protectedinherited

Definition at line 46 of file GeoVPixelFactory.h.


The documentation for this class was generated from the following files:
PixelGeometryManager::DesignCellRowsPerCircuit
virtual int DesignCellRowsPerCircuit(bool isModule3D=false)=0
PixelGeometryManager::NumberOfEmptyRows
virtual int NumberOfEmptyRows(bool isModule3D=false)=0
InDetDD::PixelDiodeTree
Tree structure to find the position, index or pitch of a pixel on a semi-regular grid The grid is con...
Definition: PixelDiodeTree.h:33
GeoPixelSiCrystal::m_id
Identifier m_id
Definition: GeoPixelSiCrystal.h:30
GeoPixelSiCrystal::m_design
const InDetDD::SiDetectorDesign * m_design
Definition: GeoPixelSiCrystal.h:34
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
PixelGeometryManager::msg
MsgStream & msg(MSG::Level lvl) const
Definition: PixelGeometryManager.h:611
PixelGeometryManager::DesignDiodeColumnsPerCircuit
virtual int DesignDiodeColumnsPerCircuit(bool isModule3D=false)=0
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
InDetDD::detail::kNPixelLocations
@ kNPixelLocations
Definition: PixelGeoUtils.h:19
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
PixelGeometryManager::DesignPitchZLongEnd
virtual double DesignPitchZLongEnd(bool isModule3D=false)=0
PixelGeometryManager::ibl
virtual bool ibl() const =0
GeoPixelSiCrystal::m_isModule3D
bool m_isModule3D
Definition: GeoPixelSiCrystal.h:36
PixelGeometryManager::DesignCircuitsEta
virtual int DesignCircuitsEta(bool isModule3D=false)=0
PixelGeometryManager::DesignZActiveArea
virtual double DesignZActiveArea(bool isModule3D=false)=0
InDetDD::PixelReadoutTechnology::FEI3
@ FEI3
InDetDD::SiDetectorManager::addDesign
const SiDetectorDesign * addDesign(std::unique_ptr< const SiDetectorDesign > &&)
Access to module design; returns an observer pointer.
Definition: SiDetectorManager.cxx:134
PixelGeometryManager::msgLvl
bool msgLvl(MSG::Level lvl) const
Definition: PixelGeometryManager.h:614
PixelGeometryManager::EmptyRowConnections
virtual int EmptyRowConnections(int index)=0
PixelGeometryManager::GetSide
virtual int GetSide()=0
GeoVPixelFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition: GeoVPixelFactory.h:46
PixelGeometryManager::DesignPitchZ
virtual double DesignPitchZ(bool isModule3D=false)=0
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:360
GeoVPixelFactory::m_DDmgr
InDetDD::PixelDetectorManager * m_DDmgr
Definition: GeoVPixelFactory.h:45
GeoVPixelFactory::m_gmt_mgr
PixelGeometryManager * m_gmt_mgr
Definition: GeoVPixelFactory.h:43
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
PixelGeometryManager::DesignRPActiveArea
virtual double DesignRPActiveArea(bool isModule3D=false)=0
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
PixelGeometryManager::DesignDiodeRowsPerCircuit
virtual int DesignDiodeRowsPerCircuit(bool isModule3D=false)=0
PixelGeometryManager::PixelBoardThickness
virtual double PixelBoardThickness(bool isModule3D=false)=0
PixelGeometryManager::Eta
virtual int Eta()=0
PixelGeometryManager::DesignCircuitsPhi
virtual int DesignCircuitsPhi(bool isModule3D=false)=0
GeoVPixelFactory::GeoVPixelFactory
GeoVPixelFactory(InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * >> mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * >> mapAX)
Definition: GeoVPixelFactory.cxx:11
PixelGeometryManager::DesignPitchZLong
virtual double DesignPitchZLong(bool isModule3D=false)=0
PixelGeometryManager::isEndcap
virtual bool isEndcap()=0
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
PixelGeometryManager::DesignReadoutSide
virtual int DesignReadoutSide(bool isModule3D=false)=0
PixelGeometryManager::PixelBoardLength
virtual double PixelBoardLength(bool isModule3D=false)=0
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
DEBUG
#define DEBUG
Definition: page_access.h:11
PixelGeometryManager::getIdHelper
virtual const PixelID * getIdHelper()=0
PixelGeometryManager::PixelBoardWidth
virtual double PixelBoardWidth(bool isModule3D=false)=0
PixelGeometryManager::getMaterialName
virtual std::string getMaterialName(const std::string &volumeName, int layerdisk=0, int typenum=0)=0
InDetDD::Undefined
@ Undefined
Definition: DetectorDesign.h:46
PixelGeometryManager::commonItems
virtual InDetDD::SiCommonItems * commonItems()=0
InDetDD::detail::kNDirections
@ kNDirections
Definition: PixelGeoUtils.h:20
PixelGeometryManager::EmptyRows
virtual int EmptyRows(int index)=0
InDetMaterialManager::getMaterial
const GeoMaterial * getMaterial(const std::string &materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
Definition: InDetMaterialManager.cxx:96
InDetDD::detail::makePixelDiodeTree
PixelDiodeTree makePixelDiodeTree(T_MsgParent *gmt_mgr, InDetDD::PixelReadoutTechnology readoutTechnology, const std::array< int, kNDirections > &circuits, const std::array< int, kNDirections > &dimPerCircuit, const std::array< std::array< double, kNDirections >, kNPixelLocations > &pitch)
Definition: PixelGeoUtils.h:46
PixelID
Definition: PixelID.h:67
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
PixelGeometryManager::DesignPitchRP
virtual double DesignPitchRP(bool isModule3D=false)=0
MakeSliceSet.logname
logname
Definition: MakeSliceSet.py:34
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
InDetDD::PixelDetectorManager::addDetectorElement
virtual void addDetectorElement(SiDetectorElement *element) override
Add elememts.
Definition: PixelDetectorManager.cxx:128
PixelGeometryManager::DesignCellColumnsPerCircuit
virtual int DesignCellColumnsPerCircuit(bool isModule3D=false)=0
GeoPixelSiCrystal::m_isBLayer
bool m_isBLayer
Definition: GeoPixelSiCrystal.h:35
PixelGeometryManager::GetLD
virtual int GetLD()=0
PixelGeometryManager::Phi
virtual int Phi()=0