ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::TrackingVolumesSvc Class Reference

#include <TrackingVolumesSvc.h>

Inheritance diagram for Trk::TrackingVolumesSvc:
Collaboration diagram for Trk::TrackingVolumesSvc:

Public Member Functions

virtual StatusCode initialize () override
 Initialize Service. More...
 
virtual StatusCode finalize () override
 Finalize Service. More...
 
virtual const Trk::Volumevolume (const TrackingVolumeIdentifier &volumeId) const override
 Provide the TrackingVolumes. More...
 
virtual const std::string & volumeName (const TrackingVolumeIdentifier &volumeId) const override
 Returns the name of the TrackingVolumes built with this Svc. More...
 
 TrackingVolumesSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor. More...
 
virtual ~TrackingVolumesSvc ()
 Standard Destructor. More...
 

Private Attributes

ServiceHandle< StoreGateSvcm_pDetStore
 the cached volumes More...
 
std::vector< const Trk::Volume * > m_volumes
 
std::vector< std::string > m_volumeNames
 the names of the TrackingVolumes More...
 

Detailed Description

Definition at line 39 of file TrackingVolumesSvc.h.

Constructor & Destructor Documentation

◆ TrackingVolumesSvc()

Trk::TrackingVolumesSvc::TrackingVolumesSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Standard Constructor.

Constructor.

Definition at line 24 of file TrackingVolumesSvc.cxx.

24  :
25  base_class(a_name,svc),
26  m_pDetStore("DetectorStore",name())
27 {
30 
31  //set defaults
32  m_volumeNames.emplace_back("CalorimeterEntryLayer");
33  m_volumeNames.emplace_back("MuonSpectrometerEntryLayer");
34  m_volumeNames.emplace_back("MuonSpectrometerExitLayer");
35 
36  // For the moment, assuming volumes are at 0,0,0 and perfectly aligned (i.e. passing 0)
37  // Adding values by hand - this should be changed (i.e. retrieved from a database?)
38  // EJWM
39 
41  = new Trk::Volume(nullptr, new Trk::CylinderVolumeBounds(1100.0, 3200.0));
43  = new Trk::Volume(nullptr, new Trk::CylinderVolumeBounds(4250.0, 6779.0));
45  = new Trk::Volume(nullptr, new Trk::CylinderVolumeBounds(15000.0, 21000.0)); // FIXME! Put in correct values. EJWM
46 
47  // the name of the TrackingVolume to be built --------------------------------
48  //declareProperty( "VolumeNames", m_volumeNames, "The names of the TrackingVolume to be built");
49  // EJWM - no point configuring this if the volume dimensions can't be configured. EJWM.
50 
51 }

◆ ~TrackingVolumesSvc()

Trk::TrackingVolumesSvc::~TrackingVolumesSvc ( )
virtualdefault

Standard Destructor.

Destructor.

Member Function Documentation

◆ finalize()

StatusCode Trk::TrackingVolumesSvc::finalize ( )
overridevirtual

Finalize Service.

Definition at line 84 of file TrackingVolumesSvc.cxx.

85 {
86  ATH_MSG_INFO ( "finalize() successful." );
87  return StatusCode::SUCCESS;
88 }

◆ initialize()

StatusCode Trk::TrackingVolumesSvc::initialize ( )
overridevirtual

Initialize Service.

Definition at line 59 of file TrackingVolumesSvc.cxx.

60 {
62 
63  // get the DetectorStore
64  ATH_CHECK( m_pDetStore.retrieve() );
65 
66  // record the volumes
67  for (unsigned int id=0 ; id!=ITrackingVolumesSvc::NumIdentifiers; id++){
68  // create Volume.
70  if (result.isFailure()){
71  ATH_MSG_FATAL ( "Couldn't write Volume "<<m_volumeNames[id]<<" to DetectorStore." );
72  return result;
73  } else {
74  ATH_MSG_INFO ( "initialize() successful: TrackingVolume '" << m_volumeNames[id] << "' built and written to DetectorStore." );
75  }
76  }
77 
78  ATH_MSG_INFO ( "initialize() successful! " );
79 
80  return StatusCode::SUCCESS;
81 }

◆ volume()

const Trk::Volume & Trk::TrackingVolumesSvc::volume ( const TrackingVolumeIdentifier &  volumeId) const
inlineoverridevirtual

Provide the TrackingVolumes.

Definition at line 71 of file TrackingVolumesSvc.h.

72  { return *(m_volumes[volumeId]); }

◆ volumeName()

const std::string & Trk::TrackingVolumesSvc::volumeName ( const TrackingVolumeIdentifier &  volumeId) const
inlineoverridevirtual

Returns the name of the TrackingVolumes built with this Svc.

Definition at line 74 of file TrackingVolumesSvc.h.

75  { return m_volumeNames[volumeId]; }

Member Data Documentation

◆ m_pDetStore

ServiceHandle<StoreGateSvc> Trk::TrackingVolumesSvc::m_pDetStore
private

the cached volumes

Definition at line 61 of file TrackingVolumesSvc.h.

◆ m_volumeNames

std::vector<std::string > Trk::TrackingVolumesSvc::m_volumeNames
private

the names of the TrackingVolumes

Definition at line 66 of file TrackingVolumesSvc.h.

◆ m_volumes

std::vector<const Trk::Volume*> Trk::TrackingVolumesSvc::m_volumes
private

Definition at line 64 of file TrackingVolumesSvc.h.


The documentation for this class was generated from the following files:
Trk::TrackingVolumesSvc::m_volumeNames
std::vector< std::string > m_volumeNames
the names of the TrackingVolumes
Definition: TrackingVolumesSvc.h:66
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
get_generator_info.result
result
Definition: get_generator_info.py:21
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
initialize
void initialize()
Definition: run_EoverP.cxx:894
Trk::ITrackingVolumesSvc::MuonSpectrometerEntryLayer
@ MuonSpectrometerEntryLayer
Tracking Volume which defines the entrance surfaces of the MS.
Definition: ITrackingVolumesSvc.h:41
Trk::ITrackingVolumesSvc::NumIdentifiers
@ NumIdentifiers
Definition: ITrackingVolumesSvc.h:43
Trk::TrackingVolumesSvc::m_volumes
std::vector< const Trk::Volume * > m_volumes
Definition: TrackingVolumesSvc.h:64
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
Trk::ITrackingVolumesSvc::CalorimeterEntryLayer
@ CalorimeterEntryLayer
Tracking Volume which defines the entrance srufaces of the calorimeter.
Definition: ITrackingVolumesSvc.h:40
Trk::CylinderVolumeBounds
Definition: CylinderVolumeBounds.h:70
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::TrackingVolumesSvc::m_pDetStore
ServiceHandle< StoreGateSvc > m_pDetStore
the cached volumes
Definition: TrackingVolumesSvc.h:61
Trk::Volume
Definition: Volume.h:35
Trk::ITrackingVolumesSvc::MuonSpectrometerExitLayer
@ MuonSpectrometerExitLayer
Tracking Volume which defines the outer surfaces of the MS.
Definition: ITrackingVolumesSvc.h:42