ATLAS Offline Software
QuirkStackingAction.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 #include "QuirkStackingAction.h"
6 
7 #include "Quirk.h"
8 
9 #include "G4Track.hh"
10 
11 QuirkStackingAction::QuirkStackingAction(G4UserStackingAction* defaultStackingAction):
12  m_firstTrack(true),
13  m_defaultStackingAction(defaultStackingAction)
14 {}
15 
18 }
19 
20 G4ClassificationOfNewTrack QuirkStackingAction::ClassifyNewTrack(const G4Track* aTrack) {
21  G4ClassificationOfNewTrack defaultClassification = fUrgent;
23  m_defaultStackingAction->SetStackManager(stackManager);
24  defaultClassification = m_defaultStackingAction->ClassifyNewTrack(aTrack);
25  }
26  const Quirk* quirkDef = dynamic_cast<const Quirk*>(aTrack->GetParticleDefinition());
27  if (quirkDef == 0 || (defaultClassification != fUrgent && defaultClassification != fWaiting)) {
28  return defaultClassification;
29  } else if (m_firstTrack) {
30  m_firstTrack = false;
31  return fWaiting;
32  } else {
33  return fWaiting_1;
34  }
35 }
36 
39  m_defaultStackingAction->SetStackManager(stackManager);
40  m_defaultStackingAction->NewStage();
41  }
42 }
43 
46  m_defaultStackingAction->SetStackManager(stackManager);
47  m_defaultStackingAction->PrepareNewEvent();
48  }
49  m_firstTrack = true;
50 }
QuirkStackingAction::NewStage
virtual void NewStage()
Definition: QuirkStackingAction.cxx:37
QuirkStackingAction::ClassifyNewTrack
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
Definition: QuirkStackingAction.cxx:20
QuirkStackingAction::m_defaultStackingAction
G4UserStackingAction * m_defaultStackingAction
Definition: QuirkStackingAction.h:20
QuirkStackingAction.h
Quirk.h
Quirk
Definition: Quirk.h:12
QuirkStackingAction::PrepareNewEvent
virtual void PrepareNewEvent()
Definition: QuirkStackingAction.cxx:44
QuirkStackingAction::m_firstTrack
G4bool m_firstTrack
Definition: QuirkStackingAction.h:19
QuirkStackingAction::QuirkStackingAction
QuirkStackingAction(G4UserStackingAction *defaultStackingAction=0)
Definition: QuirkStackingAction.cxx:11
QuirkStackingAction::~QuirkStackingAction
virtual ~QuirkStackingAction()
Definition: QuirkStackingAction.cxx:16