ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsValidationUserAction.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 ISF_GEANT4TOOLS_PHYSICSVALIDATIONUSERACTION_H
6#define ISF_GEANT4TOOLS_PHYSICSVALIDATIONUSERACTION_H
7
9
11
12#include "GaudiKernel/ToolHandle.h"
13#include "GaudiKernel/ServiceHandle.h"
14#include "GaudiKernel/ITHistSvc.h"
15
16#ifndef MAXCHILDREN
17#define MAXCHILDREN 40
18#endif
19
20#include <string>
21
22// ROOT forward declarations
23class TTree;
24
25#include "G4UserEventAction.hh"
26#include "G4UserRunAction.hh"
27#include "G4UserSteppingAction.hh"
28#include "G4UserTrackingAction.hh"
30
31namespace G4UA{
32 namespace iGeant4 {
33 class PhysicsValidationUserAction: public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction, public G4UserTrackingAction, public AthMessaging
34 {
35
36 public:
37
38 struct Config
39 {
40 MSG::Level verboseLevel=MSG::INFO;
41 bool validationOutput = true;
42 std::string validationStream="ISFG4SimKernel";
43 ServiceHandle<ITHistSvc> thistSvc=ServiceHandle<ITHistSvc>("THistSvc", "PhysicsValidationUserAction");
45 ServiceHandle<ISF::IGeoIDSvc>("ISF::GeoIDSvc/ISF_GeoIDSvc", "PhysicsValidationUserAction");
46
47 double idR=1150.-1.e-5;
48 double idZ=3490.;
49 double caloRmean=0.5*(40.+4250.);
50 double caloZmean=0.5*(3490.+6740.);
51 double muonRmean=0.5*(60.+30000.);
52 double muonZmean=0.5*(6740.+30000.);
53 double cavernRmean=300000.0;
54 double cavernZmean=300000.0;
55
56 };
57
59 virtual void BeginOfEventAction(const G4Event*) override final;
60 virtual void EndOfEventAction(const G4Event*) override final;
61 virtual void BeginOfRunAction(const G4Run*) override final;
62 virtual void UserSteppingAction(const G4Step*) override final;
63 virtual void PreUserTrackingAction(const G4Track*) override final;
64 private:
65
67
70
71 TTree *m_particles;
72 int m_pdg;
73 int m_scIn;
75 int m_gen;
77 float m_pth;
78 float m_pph;
79 float m_p;
80 float m_eloss;
81 float m_radloss;
82 float m_ionloss;
83 float m_wzOaTr;
84 float m_thIn;
85 float m_phIn;
86 float m_dIn;
87 float m_thEnd;
88 float m_phEnd;
89 float m_dEnd;
90 float m_X0;
91 float m_L0;
92 float m_wZ;
93 float m_dt;
94
109 int m_pdg_child[MAXCHILDREN] ={}; // decay product pdg code
110 float m_fp_child[MAXCHILDREN] ={}; // fraction of incoming momentum
111 float m_oa_child[MAXCHILDREN] ={}; // opening angle wrt the mother
112
113
116
118 std::map<int, int> m_trackGenMap;
119
120 }; // class PhysicsValidationUserAction
121
122 } // namespace iGeant4
123
124} // namespace G4UA
125
126#endif // ISF_GEANT4TOOLS_PHYSICSVALIDATIONUSERACTION_H
#define MAXCHILDREN
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
TTree * m_particles
ROOT tree containing track info.
virtual void BeginOfEventAction(const G4Event *) override final
virtual void UserSteppingAction(const G4Step *) override final
TTree * m_interactions
ROOT tree containing vertex info.
ISF::IGeoIDSvc * m_geoIDSvcQuick
access to the central ISF GeoID serice
virtual void PreUserTrackingAction(const G4Track *) override final
virtual void EndOfEventAction(const G4Event *) override final
virtual void BeginOfRunAction(const G4Run *) override final
The interface to chose between the sub geometry services, realized as an AlgTool since it does not ha...
Definition IGeoIDSvc.h:41