ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
BeamPipeDetectorTool Class Referencefinal

#include <BeamPipeDetectorTool.h>

Inheritance diagram for BeamPipeDetectorTool:
Collaboration diagram for BeamPipeDetectorTool:

Public Member Functions

 BeamPipeDetectorTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~BeamPipeDetectorTool () override final
 
virtual StatusCode create () override final
 
virtual StatusCode clear () override final
 
virtual GeoVDetectorManager * manager ()
 The Detector Node corresponding to this tool. More...
 
virtual const GeoVDetectorManager * manager () const
 
virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override
 
virtual StatusCode align (IOVSVC_CALLBACK_ARGS) override
 

Protected Attributes

GeoVDetectorManager * m_detector
 

Private Attributes

const BeamPipeDetectorManagerm_manager
 
std::string m_mode
 

Detailed Description

Definition at line 11 of file BeamPipeDetectorTool.h.

Constructor & Destructor Documentation

◆ BeamPipeDetectorTool()

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

Definition at line 24 of file BeamPipeDetectorTool.cxx.

26  :
28  m_manager(0),
29  m_mode("BeamPipe")
30 {
31  declareProperty("BeamPipeMode", m_mode); //m_mode="BeamPipe" by default, setting m_mode="AssemblyBeamPipe" will trigger optimised implementation using assembly volume
32 }

◆ ~BeamPipeDetectorTool()

BeamPipeDetectorTool::~BeamPipeDetectorTool ( )
finaloverridevirtual

Definition at line 34 of file BeamPipeDetectorTool.cxx.

35 {
36 }

Member Function Documentation

◆ align()

StatusCode GeoModelTool::align ( IOVSVC_CALLBACK_ARGS  )
overridevirtualinherited

Reimplemented in ALFA_DetectorTool, HGTD_DetectorTool, TRT_DetectorTool, LArDetectorToolNV, PixelDetectorTool, and SCT_DetectorTool.

Definition at line 33 of file GeoModelTool.cxx.

34 {
35  return StatusCode::SUCCESS;
36 }

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode registerCallback GeoModelTool::ATLAS_NOT_THREAD_SAFE ( )
overridevirtualinherited

◆ clear()

StatusCode BeamPipeDetectorTool::clear ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 116 of file BeamPipeDetectorTool.cxx.

117 {
119  if(proxy) {
120  proxy->reset();
121  m_manager = 0;
122  }
123  return StatusCode::SUCCESS;
124 }

◆ create()

StatusCode BeamPipeDetectorTool::create ( )
finaloverridevirtual

Definition at line 39 of file BeamPipeDetectorTool.cxx.

40 {
41  MsgStream log(msgSvc(), name());
42 
43  log << MSG::INFO << "Building Beam Pipe" << endmsg;
44 
45  IGeoDbTagSvc *geoDbTag;
46  StatusCode sc = service ("GeoDbTagSvc",geoDbTag);
47  if (sc.isFailure()) {
48  log << MSG::FATAL << "Could not locate GeoDbTagSvc" << endmsg;
49  return StatusCode::FAILURE;
50  }
51 
52 
53  std::string atlasVersion = geoDbTag->atlasVersion();
54  if(atlasVersion == "AUTO")
55  atlasVersion = "ATLAS-00";
56  std::string versionNode = "ATLAS";
57 
58  GeoModelExperiment * theExpt;
59  if (StatusCode::SUCCESS != detStore()->retrieve( theExpt, "ATLAS" )) {
60  log << MSG::ERROR
61  << "Could not find GeoModelExperiment ATLAS"
62  << endmsg;
63  return (StatusCode::FAILURE);
64  }
65 
66  if ( 0 == m_detector )
67  {
68  GeoPhysVol *world=&*theExpt->getPhysVol();
69 
70 
71  ServiceHandle<IRDBAccessSvc> accessSvc(geoDbTag->getParamSvcName(),name());
72  ATH_CHECK( accessSvc.retrieve());
73 
74 
75  GeoModelIO::ReadGeoModel* sqliteReader = geoDbTag->getSqliteReader();
76  if (sqliteReader) {
77  BeamPipeDetectorFactory_Lite theBeamPipeFactory;
78  theBeamPipeFactory.create(world);
79  m_manager = theBeamPipeFactory.getDetectorManager();
80 
81  }
82  else {
83 
84 
85  // Check we have the beampipe and print its version
86  // Print the version tag:
87  std::string beampipeVersionTag;
88  beampipeVersionTag = accessSvc->getChildTag("BeamPipe", atlasVersion,versionNode);
89  log << MSG::DEBUG << "Beampipe Version: " << beampipeVersionTag << endmsg;
90 
91  if (beampipeVersionTag.empty()) {
92  log << MSG::INFO << "No BeamPipe Version. Beam pipe will not be built." << endmsg;
93  }
94  else {
95  BeamPipeDetectorFactory theBeamPipeFactory(detStore().operator->(),accessSvc.operator->());
96  theBeamPipeFactory.setTagNode(atlasVersion,versionNode,m_mode);
97  theBeamPipeFactory.create(world);
98 
99  m_manager = theBeamPipeFactory.getDetectorManager();
100  }
101  }
102 
103  if (m_manager) {
104  theExpt->addManager(m_manager);
105  sc = detStore()->record(m_manager,m_manager->getName());
106  if (sc.isFailure()) {
107  log << MSG::ERROR << "Could not register BeamPipe detector manager" << endmsg;
108  return (StatusCode::FAILURE);
109  }
110  return StatusCode::SUCCESS;
111  }
112  }
113  return StatusCode::FAILURE;
114 }

◆ manager() [1/2]

GeoVDetectorManager * GeoModelTool::manager ( )
virtualinherited

The Detector Node corresponding to this tool.

Definition at line 21 of file GeoModelTool.cxx.

21  {
22  return m_detector;
23 }

◆ manager() [2/2]

const GeoVDetectorManager * GeoModelTool::manager ( ) const
virtualinherited

Definition at line 24 of file GeoModelTool.cxx.

24  {
25  return m_detector;
26 }

Member Data Documentation

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector
protectedinherited

Definition at line 36 of file GeoModelTool.h.

◆ m_manager

const BeamPipeDetectorManager* BeamPipeDetectorTool::m_manager
private

Definition at line 24 of file BeamPipeDetectorTool.h.

◆ m_mode

std::string BeamPipeDetectorTool::m_mode
private

Definition at line 25 of file BeamPipeDetectorTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
BeamPipeDetectorFactory_Lite::getDetectorManager
virtual const BeamPipeDetectorManager * getDetectorManager() const override
Definition: BeamPipeDetectorFactory_Lite.cxx:28
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
GeoModelExperiment
Definition: GeoModelExperiment.h:32
GeoModelTool::GeoModelTool
GeoModelTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor(s)
Definition: GeoModelTool.cxx:12
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
BeamPipeDetectorFactory
Definition: BeamPipeDetectorFactory.h:19
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition: GeoModelTool.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
IGeoDbTagSvc::getParamSvcName
virtual const std::string & getParamSvcName() const =0
BeamPipeDetectorFactory_Lite::create
virtual void create(GeoPhysVol *world) override
Definition: BeamPipeDetectorFactory_Lite.cxx:18
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IGeoDbTagSvc::atlasVersion
virtual const std::string & atlasVersion() const =0
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
BeamPipeDetectorFactory_Lite
Definition: BeamPipeDetectorFactory_Lite.h:14
BeamPipeDetectorTool::m_mode
std::string m_mode
Definition: BeamPipeDetectorTool.h:25
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
BeamPipeDetectorTool::m_manager
const BeamPipeDetectorManager * m_manager
Definition: BeamPipeDetectorTool.h:24
SG::DataProxy
Definition: DataProxy.h:44
IGeoDbTagSvc::getSqliteReader
virtual GeoModelIO::ReadGeoModel * getSqliteReader()=0
ServiceHandle< IRDBAccessSvc >