ATLAS Offline Software
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 
8 namespace G4UA
9 {
10 
11  //---------------------------------------------------------------------------
12  // Constructor
13  //---------------------------------------------------------------------------
15  {
16  }
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
G4UA::G4AtlasStackingAction::NewStage
void NewStage() override final
Geant4 method for starting a new stack.
Definition: G4AtlasStackingAction.cxx:38
G4UA::G4AtlasStackingAction::G4AtlasStackingAction
G4AtlasStackingAction()
Constructor.
Definition: G4AtlasStackingAction.cxx:14
G4UA::G4AtlasStackingAction::addAction
void addAction(G4UserStackingAction *action)
Add one action to the list.
Definition: G4AtlasStackingAction.cxx:60
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4AtlasStackingAction.h
G4UA::G4AtlasStackingAction::ClassifyNewTrack
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *track) override final
Geant4 method for classifying a new track.
Definition: G4AtlasStackingAction.cxx:22
G4UA::G4AtlasStackingAction::PrepareNewEvent
void PrepareNewEvent() override final
Geant4 method for stack preparation at new event.
Definition: G4AtlasStackingAction.cxx:49
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
G4UA::G4AtlasStackingAction::m_actions
std::vector< G4UserStackingAction * > m_actions
List of ATLAS stacking actions.
Definition: G4AtlasStackingAction.h:56
xAOD::track
@ track
Definition: TrackingPrimitives.h:512