ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
G4UA::G4AtlasStackingAction Class Reference

Atlas subclass of the G4 stacking action. More...

#include <G4AtlasStackingAction.h>

Inheritance diagram for G4UA::G4AtlasStackingAction:
Collaboration diagram for G4UA::G4AtlasStackingAction:

Public Member Functions

 G4AtlasStackingAction ()
 Constructor. More...
 
G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *track) override final
 Geant4 method for classifying a new track. More...
 
void NewStage () override final
 Geant4 method for starting a new stack. More...
 
void PrepareNewEvent () override final
 Geant4 method for stack preparation at new event. More...
 
void addAction (G4UserStackingAction *action)
 Add one action to the list. More...
 

Private Attributes

std::vector< G4UserStackingAction * > m_actions
 List of ATLAS stacking actions. More...
 

Detailed Description

Atlas subclass of the G4 stacking action.

This object maintains a list of custom actions and when invoked by Geant4 will forward the call to each of them in turn.

Todo:
TODO lifetime management of wrapper actions.
Author
Steve Farrell Steve.nosp@m.n.Fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch

Definition at line 28 of file G4AtlasStackingAction.h.

Constructor & Destructor Documentation

◆ G4AtlasStackingAction()

G4UA::G4AtlasStackingAction::G4AtlasStackingAction ( )

Constructor.

Definition at line 14 of file G4AtlasStackingAction.cxx.

15  {
16  }

Member Function Documentation

◆ addAction()

void G4UA::G4AtlasStackingAction::addAction ( G4UserStackingAction *  action)

Add one action to the list.

Definition at line 60 of file G4AtlasStackingAction.cxx.

61  {
62  m_actions.push_back(action);
63  }

◆ ClassifyNewTrack()

G4ClassificationOfNewTrack G4UA::G4AtlasStackingAction::ClassifyNewTrack ( const G4Track *  track)
finaloverride

Geant4 method for classifying a new track.

This method will forward the call onto each of the actions in its private list.

Definition at line 22 of file G4AtlasStackingAction.cxx.

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  }

◆ NewStage()

void G4UA::G4AtlasStackingAction::NewStage ( )
finaloverride

Geant4 method for starting a new stack.

Forwards the call onto each custom action.

Definition at line 38 of file G4AtlasStackingAction.cxx.

39  {
40  // Loop over my actions and apply each one in turn
41  for(auto action : m_actions){
42  action->NewStage();
43  }
44  }

◆ PrepareNewEvent()

void G4UA::G4AtlasStackingAction::PrepareNewEvent ( )
finaloverride

Geant4 method for stack preparation at new event.

This method is possibly redundant so we may remove it.

Definition at line 49 of file G4AtlasStackingAction.cxx.

50  {
51  // Loop over my actions and apply each one in turn
52  for(auto action : m_actions){
53  action->PrepareNewEvent();
54  }
55  }

Member Data Documentation

◆ m_actions

std::vector<G4UserStackingAction*> G4UA::G4AtlasStackingAction::m_actions
private

List of ATLAS stacking actions.

Definition at line 56 of file G4AtlasStackingAction.h.


The documentation for this class was generated from the following files:
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