ATLAS Offline Software
Loading...
Searching...
No Matches
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, bool even_odd_phi_design=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
unsigned int m_nPhiDesigns =1
std::array< const InDetDD::SiDetectorDesign *, 2 > m_design {nullptr,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,
bool even_odd_phi_design = 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);
59 const double length = m_gmt_mgr->PixelBoardLength(m_isModule3D);
60 const double width = m_gmt_mgr->PixelBoardWidth(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 }
85
86 // optionally create different module design for even and odd phi modules, because
87 // the front-ends are numbered differently
88 m_nPhiDesigns=even_odd_phi_design ? 2 : 1;
89 for (unsigned int design_i=0; design_i<m_nPhiDesigns ; ++design_i) {
90 // for endcap modules the design for even-phi indices uses a "mirrored" front-end numbering scheme.
91 // instead of from top left 0..7 to top right, then bottom right to bottom left 8..15 , the front
92 // ends are numbered from bottom left to top left i.e. bottom and top are swapped.
94
97 PixelDiodeTree diode_tree = InDetDD::detail::makePixelDiodeTree(m_gmt_mgr,
98 readoutTechnology,
99 std::array<int,kNDirections>{circuitsPerPhi_corr,circuitsPerEta}, // [0]=phi/row, [1]=eta/column
100 std::array<int,kNDirections>{rowsPerCircuit_corr,columnsPerCircuit}, // [0]=phi/row, [1]=eta/column
101 std::array<std::array<double,kNDirections>,kNPixelLocations>{ // regular/central,longEnd/outer,long/inner
102 std::array<double,kNDirections>{pitchPhi,pitchEta},
103 std::array<double,kNDirections>{0.,pitchEtaLongEnd},
104 std::array<double,kNDirections>{0.,pitchEtaLong}},
105 fe_numbering);
106
107 std::unique_ptr<PixelModuleDesign> p_barrelDesign2 = std::make_unique<PixelModuleDesign>(thickness,
108 circuitsPerPhi,
109 circuitsPerEta,
110 cellColPerCirc,
111 cellRowPerCirc,
112 columnsPerCircuit,
113 rowsPerCircuit,
114 std::move(diode_tree),
116 readoutSide,
117 false, /* 3D */
118 InDetDD::Undefined, /* detector type */
119 readoutTechnology);
120
121 // Multiple connections (ganged pixels)
122 if (m_gmt_mgr->NumberOfEmptyRows() > 0) {
123 int minRow = m_gmt_mgr->EmptyRows(0);
124 int maxRow = minRow;
125 for (int iConnect = 0; iConnect < m_gmt_mgr->NumberOfEmptyRows(); iConnect++){
126 minRow = std::min(minRow, m_gmt_mgr->EmptyRows(iConnect));
127 minRow = std::min(minRow, m_gmt_mgr->EmptyRowConnections(iConnect));
128 maxRow = std::max(maxRow, m_gmt_mgr->EmptyRows(iConnect));
129 maxRow = std::max(maxRow, m_gmt_mgr->EmptyRowConnections(iConnect));
130 }
131
132 std::vector <int> connections(maxRow-minRow+1);
133
134 // We fill them all with a one to one correspondence first.
135 for (unsigned int iRow = 0; iRow < connections.size(); iRow++){
136 connections[iRow] = iRow + minRow;
137 }
138
139 // Now make the connections.
140 for (int iConnect = 0; iConnect < m_gmt_mgr->NumberOfEmptyRows(); iConnect++){
141 connections[m_gmt_mgr->EmptyRows(iConnect)-minRow] = m_gmt_mgr->EmptyRowConnections(iConnect);
142 }
143
144 p_barrelDesign2->addMultipleRowConnection(minRow, connections);
145
146 } else {
147 // No empty rows.
148 if (!m_gmt_mgr->ibl()) {
149 m_gmt_mgr->msg(MSG::WARNING) << "GeoPixelSiCrystal: No ganged pixels" << endmsg;
150 } else {
151 if (m_gmt_mgr->msgLvl(MSG::DEBUG)) m_gmt_mgr->msg(MSG::DEBUG) << "GeoPixelSiCrystal: No ganged pixels" << endmsg;
152 }
153 }
154
155 // Check that the active area seems reasonable
156
157 if ( (m_gmt_mgr->DesignRPActiveArea(m_isModule3D) > width) ||
158 (m_gmt_mgr->DesignZActiveArea(m_isModule3D) > length) ||
159 (width - m_gmt_mgr->DesignRPActiveArea(m_isModule3D) > 4 * Gaudi::Units::mm) ||
160 (length - m_gmt_mgr->DesignZActiveArea(m_isModule3D) > 4 * Gaudi::Units::mm) ) {
161 m_gmt_mgr->msg(MSG::WARNING) << "GeoPixelSiCrystal: Active area not consistent with sensor size. Sensor: "
162 << width/Gaudi::Units::mm << " x " << length/Gaudi::Units::mm << ", Active: "
163 << m_gmt_mgr->DesignRPActiveArea(m_isModule3D)/Gaudi::Units::mm << " x " << m_gmt_mgr->DesignZActiveArea(m_isModule3D)/Gaudi::Units::mm
164 << endmsg;
165 } else {
166 if (m_gmt_mgr->msgLvl(MSG::DEBUG)) m_gmt_mgr->msg(MSG::DEBUG)
167 << "GeoPixelSiCrystal: Sensor: "
168 << width/Gaudi::Units::mm << " x " << length/Gaudi::Units::mm << ", Active: "
169 << m_gmt_mgr->DesignRPActiveArea(m_isModule3D)/Gaudi::Units::mm << " x " << m_gmt_mgr->DesignZActiveArea(m_isModule3D)/Gaudi::Units::mm
170 << endmsg;
171 }
172
173
174 m_design.at(design_i) = m_DDmgr->addDesign(std::move(p_barrelDesign2));
175 }
176
177
178}
#define endmsg
double length(const pvec &v)
const double width
unsigned int m_nPhiDesigns
std::array< const InDetDD::SiDetectorDesign *, 2 > m_design
PixelGeometryManager * m_gmt_mgr
InDetDD::PixelDetectorManager * m_DDmgr
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)
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, FENumbering fe_numbering)

Member Function Documentation

◆ Build()

GeoVPhysVol * GeoPixelSiCrystal::Build ( )
overridevirtual

Implements GeoVPixelFactory.

Definition at line 179 of file GeoPixelSiCrystal.cxx.

179 {
180
181 GeoFullPhysVol* siPhys{nullptr};
182 int brl_ec= m_gmt_mgr->isEndcap() ? 2*m_gmt_mgr->GetSide() : 0;
183
184 if(m_sqliteReader) {
185 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());
186 siPhys = (*m_mapFPV)[siName];
187 }
188 else {
189 //(sar) code moved from c'tor..
190 const double thickness = m_gmt_mgr->PixelBoardThickness(m_isModule3D);
191 const double length = m_gmt_mgr->PixelBoardLength(m_isModule3D);
192 const double width = m_gmt_mgr->PixelBoardWidth(m_isModule3D);
193 //
194 std::string matName = m_gmt_mgr->getMaterialName("Sensor");
195 const GeoMaterial* siMat = m_mat_mgr->getMaterial(matName);
196 const GeoBox* siBox = new GeoBox(thickness*0.5,width*0.5,length*0.5);
197 std::string logname{"siLog"};
198 // There is not a strong need to give the blayer a different name but leave it for now.
199 if(m_isBLayer) logname = "siBLayLog";
200 auto *logVolume = new GeoLogVol(logname,siBox,siMat);
201 //(sar) ...to here
202
203
204 siPhys = new GeoFullPhysVol(logVolume);
205 }
206 // Build the Identifier for the silicon:
207 //
208 const PixelID * idHelper = m_gmt_mgr->getIdHelper();
209 m_id = idHelper->wafer_id(brl_ec,m_gmt_mgr->GetLD(),m_gmt_mgr->Phi(),m_gmt_mgr->Eta());
210 SiDetectorElement * element = new SiDetectorElement(m_id, m_design[ m_gmt_mgr->Phi() % m_nPhiDesigns] , siPhys, m_gmt_mgr->commonItems());
211
212 // add the element to the manager
213 m_DDmgr->addDetectorElement(element);
214 return siPhys;
215}
GeoModelIO::ReadGeoModel * m_sqliteReader
InDetMaterialManager * m_mat_mgr
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition PixelID.h:360

◆ 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

std::array<const InDetDD::SiDetectorDesign*,2> GeoPixelSiCrystal::m_design {nullptr,nullptr}
private

Definition at line 39 of file GeoPixelSiCrystal.h.

39{nullptr,nullptr};

◆ 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 40 of file GeoPixelSiCrystal.h.

◆ m_isModule3D

bool GeoPixelSiCrystal::m_isModule3D = false
private

Definition at line 41 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_nPhiDesigns

unsigned int GeoPixelSiCrystal::m_nPhiDesigns =1
private

Definition at line 38 of file GeoPixelSiCrystal.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: