ATLAS Offline Software
Loading...
Searching...
No Matches
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
17class TTree;
18class TFile;
19
20namespace 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
66
67 }; // class TestBoundariesUserAction
68
69} // namespace G4UA
70
71#endif // G4DEBUGGINGTOOLS_TESTBOUNDARIESUSERACTION_H
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual void UserSteppingAction(const G4Step *) override
virtual void EndOfRunAction(const G4Run *) override
virtual void BeginOfRunAction(const G4Run *) override
struct G4UA::TestBoundariesUserAction::Data m_data
std::map< std::string, int > SMap
void Set(Float_t _x, Float_t _y, Float_t _z, Int_t _vol)
Set the data.