ATLAS Offline Software
StepNtuple.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 #ifndef G4DEBUGGINGTOOLS_StepNtuple_H
6 #define G4DEBUGGINGTOOLS_StepNtuple_H
7 
8 #include "GaudiKernel/NTuple.h"
9 
10 #include <string>
11 #include <vector>
12 
13 #include "G4UserEventAction.hh"
14 #include "G4UserSteppingAction.hh"
15 #include "G4UserRunAction.hh"
17 
18 namespace G4UA
19 {
20 
21  class StepNtuple : public AthMessaging,
22  public G4UserEventAction,
23  public G4UserSteppingAction,
24  public G4UserRunAction
25  {
27  struct stepdata{
28  float time, code, dep, x, y, z;
29  };
30 
31  public:
33  StepNtuple(const MSG::Level lvl = MSG::INFO);
34 
36  virtual void BeginOfEventAction(const G4Event*) override;
37  virtual void EndOfEventAction(const G4Event*) override;
38  virtual void UserSteppingAction(const G4Step*) override;
39  virtual void BeginOfRunAction(const G4Run*) override;
40 
41  private:
42 
44  std::vector<stepdata> eventSteps;
45 
47  NTuple::Item<long> m_nsteps;
48  NTuple::Array<float> m_pdgcode;
49  NTuple::Array<float> m_step_x;
50  NTuple::Array<float> m_step_y;
51  NTuple::Array<float> m_step_z;
52  NTuple::Array<float> m_time;
53  NTuple::Array<float> m_dep;
54 
55  }; // class StepNtuple
56 
57 } // namespace G4UA
58 
59 #endif // G4DEBUGGINGTOOLS_StepNtuple_H
G4UA::StepNtuple::stepdata::y
float y
Definition: StepNtuple.h:28
G4UA::StepNtuple::stepdata
simple struct to hold step information
Definition: StepNtuple.h:27
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::StepNtuple::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
Definition: StepNtuple.cxx:53
G4UA::StepNtuple::BeginOfEventAction
virtual void BeginOfEventAction(const G4Event *) override
the hooks for G4 UA handling
Definition: StepNtuple.cxx:29
G4UA::StepNtuple::BeginOfRunAction
virtual void BeginOfRunAction(const G4Run *) override
Definition: StepNtuple.cxx:72
G4UA::StepNtuple::stepdata::z
float z
Definition: StepNtuple.h:28
G4UA::StepNtuple::m_step_y
NTuple::Array< float > m_step_y
Definition: StepNtuple.h:50
G4UA::StepNtuple::stepdata::dep
float dep
Definition: StepNtuple.h:28
G4UA::StepNtuple::stepdata::code
float code
Definition: StepNtuple.h:28
G4UA::StepNtuple::m_step_x
NTuple::Array< float > m_step_x
Definition: StepNtuple.h:49
G4UA::StepNtuple
Definition: StepNtuple.h:25
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
G4UA::StepNtuple::StepNtuple
StepNtuple(const MSG::Level lvl=MSG::INFO)
Constructor with message level argument for AthMessaging.
Definition: StepNtuple.cxx:22
G4UA::StepNtuple::EndOfEventAction
virtual void EndOfEventAction(const G4Event *) override
Definition: StepNtuple.cxx:34
G4UA::StepNtuple::m_dep
NTuple::Array< float > m_dep
Definition: StepNtuple.h:53
G4UA::StepNtuple::m_step_z
NTuple::Array< float > m_step_z
Definition: StepNtuple.h:51
G4UA::StepNtuple::stepdata::time
float time
Definition: StepNtuple.h:28
G4UA::StepNtuple::m_time
NTuple::Array< float > m_time
Definition: StepNtuple.h:52
G4UA::StepNtuple::eventSteps
std::vector< stepdata > eventSteps
holds data extracted from steps
Definition: StepNtuple.h:44
G4UA::StepNtuple::stepdata::x
float x
Definition: StepNtuple.h:28
AthMessaging.h
G4UA::StepNtuple::m_nsteps
NTuple::Item< long > m_nsteps
handles for ntuple writing
Definition: StepNtuple.h:47
G4UA::StepNtuple::m_pdgcode
NTuple::Array< float > m_pdgcode
Definition: StepNtuple.h:48