ATLAS Offline Software
MaterialStepRecorder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MaterialStepRecorder.h, (c) ATLAS Detector software
8 
9 #ifndef MaterialStepRecorder_H
10 #define MaterialStepRecorder_H
11 
18 #include <vector>
19 
20 #include "StoreGate/StoreGateSvc.h"
21 #include "GaudiKernel/ServiceHandle.h"
22 
24 
25 #include "G4UserEventAction.hh"
26 #include "G4UserRunAction.hh"
27 #include "G4UserSteppingAction.hh"
28 
31 #include "TrkGeometry/Material.h"
33 
34 
35 namespace G4UA
36 {
37 
38  class MaterialStepRecorder: public AthMessaging, public G4UserEventAction,
39  public G4UserRunAction, public G4UserSteppingAction
40  {
41 
42  public:
44  virtual void BeginOfEventAction(const G4Event*) override;
45  virtual void EndOfEventAction(const G4Event*) override;
46  virtual void BeginOfRunAction(const G4Run*) override;
47  virtual void UserSteppingAction(const G4Step*) override;
48  private:
49 
52 
53  Trk::MaterialStepCollection* m_matStepCollection; //FIXME convert to a WriteHandle
54  std::string m_matStepCollectionName; //FIXME should be passed in via a Config struct rather than hardcoded.
55 
56  bool m_recordComposition; //FIXME should be passed in via a Config struct rather than hardcoded.
57 
58  size_t m_totalSteps;
59  size_t m_eventID;
60 
61  Trk::ElementTable* m_elementTable; //FIXME convert to a WriteHandle
62  std::string m_elementTableName;
63 
65 
66  }; // class MaterialStepRecorder
67 
68 } // namespace G4UA
69 
70 #endif
G4UA::MaterialStepRecorder::m_eventID
size_t m_eventID
Definition: MaterialStepRecorder.h:59
ElementTable.h
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::MaterialStepRecorder::m_matStepCollectionName
std::string m_matStepCollectionName
Definition: MaterialStepRecorder.h:54
MaterialStepCollection.h
G4UA::MaterialStepRecorder::MaterialStepRecorder
MaterialStepRecorder()
Definition: MaterialStepRecorder.cxx:33
G4UA::MaterialStepRecorder::m_matStepCollection
Trk::MaterialStepCollection * m_matStepCollection
Definition: MaterialStepRecorder.h:53
G4UA::MaterialStepRecorder::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
Definition: MaterialStepRecorder.cxx:84
G4UA::MaterialStepRecorder::m_recordComposition
bool m_recordComposition
Definition: MaterialStepRecorder.h:56
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
G4UA::MaterialStepRecorder::m_elementTable
Trk::ElementTable * m_elementTable
Definition: MaterialStepRecorder.h:61
G4UA::MaterialStepRecorder::m_runElementTable
Trk::ElementTable * m_runElementTable
Definition: MaterialStepRecorder.h:64
IPositionMomentumWriter.h
G4UA::MaterialStepRecorder::EndOfEventAction
virtual void EndOfEventAction(const G4Event *) override
Definition: MaterialStepRecorder.cxx:56
G4UA::MaterialStepRecorder::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
Pointer to StoreGate (event store by default)
Definition: MaterialStepRecorder.h:51
Trk::ElementTable
Definition: ElementTable.h:24
G4UA::MaterialStepRecorder::m_elementTableName
std::string m_elementTableName
Definition: MaterialStepRecorder.h:62
G4UA::MaterialStepRecorder
Definition: MaterialStepRecorder.h:40
G4UA::MaterialStepRecorder::BeginOfRunAction
virtual void BeginOfRunAction(const G4Run *) override
Definition: MaterialStepRecorder.cxx:75
AthMessaging.h
G4UA::MaterialStepRecorder::BeginOfEventAction
virtual void BeginOfEventAction(const G4Event *) override
Definition: MaterialStepRecorder.cxx:47
StoreGateSvc.h
Material.h
G4UA::MaterialStepRecorder::m_totalSteps
size_t m_totalSteps
Definition: MaterialStepRecorder.h:58
ServiceHandle< StoreGateSvc >