ATLAS Offline Software
LooperKiller.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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  bool BSM_Only=false;
35  };
36 
37  struct Report
38  {
39  long killed_tracks=0;
40  void merge(const Report& rep){
41  killed_tracks+=rep.killed_tracks;
42  }
43  };
44 
45  LooperKiller(const Config& config);
46 
47  virtual void UserSteppingAction(const G4Step*) override;
49  const Report& getReport() const
50  { return m_report; }
51 
52  private:
53 
59 
64 
65  }; // class LooperKiller
66 
67 }
68 
69 #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:63
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:125
G4UA::LooperKiller::Report::killed_tracks
long killed_tracks
Definition: LooperKiller.h:39
G4UA::LooperKiller::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: LooperKiller.h:56
G4UA::LooperKiller::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
Definition: LooperKiller.cxx:43
G4UA::LooperKiller::Report::merge
void merge(const Report &rep)
Definition: LooperKiller.h:40
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:61
G4UA::LooperKiller::Config::BSM_Only
bool BSM_Only
Definition: LooperKiller.h:34
G4UA::LooperKiller::LooperKiller
LooperKiller(const Config &config)
Definition: LooperKiller.cxx:33
Config
Definition: dumpNPs.cxx:47
G4UA::LooperKiller::m_report
Report m_report
Definition: LooperKiller.h:62
G4UA::LooperKiller::Config::VerboseLevel
int VerboseLevel
Definition: LooperKiller.h:31
G4UA::LooperKiller::getReport
const Report & getReport() const
Retrieve results.
Definition: LooperKiller.h:49
G4UA::LooperKiller::StoreGateSvc_t
ServiceHandle< StoreGateSvc > StoreGateSvc_t
Definition: LooperKiller.h:54
AthMessaging.h
G4UA::LooperKiller::Config::SetError
bool SetError
Definition: LooperKiller.h:33
G4UA::LooperKiller::Report
Definition: LooperKiller.h:38
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:58
G4UA::LooperKiller::Config::MaxSteps
int MaxSteps
Definition: LooperKiller.h:29
ServiceHandle< StoreGateSvc >