ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace 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
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual void EndOfEventAction(const G4Event *) override
NTuple::Array< float > m_pdgcode
Definition StepNtuple.h:48
virtual void BeginOfRunAction(const G4Run *) override
virtual void BeginOfEventAction(const G4Event *) override
the hooks for G4 UA handling
std::vector< stepdata > eventSteps
holds data extracted from steps
Definition StepNtuple.h:44
NTuple::Array< float > m_step_y
Definition StepNtuple.h:50
virtual void UserSteppingAction(const G4Step *) override
NTuple::Item< long > m_nsteps
handles for ntuple writing
Definition StepNtuple.h:47
NTuple::Array< float > m_time
Definition StepNtuple.h:52
NTuple::Array< float > m_step_x
Definition StepNtuple.h:49
NTuple::Array< float > m_step_z
Definition StepNtuple.h:51
NTuple::Array< float > m_dep
Definition StepNtuple.h:53
StepNtuple(const MSG::Level lvl=MSG::INFO)
Constructor with message level argument for AthMessaging.
simple struct to hold step information
Definition StepNtuple.h:27