Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <StripGmxInterface.h>
|
| StripGmxInterface (SCT_DetectorManager *detectorManager, SiCommonItems *commonItems, WaferTree *waferTree) |
|
virtual int | sensorId (std::map< std::string, int > &index) const override final |
|
virtual int | splitSensorId (std::map< std::string, int > &index, std::pair< std::string, int > &extraIndex, std::map< std::string, int > &updatedIndex) const override final |
|
virtual void | addSensorType (const std::string &clas, const std::string &typeName, const std::map< std::string, std::string > ¶meters) override final |
|
void | addSensor (const std::string &typeName, std::map< std::string, int > &index, int sequentialId, GeoVFullPhysVol *fpv) override final |
|
void | addSplitSensor (const std::string &typeName, std::map< std::string, int > &index, std::pair< std::string, int > &extraIndex, int sequentialId, GeoVFullPhysVol *fpv, int splitLevel) override final |
|
virtual void | addAlignable (int level, std::map< std::string, int > &index, GeoVFullPhysVol *fpv, GeoAlignableTransform *transform) override final |
|
virtual void | addSplitAlignable (int level, std::map< std::string, int > &index, std::pair< std::string, int > &extraIndex, 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...
|
|
Definition at line 29 of file StripGmxInterface.h.
◆ StripGmxInterface()
◆ addAlignable()
void InDetDD::ITk::StripGmxInterface::addAlignable |
( |
int |
level, |
|
|
std::map< std::string, int > & |
index, |
|
|
GeoVFullPhysVol * |
fpv, |
|
|
GeoAlignableTransform * |
transform |
|
) |
| |
|
finaloverridevirtual |
Definition at line 618 of file StripGmxInterface.cxx.
628 if (not sctIdHelper){
629 ATH_MSG_ERROR(
"Failed dynamic_cast to SCT_ID in StripGmxInterface::addAlignable");
635 id = sctIdHelper->wafer_id(
index[
"barrel_endcap"],
636 index[
"layer_wheel"],
642 id = sctIdHelper->wafer_id(
index[
"barrel_endcap"],
643 index[
"layer_wheel"],
649 id = sctIdHelper->wafer_id(
index[
"barrel_endcap"],
650 index[
"layer_wheel"],
656 id = sctIdHelper->wafer_id(
index[
"barrel_endcap"],
663 throw GaudiException(
"Unknown level " +
std::to_string(
level) +
" for alignment in addAlignable",
664 "StripGmxInterface::addAlignable", StatusCode::FAILURE);
◆ addSensor()
void InDetDD::ITk::StripGmxInterface::addSensor |
( |
const std::string & |
typeName, |
|
|
std::map< std::string, int > & |
index, |
|
|
int |
sequentialId, |
|
|
GeoVFullPhysVol * |
fpv |
|
) |
| |
|
finaloverride |
Definition at line 552 of file StripGmxInterface.cxx.
561 if (not sctIdHelper){
562 ATH_MSG_ERROR(
"StripGmxInterface::addSensor: ID helper pointer could not be cast to SCT_ID *");
566 index[
"layer_wheel"],
580 msg() << MSG::ERROR <<
key <<
" = " <<
value <<
"; ";
583 ATH_MSG_ERROR(
"Refusing to make it into a sensitive element. Incompatible gmx and identifier-xml files.");
593 throw std::runtime_error(
"readout sensor type " +
typeName +
" not found.");
595 const SiDetectorDesign *design =
it->second;
602 Wafer wafer((
unsigned int) hashId);
603 std::string errorMessage(
"");
605 index[
"layer_wheel"],
◆ addSensorType()
void InDetDD::ITk::StripGmxInterface::addSensorType |
( |
const std::string & |
clas, |
|
|
const std::string & |
typeName, |
|
|
const std::map< std::string, std::string > & |
parameters |
|
) |
| |
|
finaloverridevirtual |
Definition at line 108 of file StripGmxInterface.cxx.
114 if (clas ==
"SiStripBox") {
116 }
else if (clas ==
"StereoAnnulus") {
119 ATH_MSG_ERROR(
"addSensorType: unrecognised sensor class: " << clas);
◆ addSplitAlignable()
void InDetDD::ITk::StripGmxInterface::addSplitAlignable |
( |
int |
level, |
|
|
std::map< std::string, int > & |
index, |
|
|
std::pair< std::string, int > & |
extraIndex, |
|
|
GeoVFullPhysVol * |
fpv, |
|
|
GeoAlignableTransform * |
transform |
|
) |
| |
|
finaloverridevirtual |
Definition at line 670 of file StripGmxInterface.cxx.
680 std::map<std::string, int> updatedIndex;
684 if (not sctIdHelper){
685 ATH_MSG_ERROR(
"Failed dynamic_cast to SCT_ID in StripGmxInterface::addSplitAlignable");
691 id = sctIdHelper->wafer_id(updatedIndex[
"barrel_endcap"],
692 updatedIndex[
"layer_wheel"],
693 updatedIndex[
"phi_module"],
694 updatedIndex[
"eta_module"],
695 updatedIndex[
"side"]);
698 id = sctIdHelper->wafer_id(updatedIndex[
"barrel_endcap"],
699 updatedIndex[
"layer_wheel"],
700 updatedIndex[
"phi_module"],
701 updatedIndex[
"eta_module"],
705 id = sctIdHelper->wafer_id(updatedIndex[
"barrel_endcap"],
706 updatedIndex[
"layer_wheel"],
712 id = sctIdHelper->wafer_id(updatedIndex[
"barrel_endcap"],
719 throw GaudiException(
"Unknown level " +
std::to_string(
level) +
" for alignment in addSplitAlignable",
720 "StripGmxInterface::addSplitAlignable", StatusCode::FAILURE);
◆ addSplitSensor()
void InDetDD::ITk::StripGmxInterface::addSplitSensor |
( |
const std::string & |
typeName, |
|
|
std::map< std::string, int > & |
index, |
|
|
std::pair< std::string, int > & |
extraIndex, |
|
|
int |
sequentialId, |
|
|
GeoVFullPhysVol * |
fpv, |
|
|
int |
splitLevel |
|
) |
| |
|
finaloverride |
Definition at line 476 of file StripGmxInterface.cxx.
483 std::map<std::string, int> updatedIndex;
485 int splitIndex = extraIndex.second;
490 if (not sctIdHelper){
491 ATH_MSG_ERROR(
"Failed dynamic cast to SCT_ID in StripGmxInterface::addSplitSensor");
494 Identifier id = sctIdHelper->wafer_id(updatedIndex[
"barrel_endcap"],
495 updatedIndex[
"layer_wheel"],
496 updatedIndex[
"phi_module"],
497 updatedIndex[
"eta_module"],
498 updatedIndex[
"side"]);
509 msg() << MSG::ERROR <<
key <<
" = " <<
value <<
"; ";
512 ATH_MSG_ERROR(
"Refusing to make it into a sensitive element. Incompatible gmx and identifier-xml files.");
520 if (updatedIndex[
"barrel_endcap"] == 0) {
527 throw std::runtime_error(
"readout sensor type " +
typeName +
" not found.");
529 const SiDetectorDesign *design =
it->second;
536 Wafer wafer((
unsigned int) hashId);
537 std::string errorMessage(
"");
539 updatedIndex[
"layer_wheel"],
540 updatedIndex[
"eta_module"],
541 updatedIndex[
"phi_module"],
542 updatedIndex[
"side"],
◆ buildReadoutGeometryFromSqlite()
void InDetDD::ITk::StripGmxInterface::buildReadoutGeometryFromSqlite |
( |
IRDBAccessSvc * |
rdbAccessSvc, |
|
|
GeoModelIO::ReadGeoModel * |
sqlreader |
|
) |
| |
Definition at line 726 of file StripGmxInterface.cxx.
729 const std::array<std::string,13> stereoAnnulusParamNames{
"thickness",
"carrierType",
"readoutSide",
"fieldDirection",
"stripDirection",
"stereoAngle",
"centreR",
"nRows",
"splitLevel",
"nStrips",
"phiPitch",
"startR",
"endR"};
731 if(stereoAnnulus->size() !=0){
732 for (
unsigned int iR =0;iR<stereoAnnulus->size();iR++){
733 std::map<std::string,std::string> stereoAnnulusMap;
734 for(
const std::string& paramName:stereoAnnulusParamNames){
735 std::string paramValue = (*stereoAnnulus)[iR]->getString(paramName);
736 stereoAnnulusMap[paramName] = paramValue;
738 std::string stereoAnnulusName = (*stereoAnnulus)[iR]->getString(
"SensorType");
745 const std::array<std::string,10> stripBoxParamNames{
"thickness",
"carrierType",
"readoutSide",
"fieldDirection",
"stripDirection",
"nRows",
"stripLength",
"splitLevel",
"nStrips",
"pitch"};
747 if(stripBox->size() !=0){
748 for (
unsigned int iR =0;iR<stripBox->size();iR++){
749 std::map<std::string,std::string> stripBoxMap;
750 for(
const std::string& paramName:stripBoxParamNames){
751 std::string paramValue = (*stripBox)[iR]->getString(paramName);
752 stripBoxMap[paramName] = std::move(paramValue);
754 std::string stripBoxName = (*stripBox)[iR]->getString(
"SensorType");
762 const std::array<std::string,5>
fields{
"barrel_endcap",
"layer_wheel",
"phi_module",
"eta_module",
"side"};
765 const std::array<std::string,3> publishers{
"ITk",
"ITkStrip",
"GeoModelXML"};
768 std::map<std::string, GeoFullPhysVol*> mapFPV;
769 for (
auto & iPub : publishers){
771 mapFPV = sqlreader->getPublishedNodes<std::string, GeoFullPhysVol*>(iPub,
true);
772 if (!mapFPV.empty()) {
777 if (mapFPV.empty())
ATH_MSG_ERROR(
"Could not find any FPV tables under the expected names: "<<publishers);
778 for (
const auto&[fullPhysVolInfoString, fullPhysVolPointer] : mapFPV){
780 size_t startRG = fullPhysVolInfoString.find(
"RG_");
781 if(startRG==std::string::npos){
782 ATH_MSG_DEBUG(
"GeoFullPhysVol "<<fullPhysVolInfoString<<
" does not have the expected format. Skipping");
785 std::string
typeName = fullPhysVolInfoString.substr(startRG);
786 std::map<std::string, int>
index;
788 size_t first = fullPhysVolInfoString.find(
field+
"_");
789 size_t last = fullPhysVolInfoString.find(
'_',
first+
field.size()+1);
790 if(
first==std::string::npos || last==std::string::npos){
791 ATH_MSG_DEBUG(
"Could not extract "<<
field<<
" from "<<fullPhysVolInfoString<<
". Skipping");
794 std::string strNew = fullPhysVolInfoString.substr(
first+
field.size()+1,last-(
first+
field.size()+1));
798 size_t splitPos = fullPhysVolInfoString.find(
"split_");
799 if(splitPos!=std::string::npos){
800 size_t last = fullPhysVolInfoString.find(
'_',splitPos+6);
801 std::string strNew = fullPhysVolInfoString.substr(splitPos+6,last-(splitPos+6));
802 int splitLevel = std::stoi(strNew);
803 for(
int i=0;
i<splitLevel;
i++){
804 std::string
field =
"eta_module";
805 std::pair<std::string,int> extraIndex(
field,
i);
◆ 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.
◆ makeSiStripBox()
void InDetDD::ITk::StripGmxInterface::makeSiStripBox |
( |
const std::string & |
typeName, |
|
|
const std::map< std::string, std::string > & |
parameters |
|
) |
| |
|
private |
Definition at line 125 of file StripGmxInterface.cxx.
133 double thickness{0.320};
141 std::string carrierString;
143 if (carrierString ==
"electrons") {
145 }
else if (carrierString ==
"holes") {
148 throw GaudiException(
"Parameter carrierType should be electrons or holes for " +
typeName,
149 "StripGmxInterface::makeSiStripBox", StatusCode::FAILURE);
152 std::string readoutSideString;
154 if (readoutSideString ==
"+") {
156 }
else if (readoutSideString ==
"-") {
159 throw GaudiException(
"Parameter readoutSide should be + or - for " +
typeName,
160 "StripGmxInterface::makeSiStripBox", StatusCode::FAILURE);
163 std::string fieldDirectionString;
165 if (fieldDirectionString ==
"x") {
167 }
else if (fieldDirectionString ==
"y") {
169 }
else if (fieldDirectionString ==
"z") {
172 throw GaudiException(
"Parameter fieldDirection should be x, y, or z for " +
typeName,
173 "StripGmxInterface::makeSiStripBox", StatusCode::FAILURE);
176 std::string stripDirectionString;
178 if (stripDirectionString ==
"x") {
180 }
else if (stripDirectionString ==
"y") {
182 }
else if (stripDirectionString ==
"z") {
185 throw GaudiException(
"Parameter stripDirection should be x, y, or z for " +
typeName,
186 "StripGmxInterface::makeSiStripBox", StatusCode::FAILURE);
198 int detectorTypeEnum = 0;
201 else ATH_MSG_WARNING(
"Non-strip barrel type set for strip box DetectorElement - is this intended?");
212 double initZShift =
length * (-
static_cast<double>(splitLevel) * 0.5 + 0.5);
217 auto motherDesign = std::make_unique<StripBoxDesign>(stripDirection,
228 for (
int i = 0;
i< splitLevel;
i++) {
229 for (
int side : {0,1}) {
231 double zShift =
sign * (initZShift + (
i *
length));
233 auto design = std::make_unique<StripBoxDesign>(stripDirection,
245 design->setMother(motherDesign.get());
246 motherDesign->addChildDesign(
i,design.get());
257 auto design = std::make_unique<StripBoxDesign>(stripDirection,
◆ makeStereoAnnulus()
void InDetDD::ITk::StripGmxInterface::makeStereoAnnulus |
( |
const std::string & |
typeName, |
|
|
const std::map< std::string, std::string > & |
parameters |
|
) |
| |
|
private |
Definition at line 275 of file StripGmxInterface.cxx.
285 double thickness{0.320};
286 double stereoAngle{0.020};
287 double centreR{500.};
290 std::vector<double> phiPitch;
291 std::vector<double> startR;
292 std::vector<double> endR;
295 std::string carrierString;
297 if (carrierString ==
"electrons") {
299 }
else if (carrierString ==
"holes") {
302 throw GaudiException(
"Parameter carrierType should be electrons or holes for " +
typeName,
303 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
306 std::string readoutSideString;
308 if (readoutSideString ==
"+") {
310 }
else if (readoutSideString ==
"-") {
313 throw GaudiException(
"Parameter readoutSide should be + or - for " +
typeName,
314 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
317 std::string fieldDirectionString;
319 if (fieldDirectionString ==
"x") {
321 }
else if (fieldDirectionString ==
"y") {
323 }
else if (fieldDirectionString ==
"z") {
326 throw GaudiException(
"Parameter fieldDirection should be x, y, or z for " +
typeName,
327 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
330 std::string stripDirectionString;
332 if (stripDirectionString ==
"x") {
334 }
else if (stripDirectionString ==
"y") {
336 }
else if (stripDirectionString ==
"z") {
339 throw GaudiException(
"Parameter stripDirection should be x, y, or z for " +
typeName,
340 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
351 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
355 if (phiPitch.size() !=
static_cast<size_t>(
nRows)) {
357 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
361 if (startR.size() !=
static_cast<size_t>(
nRows)) {
363 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
367 if (endR.size() !=
static_cast<size_t>(
nRows)) {
369 "StripGmxInterface::makeStereoAnnulus", StatusCode::FAILURE);
378 int detectorTypeEnum = 0;
381 else ATH_MSG_WARNING(
"Non-strip endcap type set for strip annulus DetectorElement - is this intended?");
387 std::vector<int> singleRowStrips;
388 std::vector<double> singleRowPitch;
389 std::vector<double> singleRowMinR;
390 std::vector<double> singleRowMaxR;
395 auto motherDesign = std::make_unique<StripStereoAnnulusDesign>(stripDirection,
410 for (
int i = 0;
i < splitLevel;
i++) {
411 singleRowStrips.clear();
412 singleRowPitch.clear();
413 singleRowMinR.clear();
414 singleRowMaxR.clear();
416 singleRowStrips.push_back(
nStrips[
i]);
417 singleRowPitch.push_back(phiPitch[
i]);
418 singleRowMinR.push_back(startR[
i]);
419 singleRowMaxR.push_back(endR[
i]);
423 double thisCentreR = (singleRowMinR[0] + singleRowMaxR[0] ) *0.5;
425 auto design = std::make_unique<StripStereoAnnulusDesign>(stripDirection,
443 design->setMother(motherDesign.get());
444 motherDesign->addChildDesign(
i,design.get());
456 auto design = std::make_unique<StripStereoAnnulusDesign>(stripDirection,
◆ 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::ITk::StripGmxInterface::sensorId |
( |
std::map< std::string, int > & |
index | ) |
const |
|
finaloverridevirtual |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ splitSensorId()
int InDetDD::ITk::StripGmxInterface::splitSensorId |
( |
std::map< std::string, int > & |
index, |
|
|
std::pair< std::string, int > & |
extraIndex, |
|
|
std::map< std::string, int > & |
updatedIndex |
|
) |
| const |
|
finaloverridevirtual |
Definition at line 70 of file StripGmxInterface.cxx.
77 if (extraIndex.first !=
"eta_module") {
79 <<
index[
"eta_module"] <<
" " <<
index[
"phi_module"] <<
" " <<
index[
"side"]);
81 ATH_MSG_FATAL(
"Only splitting of eta_module supported for ITk strips!!!");
87 updatedIndex[extraIndex.first] += extraIndex.second;
90 index[
"barrel_endcap"],
92 index[
"eta_module"] + extraIndex.second,
97 <<
index[
"eta_module"] + extraIndex.second <<
" " <<
index[
"phi_module"] <<
" " <<
index[
"side"]);
98 ATH_MSG_DEBUG(
"hitIdOfWafer = " << std::hex << hitIdOfWafer << std::dec);
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_commonItems
◆ m_detectorManager
◆ m_geometryMap
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_motherMap
◆ 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 |
◆ m_waferTree
WaferTree* InDetDD::ITk::StripGmxInterface::m_waferTree {} |
|
private |
The documentation for this class was generated from the following files:
void addMotherDesign(std::unique_ptr< const SCT_ModuleSideDesign > &&)
std::atomic< MSG::Level > m_lvl
Current logging level.
std::map< std::string, const SiDetectorDesign * > m_geometryMap
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
void makeStereoAnnulus(const std::string &typeName, const std::map< std::string, std::string > ¶meters)
const SiDetectorDesign * addDesign(std::unique_ptr< const SiDetectorDesign > &&)
Access to module design; returns an observer pointer.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
std::vector< T > getParameter(const std::string &varName, const std::vector< std::string > &buffer)
void makeSiStripBox(const std::string &typeName, const std::map< std::string, std::string > ¶meters)
AthMessaging()
Default constructor:
std::map< std::string, const SCT_ModuleSideDesign * > m_motherMap
bool add(int bec, int ld, int eta, int phi, int side, Wafer &wafer, std::string &errorMessage)
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
virtual int splitSensorId(std::map< std::string, int > &index, std::pair< std::string, int > &extraIndex, std::map< std::string, int > &updatedIndex) const override final
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
MsgStream & msg() const
The standard message stream.
bool is_valid() const
Check if id is in a valid state.
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
std::string to_string(const DetectorType &type)
SCT_DetectorManager * m_detectorManager
void addSplitSensor(const std::string &typeName, std::map< std::string, int > &index, std::pair< std::string, int > &extraIndex, int sequentialId, GeoVFullPhysVol *fpv, int splitLevel) override final
#define ATH_MSG_WARNING(x)
void addSensor(const std::string &typeName, std::map< std::string, int > &index, int sequentialId, GeoVFullPhysVol *fpv) override final
SiCommonItems * m_commonItems
virtual void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *xf, const GeoVFullPhysVol *child)
Add alignable transforms. No access to these, they will be changed by manager:
std::string m_nm
Message source name.
virtual void addDetectorElement(SiDetectorElement *element) override
Add elememts during construction.
static const SiHitIdHelper * GetHelper()
unsigned constexpr int nRows
void initMessaging() const
Initialize our message level and MessageSvc.
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)