ATLAS Offline Software
TestBoundariesUserAction.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4DEBUGGINGTOOLS_TESTBOUNDARIESUSERACTION_H
6 #define G4DEBUGGINGTOOLS_TESTBOUNDARIESUSERACTION_H
7 
8 #include <string>
9 #include <map>
10 
11 #include "TMath.h"
12 
13 #include "G4UserRunAction.hh"
14 #include "G4UserSteppingAction.hh"
16 
17 class TTree;
18 class TFile;
19 
20 namespace G4UA
21 {
22 
24  public AthMessaging, public G4UserRunAction, public G4UserSteppingAction
25  {
26 
27  public:
29  virtual void BeginOfRunAction(const G4Run*) override;
30  virtual void EndOfRunAction(const G4Run*) override;
31  virtual void UserSteppingAction(const G4Step*) override;
32 
33  private:
34 
35  typedef std::map<std::string,int> SMap;
37 
38  TFile * m_file{};
39  TTree * m_tree{};
40 
41  struct Data
42  {
43  Float_t x,y,z;
44  Int_t volume;
45  Bool_t enter;
46  Bool_t exit;
47  Bool_t leave;
48 
50  Data() : x(0.),y(0.),z(0.), volume(0),enter(false),exit(false),leave(false) {}
51 
53  void Reset() {
54  enter=exit=leave=false;
55  }
56 
58  void Set(Float_t _x, Float_t _y, Float_t _z,
59  Int_t _vol)
60  {
61  x=_x; y=_y; z=_z;
62  volume=_vol;
63  }
64 
65  } m_data;
66 
67  }; // class TestBoundariesUserAction
68 
69 } // namespace G4UA
70 
71 #endif // G4DEBUGGINGTOOLS_TESTBOUNDARIESUSERACTION_H
G4UA::TestBoundariesUserAction::Data::Reset
void Reset()
Reset the data.
Definition: TestBoundariesUserAction.h:53
G4UA::TestBoundariesUserAction::m_tree
TTree * m_tree
Definition: TestBoundariesUserAction.h:39
G4UA::TestBoundariesUserAction::Data
Definition: TestBoundariesUserAction.h:42
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::TestBoundariesUserAction::EndOfRunAction
virtual void EndOfRunAction(const G4Run *) override
Definition: TestBoundariesUserAction.cxx:43
G4UA::TestBoundariesUserAction::TestBoundariesUserAction
TestBoundariesUserAction()
Definition: TestBoundariesUserAction.cxx:22
G4UA::TestBoundariesUserAction::SMap
std::map< std::string, int > SMap
Definition: TestBoundariesUserAction.h:35
G4UA::TestBoundariesUserAction
Definition: TestBoundariesUserAction.h:25
G4UA::TestBoundariesUserAction::Data::x
Float_t x
Definition: TestBoundariesUserAction.h:43
G4UA::TestBoundariesUserAction::Data::leave
Bool_t leave
Definition: TestBoundariesUserAction.h:47
G4UA::TestBoundariesUserAction::Data::enter
Bool_t enter
Definition: TestBoundariesUserAction.h:45
G4UA::TestBoundariesUserAction::m_data
struct G4UA::TestBoundariesUserAction::Data m_data
G4UA::TestBoundariesUserAction::m_sel
SMap m_sel
Definition: TestBoundariesUserAction.h:36
G4UA::TestBoundariesUserAction::BeginOfRunAction
virtual void BeginOfRunAction(const G4Run *) override
Definition: TestBoundariesUserAction.cxx:28
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
G4UA::TestBoundariesUserAction::Data::y
Float_t y
Definition: TestBoundariesUserAction.h:43
G4UA::TestBoundariesUserAction::Data::z
Float_t z
Definition: TestBoundariesUserAction.h:43
G4UA::TestBoundariesUserAction::Data::Set
void Set(Float_t _x, Float_t _y, Float_t _z, Int_t _vol)
Set the data.
Definition: TestBoundariesUserAction.h:58
G4UA::TestBoundariesUserAction::Data::exit
Bool_t exit
Definition: TestBoundariesUserAction.h:46
G4UA::TestBoundariesUserAction::m_file
TFile * m_file
Definition: TestBoundariesUserAction.h:38
G4UA::TestBoundariesUserAction::Data::volume
Int_t volume
Definition: TestBoundariesUserAction.h:44
AthMessaging.h
G4UA::TestBoundariesUserAction::Data::Data
Data()
Data constructor.
Definition: TestBoundariesUserAction.h:50
G4UA::TestBoundariesUserAction::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
Definition: TestBoundariesUserAction.cxx:54