ATLAS Offline Software
Loading...
Searching...
No Matches
G4AtlasStackingAction.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Local includes
7
8namespace G4UA
9{
10
11 //---------------------------------------------------------------------------
12 // Constructor
13 //---------------------------------------------------------------------------
17
18 //---------------------------------------------------------------------------
19 // Classify a new track
20 //---------------------------------------------------------------------------
21 G4ClassificationOfNewTrack
23 {
24 // Loop over my actions and apply each one in turn
25 // TODO: decide how to properly handle multiple stacking action results.
26 // Maybe we just need to forbid it. See ATLASSIM-2421.
27 G4ClassificationOfNewTrack classification = fUrgent;
28 for(auto action : m_actions){
29 classification = action->ClassifyNewTrack(track);
30 if(classification == fKill) return fKill;
31 }
32 return classification;
33 }
34
35 //---------------------------------------------------------------------------
36 // Start a new stack stage
37 //---------------------------------------------------------------------------
39 {
40 // Loop over my actions and apply each one in turn
41 for(auto action : m_actions){
42 action->NewStage();
43 }
44 }
45
46 //---------------------------------------------------------------------------
47 // Start a new event
48 //---------------------------------------------------------------------------
50 {
51 // Loop over my actions and apply each one in turn
52 for(auto action : m_actions){
53 action->PrepareNewEvent();
54 }
55 }
56
57 //---------------------------------------------------------------------------
58 // Add one action to the action list
59 //---------------------------------------------------------------------------
60 void G4AtlasStackingAction::addAction(G4UserStackingAction* action)
61 {
62 m_actions.push_back(action);
63 }
64
65} // namespace G4UA
void addAction(G4UserStackingAction *action)
Add one action to the list.
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *track) override final
Geant4 method for classifying a new track.
void PrepareNewEvent() override final
Geant4 method for stack preparation at new event.
void NewStage() override final
Geant4 method for starting a new stack.
std::vector< G4UserStackingAction * > m_actions
List of ATLAS stacking actions.