ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
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"}
 
ToolHandle< ITRT_StrawStatusSummaryToolm_sumTool {"TRT_StrawStatusSummaryTool", this}
 
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 23 of file TRT_DetectorTool.cxx.

25 {
26 }

◆ ~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 243 of file TRT_DetectorTool.cxx.

244 {
246  if(proxy) {
247  proxy->reset();
248  m_manager = nullptr;
249  }
250  return StatusCode::SUCCESS;
251 }

◆ create()

StatusCode TRT_DetectorTool::create ( )
finaloverridevirtual

Definition at line 30 of file TRT_DetectorTool.cxx.

31 {
32  // Get the detector configuration.
33  ATH_CHECK( m_geoDbTagSvc.retrieve());
34 
35  // Get the straw status tool
36  ATH_CHECK(m_sumTool.retrieve());
37 
38  ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(),name());
39  ATH_CHECK( accessSvc.retrieve());
40 
41  // Locate the top level experiment node
42  GeoModelExperiment* theExpt{nullptr};
43  ATH_CHECK(detStore()->retrieve(theExpt,"ATLAS"));
44  GeoPhysVol *world = theExpt->getPhysVol();
45 
46  // Retrieve the Geometry DB Interface
47  ATH_CHECK( m_geometryDBSvc.retrieve() );
48 
49  // Pass athena services to factory, etc
50  m_athenaComps.setDetStore(detStore().operator->());
52  m_athenaComps.setRDBAccessSvc(accessSvc.get());
54 
55  GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
56  //
57  // If we are using the SQLite reader, then we are not building the raw geometry but
58  // just locating it and attaching to readout geometry and various other actions
59  // taken in this factory.
60  //
61  if (sqliteReader) {
62  ATH_MSG_INFO( " Building TRT geometry from GeoModel factory TRTDetectorFactory_Lite" );
63  TRTDetectorFactory_Lite theTRTFactory(sqliteReader,
65  m_sumTool.get(),
70  );
71 
72  theTRTFactory.create(world);
73  m_manager=theTRTFactory.getDetectorManager();
74  }
75  else {
76  DecodeVersionKey versionKey(m_geoDbTagSvc.get(), "TRT");
77 
78  ATH_MSG_INFO( "Building TRT with Version Tag: "<< versionKey.tag() << " at Node: " << versionKey.node() );
79 
80  // Print the TRT version tag:
81  std::string trtVersionTag = accessSvc->getChildTag("TRT", versionKey.tag(), versionKey.node());
82  ATH_MSG_INFO("TRT Version: " << trtVersionTag );
83 
84  // Check if version is empty. If so, then the TRT cannot be built. This may or may not be intentional. We
85  // just issue an INFO message.
86  if (trtVersionTag.empty()) {
87  ATH_MSG_INFO("No TRT Version. TRT will not be built." );
88  return StatusCode::SUCCESS;
89  }
90 
91  ATH_MSG_DEBUG( "Keys for TRT Switches are " << versionKey.tag() << " " << versionKey.node() );
92  IRDBRecordset_ptr switchSet = accessSvc->getRecordsetPtr("TRTSwitches", versionKey.tag(), versionKey.node());
93  const IRDBRecord *switches = (*switchSet)[0];
94 
95  if (switches->getInt("DC1COMPATIBLE")) {
96  ATH_MSG_ERROR( "DC1COMPATIBLE flag set in database, but DC1 is no longer supported in the code!!");
97  return StatusCode::FAILURE;
98  }
99 
100  m_DC2CompatibleBarrelCoordinates = switches->getInt("DC2COMPATIBLE");
101  m_useOldActiveGasMixture = ( switches->getInt("GASVERSION") == 0 );
102  m_initialLayout = switches->getInt("INITIALLAYOUT");
103 
104  // Check if the new switches exists:
106  if ( switches->getInt("DOARGONMIXTURE") == 0) { m_doArgonMixture = false; }
107  else if ( switches->getInt("DOARGONMIXTURE") == 1) { m_doArgonMixture = true; }
108 
109  if ( switches->getInt("DOKRYPTONMIXTURE") == 0) { m_doKryptonMixture = false; }
110  else if ( switches->getInt("DOKRYPTONMIXTURE") == 1) { m_doKryptonMixture = true; }
111  }
112 
113  ATH_MSG_INFO( "Creating the TRT" );
114  ATH_MSG_INFO( "TRT Geometry Options:" << std::boolalpha );
115  ATH_MSG_INFO( " UseOldActiveGasMixture = " << m_useOldActiveGasMixture );
116  ATH_MSG_INFO( " Do Argon = " << m_doArgonMixture );
117  ATH_MSG_INFO( " Do Krypton = " << m_doKryptonMixture );
118  ATH_MSG_INFO( " DC2CompatibleBarrelCoordinates = " << m_DC2CompatibleBarrelCoordinates );
119  ATH_MSG_INFO( " InitialLayout = " << m_initialLayout );
120  ATH_MSG_INFO( " Alignable = " << m_alignable );
121  ATH_MSG_INFO( " VersioName = " << switches->getString("VERSIONNAME") );
122 
123  ATH_MSG_INFO( " Building TRT geometry from GeoModel factory TRTDetectorFactory_Full" );
124 
125  TRTDetectorFactory_Full theTRTFactory(&m_athenaComps,
126  m_sumTool.get(),
129  m_alignable,
133  );
134  theTRTFactory.create(world);
135  m_manager=theTRTFactory.getDetectorManager();
136 
137  }
138 
139  // Register the TRTDetectorNode instance with the Transient Detector Store
140  if (!m_manager) return StatusCode::FAILURE;
141 
142  theExpt->addManager(m_manager);
143  ATH_CHECK(detStore()->record(m_manager,m_manager->getName()));
144  return StatusCode::SUCCESS;
145 }

◆ manager() [1/2]

virtual GeoVDetectorManager* GeoModelTool::manager ( )
inlinevirtualinherited

Definition at line 22 of file GeoModelTool.h.

22 {return 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.

◆ m_athenaComps

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

Definition at line 58 of file TRT_DetectorTool.h.

◆ m_DC2CompatibleBarrelCoordinates

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

Definition at line 44 of file TRT_DetectorTool.h.

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector {nullptr}
protectedinherited

Definition at line 30 of file GeoModelTool.h.

◆ m_doArgonMixture

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

Definition at line 49 of file TRT_DetectorTool.h.

◆ m_doKryptonMixture

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

Definition at line 51 of file TRT_DetectorTool.h.

◆ m_geoDbTagSvc

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

Definition at line 53 of file TRT_DetectorTool.h.

◆ m_geometryDBSvc

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

Definition at line 54 of file TRT_DetectorTool.h.

◆ m_initialLayout

bool TRT_DetectorTool::m_initialLayout {true}
private

Definition at line 59 of file TRT_DetectorTool.h.

◆ m_manager

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

Definition at line 57 of file TRT_DetectorTool.h.

◆ m_sumTool

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

Definition at line 55 of file TRT_DetectorTool.h.

◆ m_useDynamicAlignFolders

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

Definition at line 46 of file TRT_DetectorTool.h.

◆ m_useOldActiveGasMixture

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

Definition at line 43 of file TRT_DetectorTool.h.


The documentation for this class was generated from the following files:
IRDBRecord::getInt
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
IRDBRecord::getString
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
GeoModelExperiment
Definition: GeoModelExperiment.h:32
TRT_DetectorTool::m_alignable
Gaudi::Property< bool > m_alignable
Definition: TRT_DetectorTool.h:45
TRT_DetectorTool::m_manager
const InDetDD::TRT_DetectorManager * m_manager
Definition: TRT_DetectorTool.h:57
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
InDetDD::AthenaComps::setGeoDbTagSvc
void setGeoDbTagSvc(IGeoDbTagSvc *)
Definition: InDetDDAthenaComps.cxx:22
InDetDD::AthenaComps::setDetStore
void setDetStore(StoreGateSvc *)
Definition: InDetDDAthenaComps.cxx:17
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT_DetectorTool::m_DC2CompatibleBarrelCoordinates
Gaudi::Property< bool > m_DC2CompatibleBarrelCoordinates
Definition: TRT_DetectorTool.h:44
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GeoModelTool
Definition: GeoModelTool.h:16
InDetDD::AthenaComps::setRDBAccessSvc
void setRDBAccessSvc(IRDBAccessSvc *)
Definition: InDetDDAthenaComps.cxx:27
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRT_DetectorTool::m_athenaComps
InDetDD::AthenaComps m_athenaComps
Definition: TRT_DetectorTool.h:58
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
TRT_DetectorTool::m_initialLayout
bool m_initialLayout
Definition: TRT_DetectorTool.h:59
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition: GeoModelTool.h:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
InDetDD::AthenaComps::setGeometryDBSvc
void setGeometryDBSvc(IGeometryDBSvc *)
Definition: InDetDDAthenaComps.cxx:32
TRT_DetectorTool::m_doKryptonMixture
Gaudi::Property< bool > m_doKryptonMixture
Definition: TRT_DetectorTool.h:51
TRT_DetectorTool::m_useOldActiveGasMixture
Gaudi::Property< bool > m_useOldActiveGasMixture
Definition: TRT_DetectorTool.h:43
TRT_DetectorTool::m_doArgonMixture
Gaudi::Property< bool > m_doArgonMixture
Definition: TRT_DetectorTool.h:49
TRT_DetectorTool::m_sumTool
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
Definition: TRT_DetectorTool.h:55
TRTDetectorFactory_Lite
Definition: TRTDetectorFactory_Lite.h:28
TRT_DetectorTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: TRT_DetectorTool.h:53
TRT_DetectorTool::m_useDynamicAlignFolders
Gaudi::Property< bool > m_useDynamicAlignFolders
Definition: TRT_DetectorTool.h:46
TRTDetectorFactory_Full
This class creates the TRT Geometry.
Definition: TRTDetectorFactory_Full.h:30
SG::DataProxy
Definition: DataProxy.h:45
TRT_DetectorTool::m_geometryDBSvc
ServiceHandle< IGeometryDBSvc > m_geometryDBSvc
Definition: TRT_DetectorTool.h:54
ServiceHandle< IRDBAccessSvc >