ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4UserStackingAction.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4UserStackingAction.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 
29 #ifndef G4UserStackingAction_h
30 #define G4UserStackingAction_h 1
31 
32 class G4StackManager;
33 class G4Track;
35 
36 // class description:
37 //
38 // This is the base class of one of the user's optional action classes.
39 // This class gives the hooks for G4StackManager which controls the stacks
40 // of G4Track objects.
41 //
42 
44 {
45  public:
47  virtual ~G4UserStackingAction();
48  protected:
50  public:
52  { stackManager = value; }
53 
54  public: // with description
55 //---------------------------------------------------------------
56 // vitual methods to be implemented by user
57 //---------------------------------------------------------------
58 //
60  ClassifyNewTrack(const G4Track* aTrack);
61 //
62 // Reply G4ClassificationOfNewTrack determined by the
63 // newly coming G4Track.
64 //
65 // enum G4ClassificationOfNewTrack
66 // {
67 // fUrgent, // put into the urgent stack
68 // fWaiting, // put into the waiting stack
69 // fPostpone, // postpone to the next event
70 // fKill // kill without stacking
71 // };
72 //
73 // The parent_ID of the track indicates the origin of it.
74 //
75 // G4int parent_ID = aTrack->get_parentID();
76 //
77 // parent_ID = 0 : primary particle
78 // > 0 : secondary particle
79 // < 0 : postponed from the previous event
80 //
81 //---------------------------------------------------------------
82 //
83  virtual void NewStage();
84 //
85 // This method is called by G4StackManager when the urgentStack
86 // becomes empty and contents in the waitingStack are transtered
87 // to the urgentStack.
88 // Note that this method is not called at the begining of each
89 // event, but "PrepareNewEvent" is called.
90 //
91 // In case re-classification of the stacked tracks is needed,
92 // use the following method to request to G4StackManager.
93 //
94 // stackManager->ReClassify();
95 //
96 // All of the stacked tracks in the waitingStack will be re-classified
97 // by "ClassifyNewTrack" method.
98 // To abort current event, use the following method.
99 //
100 // stackManager->clear();
101 //
102 // Note that this way is valid and safe only for the case it is called
103 // from this user class. The more global way of event abortion is
104 //
105 // G4UImanager * UImanager = G4UImanager::GetUIpointer();
106 // UImanager->ApplyCommand("/event/abort");
107 //
108 //---------------------------------------------------------------
109 //
110  virtual void PrepareNewEvent();
111 //
112 // This method is called by G4StackManager at the begining of
113 // each event.
114 // Be careful that the urgentStack and the waitingStack of
115 // G4StackManager are empty at this moment, because this method
116 // is called before accepting primary particles. Also, note that
117 // the postponeStack of G4StackManager may have some postponed
118 // tracks.
119 //
120 //---------------------------------------------------------------
121 
122 };
123 
124 #endif
125