File indexing completed on 2025-01-18 09:59:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 #ifndef G4StackManager_hh
0048 #define G4StackManager_hh 1
0049
0050 #include <map>
0051 #include <vector>
0052
0053 #include "G4UserStackingAction.hh"
0054 #include "G4StackedTrack.hh"
0055 #include "G4TrackStack.hh"
0056 #include "G4SmartTrackStack.hh"
0057 #include "G4SubEventTrackStack.hh"
0058 #include "G4ClassificationOfNewTrack.hh"
0059 #include "G4Track.hh"
0060 #include "G4TrackStatus.hh"
0061 #include "G4ExceptionSeverity.hh"
0062 #include "globals.hh"
0063
0064 class G4StackingMessenger;
0065 class G4VTrajectory;
0066 class G4Event;
0067 class G4ParticleDefinition;
0068
0069 class G4StackManager
0070 {
0071 public:
0072
0073 G4StackManager();
0074 ~G4StackManager();
0075
0076 const G4StackManager& operator=(const G4StackManager&) = delete;
0077 G4bool operator==(const G4StackManager&) const = delete;
0078 G4bool operator!=(const G4StackManager&) const = delete;
0079
0080 G4int PushOneTrack(G4Track* newTrack,
0081 G4VTrajectory* newTrajectory = nullptr);
0082 G4Track* PopNextTrack(G4VTrajectory** newTrajectory);
0083 G4int PrepareNewEvent(G4Event* currentEvent);
0084
0085 void ReClassify();
0086
0087
0088
0089
0090
0091
0092
0093
0094 void SetNumberOfAdditionalWaitingStacks(G4int iAdd);
0095
0096
0097
0098
0099
0100
0101
0102 void TransferStackedTracks(G4ClassificationOfNewTrack origin,
0103 G4ClassificationOfNewTrack destination);
0104
0105
0106
0107
0108
0109 void TransferOneStackedTrack(G4ClassificationOfNewTrack origin,
0110 G4ClassificationOfNewTrack destination);
0111
0112
0113
0114
0115
0116
0117
0118 void RegisterSubEventType(G4int ty, G4int maxEnt);
0119
0120
0121
0122 void SetDefaultClassification(
0123 G4TrackStatus, G4ClassificationOfNewTrack,
0124 G4ExceptionSeverity es = G4ExceptionSeverity::IgnoreTheIssue);
0125 void SetDefaultClassification(
0126 const G4ParticleDefinition*, G4ClassificationOfNewTrack,
0127 G4ExceptionSeverity es = G4ExceptionSeverity::IgnoreTheIssue);
0128
0129
0130
0131
0132
0133 inline G4ClassificationOfNewTrack GetDefaultClassification()
0134 { return fDefaultClassification; }
0135
0136 public:
0137 void ReleaseSubEvent(G4int ty);
0138 inline std::size_t GetNSubEventTypes()
0139 { return subEvtTypes.size(); }
0140 inline G4int GetSubEventType(std::size_t i)
0141 { return subEvtTypes[i]; }
0142
0143 void clear();
0144 void ClearUrgentStack();
0145 void ClearWaitingStack(G4int i=0);
0146 void ClearPostponeStack();
0147 G4int GetNTotalTrack() const;
0148 G4int GetNUrgentTrack() const;
0149 G4int GetNWaitingTrack(G4int i=0) const;
0150 G4int GetNPostponedTrack() const;
0151 void SetVerboseLevel( G4int const value );
0152 void SetUserStackingAction(G4UserStackingAction* value);
0153
0154 private:
0155 void DefineDefaultClassification(const G4Track* aTrack);
0156 void SortOut(G4StackedTrack&,G4ClassificationOfNewTrack);
0157
0158 private:
0159
0160 G4UserStackingAction* userStackingAction = nullptr;
0161 G4int verboseLevel = 0;
0162 #ifdef G4_USESMARTSTACK
0163 G4SmartTrackStack* urgentStack = nullptr;
0164 #else
0165 G4TrackStack* urgentStack = nullptr;
0166 #endif
0167 G4TrackStack* waitingStack = nullptr;
0168 G4TrackStack* postponeStack = nullptr;
0169 G4StackingMessenger* theMessenger = nullptr;
0170 std::vector<G4TrackStack*> additionalWaitingStacks;
0171 G4int numberOfAdditionalWaitingStacks = 0;
0172
0173 std::map<G4TrackStatus,
0174 std::pair<G4ClassificationOfNewTrack,G4ExceptionSeverity>>
0175 defClassTrackStatus;
0176 std::map<const G4ParticleDefinition*,
0177 std::pair<G4ClassificationOfNewTrack,G4ExceptionSeverity>>
0178 defClassPartDef;
0179 G4ClassificationOfNewTrack fDefaultClassification = fUrgent;
0180 G4ExceptionSeverity fExceptionSeverity = G4ExceptionSeverity::IgnoreTheIssue;
0181
0182 std::map<G4int,G4SubEventTrackStack*> subEvtStackMap;
0183 std::vector<G4int> subEvtTypes;
0184 };
0185
0186 #endif