ATLAS Offline Software
LArG4ShowerLibSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef G4SHOWERLIBSVC_G4SHOWERLIBSVC_H
7 #define G4SHOWERLIBSVC_G4SHOWERLIBSVC_H
8 
10 
12 #include "LArG4Code/EnergySpot.h"
13 #include "G4FastTrack.hh"
14 
15 #include "GaudiKernel/ServiceHandle.h"
16 
17 #include <string>
18 #include <vector>
19 #include <map>
20 
21 namespace ShowerLib {
22  class IShowerLib;
23  class ShowerLibStatistics;
24 }
25 
26 
41 class LArG4ShowerLibSvc: public extends<AthService, ILArG4ShowerLibSvc> {
42 
43 public:
44 
45  LArG4ShowerLibSvc(const std::string& name, ISvcLocator* svc);
46 
47  virtual ~LArG4ShowerLibSvc();
48 
49  virtual StatusCode initialize();
50  virtual StatusCode finalize();
51 
52  virtual bool checkLibrary(G4int particleCode, int detectorTag);
53 
55 #ifdef DEBUG_FrozenShowers
56  virtual std::vector<EnergySpot> getShower(const G4FastTrack& track, int detectorTag);
57 #else
58  virtual std::vector<EnergySpot> getShower(const G4FastTrack& track, int detectorTag) const;
59 #endif
60  virtual double getContainmentZ(const G4FastTrack& track, int detectorTag);
61  virtual double getContainmentR(const G4FastTrack& track, int detectorTag);
62 
63 private:
64 
66  const ShowerLib::IShowerLib* getShowerLib(G4int particleCode, int detectorTag) const;
67 
68  typedef std::map<int, const ShowerLib::IShowerLib*> libmap;
70  typedef std::map<const ShowerLib::IShowerLib*, ShowerLib::ShowerLibStatistics*> statmap;
72  std::map<int,std::string> m_locations;
73  std::map<std::string,int> m_detmap;
74 
75  StringArrayProperty m_fileNameList;
76 
77 };
78 
79 #endif // G4SHOWERLIBSVC_G4SHOWERLIBSVC_H
80 
LArG4ShowerLibSvc::LArG4ShowerLibSvc
LArG4ShowerLibSvc(const std::string &name, ISvcLocator *svc)
Definition: LArG4ShowerLibSvc.cxx:22
LArG4ShowerLibSvc::checkLibrary
virtual bool checkLibrary(G4int particleCode, int detectorTag)
Definition: LArG4ShowerLibSvc.cxx:155
LArG4ShowerLibSvc::getShowerLib
const ShowerLib::IShowerLib * getShowerLib(G4int particleCode, int detectorTag) const
get shower library from StoreGate by track (using current volume name)
Definition: LArG4ShowerLibSvc.cxx:140
LArG4ShowerLibSvc::~LArG4ShowerLibSvc
virtual ~LArG4ShowerLibSvc()
Definition: LArG4ShowerLibSvc.cxx:40
LArG4ShowerLibSvc::m_libraryMap
libmap m_libraryMap
mapping StoreGate key to handle in StoreGate
Definition: LArG4ShowerLibSvc.h:69
LArG4ShowerLibSvc::getContainmentR
virtual double getContainmentR(const G4FastTrack &track, int detectorTag)
Definition: LArG4ShowerLibSvc.cxx:245
LArG4ShowerLibSvc::statmap
std::map< const ShowerLib::IShowerLib *, ShowerLib::ShowerLibStatistics * > statmap
Definition: LArG4ShowerLibSvc.h:70
ILArG4ShowerLibSvc.h
LArG4ShowerLibSvc::m_detmap
std::map< std::string, int > m_detmap
Definition: LArG4ShowerLibSvc.h:73
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArG4ShowerLibSvc::m_locations
std::map< int, std::string > m_locations
Definition: LArG4ShowerLibSvc.h:72
LArG4ShowerLibSvc::m_statisticsMap
statmap m_statisticsMap
Definition: LArG4ShowerLibSvc.h:71
ShowerLib::IShowerLib
Class for shower library shower lib interface.
Definition: IShowerLib.h:40
LArG4ShowerLibSvc::libmap
std::map< int, const ShowerLib::IShowerLib * > libmap
Definition: LArG4ShowerLibSvc.h:68
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
LArG4ShowerLibSvc::getContainmentZ
virtual double getContainmentZ(const G4FastTrack &track, int detectorTag)
Definition: LArG4ShowerLibSvc.cxx:232
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArG4ShowerLibSvc::m_fileNameList
StringArrayProperty m_fileNameList
property, list of library files
Definition: LArG4ShowerLibSvc.h:75
EnergySpot.h
LArG4ShowerLibSvc::finalize
virtual StatusCode finalize()
Definition: LArG4ShowerLibSvc.cxx:115
LArG4ShowerLibSvc
Class for shower library service.
Definition: LArG4ShowerLibSvc.h:41
AthService.h
ShowerLib
Namespace for the ShowerLib related classes.
Definition: LArG4GenShowerLib.h:19
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
LArG4ShowerLibSvc::initialize
virtual StatusCode initialize()
Definition: LArG4ShowerLibSvc.cxx:44
LArG4ShowerLibSvc::getShower
virtual std::vector< EnergySpot > getShower(const G4FastTrack &track, int detectorTag) const
return list of energy depositions for given track (interface implementation)
Definition: LArG4ShowerLibSvc.cxx:173