 |
ATLAS Offline Software
|
#include <PLRGmxInterface.h>
|
| PLRGmxInterface (PixelDetectorManager *detectorManager, SiCommonItems *commonItems, WaferTree *moduleTree) |
|
virtual int | sensorId (std::map< std::string, int > &index) const override final |
|
virtual void | addSensorType (const std::string &clas, const std::string &typeName, const std::map< std::string, std::string > ¶meters) override final |
|
virtual void | addSensor (const std::string &typeName, std::map< std::string, int > &index, int sequentialId, GeoVFullPhysVol *fpv) override final |
|
virtual void | addAlignable (int level, std::map< std::string, int > &index, GeoVFullPhysVol *fpv, GeoAlignableTransform *transform) override final |
|
void | buildReadoutGeometryFromSqlite (IRDBAccessSvc *rdbAccessSvc, GeoModelIO::ReadGeoModel *sqlreader) |
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
std::string | m_nm |
| Message source name. More...
|
|
boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| MsgStream instance (a std::cout like with print-out levels) More...
|
|
std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| MessageSvc pointer. More...
|
|
std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| Current logging level. More...
|
|
std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| Messaging initialized (initMessaging) More...
|
|
Definition at line 24 of file PLRGmxInterface.h.
◆ PLRGmxInterface()
◆ addAlignable()
void InDetDD::ITk::PixelGmxInterface::addAlignable |
( |
int |
level, |
|
|
std::map< std::string, int > & |
index, |
|
|
GeoVFullPhysVol * |
fpv, |
|
|
GeoAlignableTransform * |
transform |
|
) |
| |
|
finaloverridevirtualinherited |
Definition at line 501 of file PixelGmxInterface.cxx.
508 if (not pixelIdHelper){
509 ATH_MSG_ERROR(
"Dynamic cast to PixelID failed in PixelGmxInterface::addAlignable");
515 id = pixelIdHelper->wafer_id(
index[
"barrel_endcap"],
516 index[
"layer_wheel"],
522 id = pixelIdHelper->wafer_id(
index[
"barrel_endcap"],
523 index[
"layer_wheel"],
529 id = pixelIdHelper->wafer_id(
index[
"barrel_endcap"],
530 index[
"layer_wheel"],
536 id = pixelIdHelper->wafer_id(
index[
"barrel_endcap"],
543 throw GaudiException(
"Unknown level " +
std::to_string(
level) +
" for alignment in addAlignable",
544 "PixelGmxInterface::addAlignable", StatusCode::FAILURE);
◆ addSensor()
void InDetDD::PLRGmxInterface::addSensor |
( |
const std::string & |
typeName, |
|
|
std::map< std::string, int > & |
index, |
|
|
int |
sequentialId, |
|
|
GeoVFullPhysVol * |
fpv |
|
) |
| |
|
finaloverridevirtual |
Reimplemented from InDetDD::ITk::PixelGmxInterface.
Definition at line 81 of file PLRGmxInterface.cxx.
90 if (not pixelIdHelper){
91 ATH_MSG_ERROR(
"Failed dynamic_cast to PLR_ID in PLRGmxInterface::addSensor");
108 msg() << MSG::ERROR <<
key <<
" = " <<
value <<
"; ";
111 ATH_MSG_ERROR(
"Refusing to make it into a sensitive element. Incompatible gmx and identifier-xml files.");
121 throw std::runtime_error(
"readout sensor type " +
typeName +
" not found.");
125 if (design ==
nullptr) {
127 throw std::runtime_error(
"readout sensor type " +
typeName +
" not found.");
136 std::string errorMessage(
"");
138 index[
"layer_wheel"],
◆ addSensorType()
void InDetDD::PLRGmxInterface::addSensorType |
( |
const std::string & |
clas, |
|
|
const std::string & |
typeName, |
|
|
const std::map< std::string, std::string > & |
parameters |
|
) |
| |
|
finaloverridevirtual |
◆ buildReadoutGeometryFromSqlite()
void InDetDD::ITk::PixelGmxInterface::buildReadoutGeometryFromSqlite |
( |
IRDBAccessSvc * |
rdbAccessSvc, |
|
|
GeoModelIO::ReadGeoModel * |
sqlreader |
|
) |
| |
|
inherited |
Definition at line 429 of file PixelGmxInterface.cxx.
431 const std::array<std::string,2> sensorTypes{
"QuadChip_RD53",
"SingleChip_RD53"};
432 const std::array<std::string,17> rd53_ParamNames{
"circuitsPerEta",
"circuitsPerPhi",
"columns",
"detectorType",
"is3D",
"nEtaEndPerSide",
"nEtaLongPerSide",
"nPhiEndPerSide",
"nPhiLongPerSide",
"pitchEta",
"pitchEtaEnd",
"pitchEtaLong",
"pitchPhi",
"pitchPhiEnd",
"pitchPhiLong",
"rows",
"thickness"};
434 for(
const std::string & sType:sensorTypes){
436 if(rd53->size() !=0){
437 for (
unsigned int iR =0;iR<rd53->size();iR++){
438 std::map<std::string,std::string> rd53_Map;
439 for(
const std::string & paramName:rd53_ParamNames){
440 std::string paramValue = (*rd53)[iR]->getString(paramName);
441 rd53_Map[paramName] = std::move(paramValue);
443 std::string rd35_Name = (*rd53)[iR]->getString(
"SensorType");
447 if ( rd35_Name.find(
"Quad")!= std::string::npos
448 && ( rd35_Name.find(
"endcap")!= std::string::npos
449 || rd35_Name.find(
"inclined")!= std::string::npos)) {
459 const std::array<std::string,5>
fields{
"barrel_endcap",
"layer_wheel",
"phi_module",
"eta_module",
"side"};
462 const std::array<std::string,3> publishers({
"ITk",
"ITkPixel",
"GeoModelXML"});
465 std::map<std::string, GeoFullPhysVol*> mapFPV;
466 for (
auto & iPub : publishers){
468 mapFPV = sqlreader->getPublishedNodes<std::string, GeoFullPhysVol*>(iPub,
true);
469 if (!mapFPV.empty()) {
474 if (mapFPV.empty())
ATH_MSG_ERROR(
"Could not find any FPV tables under the expected names: "<<publishers);
476 for (
const auto&[fullPhysVolInfoString, fullPhysVolPointer] : mapFPV){
478 size_t startRG = fullPhysVolInfoString.find(
"RD53_");
479 if(startRG==std::string::npos){
480 ATH_MSG_DEBUG(
"GeoFullPhysVol "<<fullPhysVolInfoString<<
" does not have the expected format. Skipping");
483 std::string
typeName = fullPhysVolInfoString.substr(startRG);
484 std::map<std::string, int>
index;
486 size_t first = fullPhysVolInfoString.find(
field+
"_");
487 size_t last = fullPhysVolInfoString.find(
'_',
first+
field.size()+1);
488 if(
first==std::string::npos || last==std::string::npos){
489 ATH_MSG_DEBUG(
"Could not extract "<<
field<<
" from "<<fullPhysVolInfoString<<
". Skipping");
492 std::string strNew = fullPhysVolInfoString.substr(
first+
field.size()+1,last-(
first+
field.size()+1));
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ makePixelModule()
void InDetDD::ITk::PixelGmxInterface::makePixelModule |
( |
const std::string & |
typeName, |
|
|
const std::map< std::string, std::string > & |
parameters |
|
) |
| |
|
protectedinherited |
Definition at line 132 of file PixelGmxInterface.cxx.
135 int circuitsPerEta{2};
136 int circuitsPerPhi{2};
137 double thickness{0.150};
140 double pitchEtaLong{};
141 double pitchPhiLong{};
142 double pitchEtaEnd{};
143 double pitchPhiEnd{};
144 int nEtaLongPerSide{};
145 int nPhiLongPerSide{};
146 int nEtaEndPerSide{};
147 int nPhiEndPerSide{};
148 int rowsPerCircuit{};
149 int columnsPerCircuit{};
156 bool phiSymmetric{
true};
157 bool etaSymmetric{
true};
158 bool depthSymmetric{
true};
185 ATH_MSG_DEBUG(
"readout geo - design thickness " << thickness <<
" "
186 <<
" circuits " << circuitsPerPhi <<
" " << circuitsPerEta <<
" "
187 <<
" rows/columns " << rowsPerCircuit <<
" " << columnsPerCircuit <<
" "
188 <<
" pitch regular/long/end " << pitchPhi <<
" " << pitchEta
189 <<
" " << pitchPhiLong <<
" " << pitchEtaLong
190 <<
" " << pitchPhiEnd <<
" " << pitchEtaEnd
191 <<
" n-long " << nPhiLongPerSide <<
" " << nEtaLongPerSide
192 <<
" n-end " << nPhiEndPerSide <<
" " << nEtaEndPerSide
193 << carrier <<
" " << readoutSide);
198 int detectorTypeEnum = 0;
209 std::stringstream amsg;
210 amsg <<
"Index overflows index type of PixelDiodeTree. Parameters "
211 <<
"( " << circuitsPerPhi <<
" * " << rowsPerCircuit <<
" ), ( "
212 <<
"( " << circuitsPerEta <<
" * " << columnsPerCircuit <<
" ) !<"
214 throw std::runtime_error(amsg.str());
219 bool flipFE=(
typeName.find(
"_even") !=std::string::npos);
223 auto computeAttribute = [readoutTechnology,
231 ](
const std::array<PixelDiodeTree::IndexType,2> &split_idx,
233 [[maybe_unused]]
const std::array<bool,4> &ganged,
234 [[maybe_unused]]
unsigned int split_i,
237 -> std::tuple<PixelDiodeTree::AttributeType,PixelDiodeTree::AttributeType>
257 assert(split_idx[0]>=0 && split_idx[1]>=0);
258 std::array<int,2> chip_idx{split_idx[0]/rowsPerCircuit, split_idx[1]/columnsPerCircuit};
260 unsigned int n_large_dimensions = ( (std::abs(diode_width[0]-pitchPhi)>pitchPhi*.25)
261 +(std::abs(diode_width[1]-pitchEta)>pitchEta*.25));
262 switch (n_large_dimensions) {
306 ? circuitsPerEta - chip_idx[1] - 1
307 : (circuitsPerPhi-1) * circuitsPerEta + chip_idx[1]);
309 return std::make_tuple(current_matrix_attribute, current_diode_attribute);
312 PixelDiodeTree diode_tree
313 =
createPixelDiodeTree(std::array<unsigned int,2>{
static_cast<unsigned int>(circuitsPerPhi),
static_cast<unsigned int>(circuitsPerEta)},
314 std::array<unsigned int,2>{
static_cast<unsigned int>(rowsPerCircuit),
static_cast<unsigned int>(columnsPerCircuit)},
316 std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{
static_cast<unsigned int>(nPhiEndPerSide),
317 static_cast<unsigned int>(nEtaEndPerSide)},
318 std::array<unsigned int,2>{
static_cast<unsigned int>(nPhiLongPerSide),
319 static_cast<unsigned int>(nEtaLongPerSide)}},
323 std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{0
u,0
u},
324 std::array<unsigned int,2>{0
u,0
u}
329 auto design = std::make_unique<PixelModuleDesign>(thickness,
330 phiSymmetric, etaSymmetric, depthSymmetric,
331 circuitsPerPhi, circuitsPerEta,
332 columnsPerCircuit, rowsPerCircuit,
333 columnsPerCircuit, rowsPerCircuit,
334 std::move(diode_tree), carrier,
335 readoutSide, is3D, detectorType, readoutTechnology);
338 <<
" " << design->width() <<
"x" << design->length() <<
"x" << design->thickness()
339 <<
" " << design->rows() <<
"x" << design->columns()
340 <<
", " << circuitsPerPhi <<
"x" << circuitsPerEta <<
" "
341 << rowsPerCircuit <<
" " << columnsPerCircuit <<
":\n"
342 << diode_tree.debugStringRepr());
◆ makePLRModule()
void InDetDD::PLRGmxInterface::makePLRModule |
( |
const std::string & |
typeName, |
|
|
const std::map< std::string, std::string > & |
parameters |
|
) |
| |
|
private |
Definition at line 150 of file PLRGmxInterface.cxx.
153 int circuitsPerEta{1};
154 int circuitsPerPhi{1};
155 double thickness{0.150};
158 double pitchEtaLong{};
159 double pitchPhiLong{};
160 double pitchEtaEnd{};
161 double pitchPhiEnd{};
162 int nEtaLongPerSide{};
163 int nPhiLongPerSide{};
164 int nEtaEndPerSide{};
165 int nPhiEndPerSide{};
166 int rowsPerCircuit{};
167 int columnsPerCircuit{};
195 auto computeAttribute = [pitchPhi,
199 ](
const std::array<PixelDiodeTree::IndexType,2> &split_idx,
201 [[maybe_unused]]
const std::array<bool,4> &ganged,
202 [[maybe_unused]]
unsigned int split_i,
205 -> std::tuple<PixelDiodeTree::AttributeType,PixelDiodeTree::AttributeType>
226 assert(split_idx[0]>=0 && split_idx[1]>=0);
227 std::array<int,2> chip_idx{split_idx[0]/rowsPerCircuit, split_idx[1]/columnsPerCircuit};
229 unsigned int n_large_dimensions = ( (std::abs(diode_width[0]-pitchPhi)>pitchPhi*.25)
230 +(std::abs(diode_width[1]-pitchEta)>pitchEta*.25));
231 switch (n_large_dimensions) {
243 return std::make_tuple(current_matrix_attribute, current_diode_attribute);
246 PixelDiodeTree diode_tree
247 =
createPixelDiodeTree(std::array<unsigned int,2>{
static_cast<unsigned int>(circuitsPerPhi),
static_cast<unsigned int>(circuitsPerEta)},
248 std::array<unsigned int,2>{
static_cast<unsigned int>(rowsPerCircuit),
static_cast<unsigned int>(columnsPerCircuit)},
250 std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{
static_cast<unsigned int>(nPhiEndPerSide),
251 static_cast<unsigned int>(nEtaEndPerSide)},
252 std::array<unsigned int,2>{
static_cast<unsigned int>(nPhiLongPerSide),
253 static_cast<unsigned int>(nEtaLongPerSide)}},
257 std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{0
u,0
u},
258 std::array<unsigned int,2>{0
u,0
u}
267 auto design = std::make_unique<PixelModuleDesign>(thickness,
268 circuitsPerPhi, circuitsPerEta,
269 columnsPerCircuit, rowsPerCircuit,
270 columnsPerCircuit, rowsPerCircuit,
271 std::move(diode_tree), carrier,
272 readoutSide, is3D, detectorType,
275 ATH_MSG_DEBUG(
"readout geo - design " <<
typeName <<
" " << design->width() <<
"x" << design->length() <<
"x" << design->thickness()
276 <<
" " << design->rows() <<
"x" << design->columns()
277 <<
", " << circuitsPerPhi <<
"x" << circuitsPerEta <<
" "
278 << rowsPerCircuit <<
"x" << columnsPerCircuit
279 <<
" carrier " << carrier <<
" readout side " << readoutSide <<
":\n"
280 << diode_tree.debugStringRepr());
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ sensorId()
int InDetDD::PLRGmxInterface::sensorId |
( |
std::map< std::string, int > & |
index | ) |
const |
|
finaloverridevirtual |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_commonItems
◆ m_detectorManager
◆ m_geometryMap
std::map<std::string, int> InDetDD::ITk::PixelGmxInterface::m_geometryMap |
|
protectedinherited |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_moduleTree
WaferTree* InDetDD::ITk::PixelGmxInterface::m_moduleTree {} |
|
protectedinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
const AtlasDetectorID * getIdHelper() const
This is a Identifier helper class for the PLR subdetector. This class inherits from PixelID.
const SiDetectorDesign * addDesign(std::unique_ptr< const SiDetectorDesign > &&)
Access to module design; returns an observer pointer.
#define ATH_MSG_VERBOSE(x)
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
@ u
Enums for curvilinear frames.
IMessageSvc * getMessageSvc(bool quiet=false)
std::map< std::string, int > m_geometryMap
std::vector< T > getParameter(const std::string &varName, const std::vector< std::string > &buffer)
bool add(int bec, int ld, int eta, int phi, int side, Wafer &wafer, std::string &errorMessage)
unsigned int AttributeType
const SiDetectorDesign * getDesign(int i) const
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
void makePLRModule(const std::string &typeName, const std::map< std::string, std::string > ¶meters)
SiCommonItems * m_commonItems
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
MsgStream & msg() const
The standard message stream.
virtual void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *xf, const GeoVFullPhysVol *child)
Add alignable transforms.
bool is_valid() const
Check if id is in a valid state.
PixelGmxInterface(PixelDetectorManager *detectorManager, SiCommonItems *commonItems, WaferTree *moduleTree)
std::string to_string(const DetectorType &type)
void makePixelModule(const std::string &typeName, const std::map< std::string, std::string > ¶meters)
InDetDD::PixelDiodeTree::AttributeType makeAttributeType(T val)
convenience method to convert the given value into an attribute
PixelDetectorManager * m_detectorManager
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
static const SiHitIdHelper * GetHelper()
void initMessaging() const
Initialize our message level and MessageSvc.
virtual void addSensor(const std::string &typeName, std::map< std::string, int > &index, int sequentialId, GeoVFullPhysVol *fpv) override
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
int buildHitId(const int, const int, const int, const int, const int, const int) const
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
PixelDiodeTree createPixelDiodeTree(const std::array< unsigned int, 2 > &chip_dim, const std::array< unsigned int, 2 > &chip_matrix_dim, const PixelDiodeTree::Vector2D &pitch, const std::array< std::array< unsigned int, 2 >, 2 > &edge_dim, const std::array< PixelDiodeTree::Vector2D, 2 > &edge_pitch, const std::array< std::array< unsigned int, 2 >, 2 > &dead_zone, const AttributeRefiner &func_compute_attribute, std::ostream *debug_out=nullptr)
Create a pixel diode tree.
virtual void addDetectorElement(SiDetectorElement *element) override
Add elememts.