ATLAS Offline Software
TrackingVolumesSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackingVolumesSvc.h, (c) ATLAS Detector software
8 
9 #ifndef TRKDETDESCRINTERFACES_TRACKINGVOLUMESSERVICE_H
10 #define TRKDETDESCRINTERFACES_TRACKINGVOLUMESSERVICE_H
11 
14 #include "GaudiKernel/ToolHandle.h"
15 #include "GaudiKernel/ServiceHandle.h"
18 #include <string>
19 #include <vector>
20 
21 class StoreGateSvc;
22 class ISvcLocator;
23 
24 template <class TYPE> class SvcFactory;
25 
26 
27 namespace Trk {
28 
29  class Volume;
30 
31 
39  class TrackingVolumesSvc : public extends<AthService, ITrackingVolumesSvc> {
40 
41  public:
42 
43  virtual StatusCode initialize() override;
44  virtual StatusCode finalize() override;
45 
47  virtual const Trk::Volume& volume(const TrackingVolumeIdentifier& volumeId) const override;
48 
50  virtual const std::string& volumeName(const TrackingVolumeIdentifier& volumeId) const override;
51 
53  TrackingVolumesSvc(const std::string& name, ISvcLocator* svc);
54 
57 
58 
59  private:
60 
62 
64  std::vector<const Trk::Volume*> m_volumes;
66  std::vector<std::string > m_volumeNames;
67 
68  };
69 }
70 
72  { return *(m_volumes[volumeId]); }
73 
75  { return m_volumeNames[volumeId]; }
76 
77 #endif
78 
Trk::TrackingVolumesSvc::TrackingVolumesSvc
TrackingVolumesSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition: TrackingVolumesSvc.cxx:24
Trk::TrackingVolumesSvc::m_volumeNames
std::vector< std::string > m_volumeNames
the names of the TrackingVolumes
Definition: TrackingVolumesSvc.h:66
SvcFactory
Definition: AthCnvSvc.h:28
Trk::TrackingVolumesSvc::finalize
virtual StatusCode finalize() override
Finalize Service.
Definition: TrackingVolumesSvc.cxx:84
Trk::TrackingVolumesSvc::volume
virtual const Trk::Volume & volume(const TrackingVolumeIdentifier &volumeId) const override
Provide the TrackingVolumes.
Definition: TrackingVolumesSvc.h:71
Trk::TrackingVolumesSvc::m_volumes
std::vector< const Trk::Volume * > m_volumes
Definition: TrackingVolumesSvc.h:64
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
Trk::ITrackingVolumesSvc::TrackingVolumeIdentifier
TrackingVolumeIdentifier
Enum to identify the various "volumes" which exist.
Definition: ITrackingVolumesSvc.h:39
Trk::TrackingVolumesSvc::initialize
virtual StatusCode initialize() override
Initialize Service.
Definition: TrackingVolumesSvc.cxx:59
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
LayerIndex.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Trk::TrackingVolumesSvc::~TrackingVolumesSvc
virtual ~TrackingVolumesSvc()
Standard Destructor.
Trk::TrackingVolumesSvc::volumeName
virtual const std::string & volumeName(const TrackingVolumeIdentifier &volumeId) const override
Returns the name of the TrackingVolumes built with this Svc.
Definition: TrackingVolumesSvc.h:74
Trk::TrackingVolumesSvc
Definition: TrackingVolumesSvc.h:39
Trk::TrackingVolumesSvc::m_pDetStore
ServiceHandle< StoreGateSvc > m_pDetStore
the cached volumes
Definition: TrackingVolumesSvc.h:61
AthService.h
IOVSvcDefs.h
defines and typedefs for IOVSvc
Trk::Volume
Definition: Volume.h:35
ITrackingVolumesSvc.h
ServiceHandle< StoreGateSvc >