ATLAS Offline Software
LooperKiller.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 G4USERACTIONS_G4UA_LOOPERKILLER_H
6 #define G4USERACTIONS_G4UA_LOOPERKILLER_H
7 
8 #include "GaudiKernel/ServiceHandle.h"
9 
10 // Infrastructure includes
11 #include "G4UserSteppingAction.hh"
13 
14 class StoreGateSvc;
15 
16 namespace G4UA
17 {
18 
22  class LooperKiller final : public G4UserSteppingAction, public AthMessaging
23  {
24 
25  public:
26 
27  struct Config
28  {
29  int MaxSteps=1000000;
30  int PrintSteps=100;
31  int VerboseLevel=1;
32  bool AbortEvent=true;
33  bool SetError=false;
34  };
35 
36  struct Report
37  {
38  long killed_tracks=0;
39  void merge(const Report& rep){
40  killed_tracks+=rep.killed_tracks;
41  }
42  };
43 
44  LooperKiller(const Config& config);
45 
46  virtual void UserSteppingAction(const G4Step*) override;
48  const Report& getReport() const
49  { return m_report; }
50 
51  private:
52 
58 
63 
64  }; // class LooperKiller
65 
66 }
67 
68 #endif
G4UA::LooperKiller::Config
Definition: LooperKiller.h:28
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::LooperKiller::m_count_steps
int m_count_steps
Definition: LooperKiller.h:62
make_hlt_rep.rep
rep
Definition: make_hlt_rep.py:32
G4UA::LooperKiller::Config::AbortEvent
bool AbortEvent
Definition: LooperKiller.h:32
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
G4UA::LooperKiller::Report::killed_tracks
long killed_tracks
Definition: LooperKiller.h:38
G4UA::LooperKiller::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: LooperKiller.h:55
G4UA::LooperKiller::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
Definition: LooperKiller.cxx:40
G4UA::LooperKiller::Report::merge
void merge(const Report &rep)
Definition: LooperKiller.h:39
G4UA::LooperKiller::Config::PrintSteps
int PrintSteps
Definition: LooperKiller.h:30
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
G4UA::LooperKiller::m_config
Config m_config
My configuration options.
Definition: LooperKiller.h:60
G4UA::LooperKiller::LooperKiller
LooperKiller(const Config &config)
Definition: LooperKiller.cxx:30
Config
Definition: dumpNPs.cxx:47
G4UA::LooperKiller::m_report
Report m_report
Definition: LooperKiller.h:61
G4UA::LooperKiller::Config::VerboseLevel
int VerboseLevel
Definition: LooperKiller.h:31
G4UA::LooperKiller::getReport
const Report & getReport() const
Retrieve results.
Definition: LooperKiller.h:48
G4UA::LooperKiller::StoreGateSvc_t
ServiceHandle< StoreGateSvc > StoreGateSvc_t
Definition: LooperKiller.h:53
AthMessaging.h
G4UA::LooperKiller::Config::SetError
bool SetError
Definition: LooperKiller.h:33
G4UA::LooperKiller::Report
Definition: LooperKiller.h:37
G4UA::LooperKiller
A user action to kill looping tracks.
Definition: LooperKiller.h:23
G4UA::LooperKiller::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: LooperKiller.h:57
G4UA::LooperKiller::Config::MaxSteps
int MaxSteps
Definition: LooperKiller.h:29
ServiceHandle< StoreGateSvc >