ATLAS Offline Software
Loading...
Searching...
No Matches
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.
virtual StatusCode finalize () override
 Finalize Service.
virtual const Trk::Volumevolume (const TrackingVolumeIdentifier &volumeId) const override
 Provide the TrackingVolumes.
virtual const std::string & volumeName (const TrackingVolumeIdentifier &volumeId) const override
 Returns the name of the TrackingVolumes built with this Svc.
 TrackingVolumesSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor.
virtual ~TrackingVolumesSvc ()
 Standard Destructor.

Private Attributes

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

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{
28
29 //set defaults
31 m_volumeNames.emplace_back("CalorimeterEntryLayer");
32 m_volumeNames.emplace_back("MuonSpectrometerEntryLayer");
33 m_volumeNames.emplace_back("MuonSpectrometerExitLayer");
34
35 // For the moment, assuming volumes are at 0,0,0 and perfectly aligned (i.e. passing 0)
36 // Adding values by hand - this should be changed (i.e. retrieved from a database?)
37 // EJWM
38
41 = new Trk::Volume(nullptr, std::make_shared<Trk::CylinderVolumeBounds>(1100.0, 3200.0));
43 = new Trk::Volume(nullptr, std::make_shared<Trk::CylinderVolumeBounds>(4250.0, 6779.0));
45 = new Trk::Volume(nullptr, std::make_shared<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}
@ MuonSpectrometerExitLayer
Tracking Volume which defines the outer surfaces of the MS.
@ CalorimeterEntryLayer
Tracking Volume which defines the entrance srufaces of the calorimeter.
@ MuonSpectrometerEntryLayer
Tracking Volume which defines the entrance surfaces of the MS.
std::vector< std::string > m_volumeNames
the names of the TrackingVolumes
std::vector< const Trk::Volume * > m_volumes
ServiceHandle< StoreGateSvc > m_pDetStore
the cached volumes

◆ ~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}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode Trk::TrackingVolumesSvc::initialize ( )
overridevirtual

Initialize Service.

Definition at line 59 of file TrackingVolumesSvc.cxx.

60{
61 ATH_CHECK( AthService::initialize());
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ 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: