ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_DetectorTool Class Referencefinal

#include <TRT_DetectorTool.h>

Inheritance diagram for TRT_DetectorTool:
Collaboration diagram for TRT_DetectorTool:

Public Member Functions

 TRT_DetectorTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TRT_DetectorTool ()=default
virtual StatusCode create () override final
virtual StatusCode clear () override final
virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final
virtual StatusCode align ATLAS_NOT_THREAD_SAFE (IOVSVC_CALLBACK_ARGS) override final
virtual GeoVDetectorManager * manager ()
virtual const GeoVDetectorManager * manager () const

Protected Attributes

GeoVDetectorManager * m_detector {nullptr}

Private Attributes

Gaudi::Property< bool > m_useOldActiveGasMixture {this,"UseOldActiveGasMixture",false}
Gaudi::Property< bool > m_DC2CompatibleBarrelCoordinates {this,"DC2CompatibleBarrelCoordinates",false}
Gaudi::Property< bool > m_alignable {this,"Alignable",true}
Gaudi::Property< bool > m_useDynamicAlignFolders {this,"useDynamicAlignFolders",false}
Gaudi::Property< bool > m_doArgonMixture {this,"DoXenonArgonMixture",true}
Gaudi::Property< bool > m_doKryptonMixture {this,"DoKryptonMixture",true}
ServiceHandle< IGeoDbTagSvcm_geoDbTagSvc {this,"GeoDbTagSvc","GeoDbTagSvc"}
ServiceHandle< IGeometryDBSvcm_geometryDBSvc {this,"GeometryDBSvc","InDetGeometryDBSvc"}
Gaudi::Property< bool > m_dumpStrawStatus {this, "DumpStrawStatus", false}
Gaudi::Property< std::string > m_strawStatusFile {this, "StrawStatusFile", ""}
ToolHandle< ITRT_StrawStatusSummaryToolm_sumTool {this, "SummaryTool", ""}
const InDetDD::TRT_DetectorManagerm_manager {nullptr}
InDetDD::AthenaComps m_athenaComps {"TRT_GeoModel"}
bool m_initialLayout {true}

Detailed Description

Definition at line 24 of file TRT_DetectorTool.h.

Constructor & Destructor Documentation

◆ TRT_DetectorTool()

TRT_DetectorTool::TRT_DetectorTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 25 of file TRT_DetectorTool.cxx.

26 : GeoModelTool( type, name, parent )
27{
28}

◆ ~TRT_DetectorTool()

virtual TRT_DetectorTool::~TRT_DetectorTool ( )
virtualdefault

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/2]

virtual StatusCode registerCallback TRT_DetectorTool::ATLAS_NOT_THREAD_SAFE ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

◆ ATLAS_NOT_THREAD_SAFE() [2/2]

virtual StatusCode align TRT_DetectorTool::ATLAS_NOT_THREAD_SAFE ( IOVSVC_CALLBACK_ARGS )
finaloverridevirtual

Reimplemented from GeoModelTool.

◆ clear()

StatusCode TRT_DetectorTool::clear ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 257 of file TRT_DetectorTool.cxx.

258{
259 SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<InDetDD::TRT_DetectorManager>::ID(),m_manager->getName());
260 if(proxy) {
261 proxy->reset();
262 m_manager = nullptr;
263 }
264 return StatusCode::SUCCESS;
265}
const InDetDD::TRT_DetectorManager * m_manager

◆ create()

StatusCode TRT_DetectorTool::create ( )
finaloverridevirtual

Definition at line 32 of file TRT_DetectorTool.cxx.

33{
34 // Get the detector configuration.
35 ATH_CHECK( m_geoDbTagSvc.retrieve());
36
37 ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(),name());
38 ATH_CHECK( accessSvc.retrieve());
39
40 // Locate the top level experiment node
41 GeoModelExperiment* theExpt{nullptr};
42 ATH_CHECK(detStore()->retrieve(theExpt,"ATLAS"));
43 GeoPhysVol *world = theExpt->getPhysVol();
44
45 // Retrieve the Geometry DB Interface
46 ATH_CHECK( m_geometryDBSvc.retrieve() );
47
48 // Pass athena services to factory, etc
49 m_athenaComps.setDetStore(detStore().operator->());
50 m_athenaComps.setGeoDbTagSvc(m_geoDbTagSvc.get());
51 m_athenaComps.setRDBAccessSvc(accessSvc.get());
52 m_athenaComps.setGeometryDBSvc(m_geometryDBSvc.get());
53
54 std::unique_ptr<TRTStrawStatusAccessor> strawStatusAccessor;
55 ATH_CHECK(m_sumTool.retrieve(DisableTool{ !m_dumpStrawStatus }));
57 // Read Straw Statuses from the ASCII file
58 strawStatusAccessor = std::make_unique<TRTStrawStatusAccessor>();
59 const std::string strawStatusPath = PathResolverFindCalibFile(m_strawStatusFile);
60 if (strawStatusPath.empty()) {
61 ATH_MSG_ERROR("Failed to resolve path for StrawStatusFile: " << m_strawStatusFile << ", the job will fail now.");
62 return StatusCode::FAILURE;
63 }
64 ATH_MSG_VERBOSE("StrawStatusFile: " << m_strawStatusFile << ", resolved path: " << strawStatusPath);
65 strawStatusAccessor->fill(strawStatusPath);
66 }
67
68 GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
69 //
70 // If we are using the SQLite reader, then we are not building the raw geometry but
71 // just locating it and attaching to readout geometry and various other actions
72 // taken in this factory.
73 //
74 if (sqliteReader) {
75 ATH_MSG_INFO( " Building TRT geometry from GeoModel factory TRTDetectorFactory_Lite" );
76 TRTDetectorFactory_Lite theTRTFactory(sqliteReader,
78 std::move(strawStatusAccessor),
83 );
84
85 theTRTFactory.create(world);
86 m_manager=theTRTFactory.getDetectorManager();
87 }
88 else {
89 DecodeVersionKey versionKey(m_geoDbTagSvc.get(), "TRT");
90
91 ATH_MSG_INFO( "Building TRT with Version Tag: "<< versionKey.tag() << " at Node: " << versionKey.node() );
92
93 // Print the TRT version tag:
94 std::string trtVersionTag = accessSvc->getChildTag("TRT", versionKey.tag(), versionKey.node());
95 ATH_MSG_INFO("TRT Version: " << trtVersionTag );
96
97 // Check if version is empty. If so, then the TRT cannot be built. This may or may not be intentional. We
98 // just issue an INFO message.
99 if (trtVersionTag.empty()) {
100 ATH_MSG_INFO("No TRT Version. TRT will not be built." );
101 return StatusCode::SUCCESS;
102 }
103
104 ATH_MSG_DEBUG( "Keys for TRT Switches are " << versionKey.tag() << " " << versionKey.node() );
105 IRDBRecordset_ptr switchSet = accessSvc->getRecordsetPtr("TRTSwitches", versionKey.tag(), versionKey.node());
106 const IRDBRecord *switches = (*switchSet)[0];
107
108 if (switches->getInt("DC1COMPATIBLE")) {
109 ATH_MSG_ERROR( "DC1COMPATIBLE flag set in database, but DC1 is no longer supported in the code!!");
110 return StatusCode::FAILURE;
111 }
112
113 m_DC2CompatibleBarrelCoordinates = switches->getInt("DC2COMPATIBLE");
114 m_useOldActiveGasMixture = ( switches->getInt("GASVERSION") == 0 );
115 m_initialLayout = switches->getInt("INITIALLAYOUT");
116
117 // Check if the new switches exists:
119 if ( switches->getInt("DOARGONMIXTURE") == 0) { m_doArgonMixture = false; }
120 else if ( switches->getInt("DOARGONMIXTURE") == 1) { m_doArgonMixture = true; }
121
122 if ( switches->getInt("DOKRYPTONMIXTURE") == 0) { m_doKryptonMixture = false; }
123 else if ( switches->getInt("DOKRYPTONMIXTURE") == 1) { m_doKryptonMixture = true; }
124 }
125
126 ATH_MSG_INFO( "Creating the TRT" );
127 ATH_MSG_INFO( "TRT Geometry Options:" << std::boolalpha );
128 ATH_MSG_INFO( " UseOldActiveGasMixture = " << m_useOldActiveGasMixture );
129 ATH_MSG_INFO( " Do Argon = " << m_doArgonMixture );
130 ATH_MSG_INFO( " Do Krypton = " << m_doKryptonMixture );
131 ATH_MSG_INFO( " DC2CompatibleBarrelCoordinates = " << m_DC2CompatibleBarrelCoordinates );
132 ATH_MSG_INFO( " InitialLayout = " << m_initialLayout );
133 ATH_MSG_INFO( " Alignable = " << m_alignable );
134 ATH_MSG_INFO( " VersioName = " << switches->getString("VERSIONNAME") );
135
136 ATH_MSG_INFO( " Building TRT geometry from GeoModel factory TRTDetectorFactory_Full" );
137
138 TRTDetectorFactory_Full theTRTFactory(&m_athenaComps,
139 m_dumpStrawStatus ? m_sumTool.get() : nullptr,
140 std::move(strawStatusAccessor),
147 );
148 theTRTFactory.create(world);
149 m_manager=theTRTFactory.getDetectorManager();
150
151 }
152
153 // Register the TRTDetectorNode instance with the Transient Detector Store
154 if (!m_manager) return StatusCode::FAILURE;
155
156 theExpt->addManager(m_manager);
157 ATH_CHECK(detStore()->record(m_manager,m_manager->getName()));
158 return StatusCode::SUCCESS;
159}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
InDetDD::AthenaComps m_athenaComps
Gaudi::Property< bool > m_dumpStrawStatus
Gaudi::Property< bool > m_useOldActiveGasMixture
Gaudi::Property< bool > m_DC2CompatibleBarrelCoordinates
Gaudi::Property< bool > m_doArgonMixture
Gaudi::Property< bool > m_doKryptonMixture
Gaudi::Property< bool > m_alignable
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
Gaudi::Property< std::string > m_strawStatusFile
Gaudi::Property< bool > m_useDynamicAlignFolders
ServiceHandle< IGeometryDBSvc > m_geometryDBSvc
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ manager() [1/2]

virtual GeoVDetectorManager * GeoModelTool::manager ( )
inlinevirtualinherited

Definition at line 22 of file GeoModelTool.h.

22{return m_detector;}
GeoVDetectorManager * m_detector

◆ manager() [2/2]

virtual const GeoVDetectorManager * GeoModelTool::manager ( ) const
inlinevirtualinherited

Definition at line 23 of file GeoModelTool.h.

23{return m_detector;}

Member Data Documentation

◆ m_alignable

Gaudi::Property<bool> TRT_DetectorTool::m_alignable {this,"Alignable",true}
private

Definition at line 45 of file TRT_DetectorTool.h.

45{this,"Alignable",true};

◆ m_athenaComps

InDetDD::AthenaComps TRT_DetectorTool::m_athenaComps {"TRT_GeoModel"}
private

Definition at line 61 of file TRT_DetectorTool.h.

61{"TRT_GeoModel"};

◆ m_DC2CompatibleBarrelCoordinates

Gaudi::Property<bool> TRT_DetectorTool::m_DC2CompatibleBarrelCoordinates {this,"DC2CompatibleBarrelCoordinates",false}
private

Definition at line 44 of file TRT_DetectorTool.h.

44{this,"DC2CompatibleBarrelCoordinates",false};

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector {nullptr}
protectedinherited

Definition at line 30 of file GeoModelTool.h.

30{nullptr};

◆ m_doArgonMixture

Gaudi::Property<bool> TRT_DetectorTool::m_doArgonMixture {this,"DoXenonArgonMixture",true}
private

Definition at line 49 of file TRT_DetectorTool.h.

49{this,"DoXenonArgonMixture",true};

◆ m_doKryptonMixture

Gaudi::Property<bool> TRT_DetectorTool::m_doKryptonMixture {this,"DoKryptonMixture",true}
private

Definition at line 51 of file TRT_DetectorTool.h.

51{this,"DoKryptonMixture",true};

◆ m_dumpStrawStatus

Gaudi::Property<bool> TRT_DetectorTool::m_dumpStrawStatus {this, "DumpStrawStatus", false}
private

Definition at line 56 of file TRT_DetectorTool.h.

56{this, "DumpStrawStatus", false};

◆ m_geoDbTagSvc

ServiceHandle< IGeoDbTagSvc > TRT_DetectorTool::m_geoDbTagSvc {this,"GeoDbTagSvc","GeoDbTagSvc"}
private

Definition at line 53 of file TRT_DetectorTool.h.

53{this,"GeoDbTagSvc","GeoDbTagSvc"};

◆ m_geometryDBSvc

ServiceHandle< IGeometryDBSvc > TRT_DetectorTool::m_geometryDBSvc {this,"GeometryDBSvc","InDetGeometryDBSvc"}
private

Definition at line 54 of file TRT_DetectorTool.h.

54{this,"GeometryDBSvc","InDetGeometryDBSvc"};

◆ m_initialLayout

bool TRT_DetectorTool::m_initialLayout {true}
private

Definition at line 62 of file TRT_DetectorTool.h.

62{true};

◆ m_manager

const InDetDD::TRT_DetectorManager* TRT_DetectorTool::m_manager {nullptr}
private

Definition at line 60 of file TRT_DetectorTool.h.

60{nullptr};

◆ m_strawStatusFile

Gaudi::Property<std::string> TRT_DetectorTool::m_strawStatusFile {this, "StrawStatusFile", ""}
private

Definition at line 57 of file TRT_DetectorTool.h.

57{this, "StrawStatusFile", ""};

◆ m_sumTool

ToolHandle<ITRT_StrawStatusSummaryTool> TRT_DetectorTool::m_sumTool {this, "SummaryTool", ""}
private

Definition at line 58 of file TRT_DetectorTool.h.

58{this, "SummaryTool", ""}; // added for Argon

◆ m_useDynamicAlignFolders

Gaudi::Property<bool> TRT_DetectorTool::m_useDynamicAlignFolders {this,"useDynamicAlignFolders",false}
private

Definition at line 46 of file TRT_DetectorTool.h.

46{this,"useDynamicAlignFolders",false};

◆ m_useOldActiveGasMixture

Gaudi::Property<bool> TRT_DetectorTool::m_useOldActiveGasMixture {this,"UseOldActiveGasMixture",false}
private

Definition at line 43 of file TRT_DetectorTool.h.

43{this,"UseOldActiveGasMixture",false};

The documentation for this class was generated from the following files: