EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eASTStackingAction.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eASTStackingAction.cc
1 // ********************************************************************
2 //
3 // eASTStackingAction.cc
4 // Header file of eAST Stacking Action class
5 //
6 // History
7 // May 8th, 2021 : first implementation
8 //
9 // ********************************************************************
10 
11 #include "eASTStackingAction.hh"
13 #include "globals.hh"
14 #include "G4Track.hh"
15 
17 {;}
18 
20 {;}
21 
22 G4ClassificationOfNewTrack eASTStackingAction::ClassifyNewTrack(const G4Track* trk)
23 {
24  G4ClassificationOfNewTrack classification = fUrgent;
25  auto stackingActions = eASTUserActionDispatcher::Instance()->GetStackingActions();
26  if((stackingActions!=nullptr) && !(stackingActions->empty()))
27  {
28  for(auto ua : *stackingActions)
29  {
30  auto cl = ua.second->ClassifyNewTrack(trk);
31  if(cl > classification) classification = cl;
32  }
33  }
34  return classification;
35 }
36 
38 {
39  auto stackingActions = eASTUserActionDispatcher::Instance()->GetStackingActions();
40  if((stackingActions!=nullptr) && !(stackingActions->empty()))
41  {
42  for(auto ua : *stackingActions)
43  { ua.second->NewStage(); }
44  }
45 }
46 
48 {
49  auto stackingActions = eASTUserActionDispatcher::Instance()->GetStackingActions();
50  if((stackingActions!=nullptr) && !(stackingActions->empty()))
51  {
52  for(auto ua : *stackingActions)
53  { ua.second->PrepareNewEvent(); }
54  }
55 }
56