48#include <unordered_set>
62 "G4EventManager::G4EventManager() has already been made.");
93 "IllegalState -- Geometry not closed: cannot process an event.");
100 std::ostringstream oss;
111 navigator->LocateGlobalPointAndSetup(center,0,
false);
119 G4cout <<
"=====================================" <<
G4endl;
120 G4cout <<
" G4EventManager::ProcessOneEvent() " <<
G4endl;
121 G4cout <<
"=====================================" <<
G4endl;
127#ifdef G4_STORE_TRAJECTORY
137#if defined(GEANT4_USE_TIMEMORY)
145 <<
" vertices passed from G4Event." <<
G4endl;
158 <<
"are passed from G4EventTransformer." <<
G4endl;
159 G4cout <<
"!!!!!!! Now start processing an event !!!!!!!" <<
G4endl;
163 std::unordered_set<G4VTrackingManager *> trackingManagersToFlush;
174 if (particleTrackingManager !=
nullptr)
181 <<
") is handed over to custom TrackingManager." <<
G4endl;
191 trackingManagersToFlush.insert(particleTrackingManager);
199 <<
") is passed to G4TrackingManager." <<
G4endl;
213 <<
") is processed with stopping code " << istop <<
G4endl;
218#ifdef G4_STORE_TRAJECTORY
221 if(previousTrajectory !=
nullptr)
225 aTrajectory = previousTrajectory;
259 "Illegal trackstatus returned from G4TrackingManager."\
260 " Continue with simulation.");
265 for(std::size_t i=0; i<secondaries->size(); ++i)
266 {
delete (*secondaries)[i]; }
267 secondaries->clear();
280 trackingManagersToFlush.clear();
288 G4cout <<
"NULL returned from G4StackManager." <<
G4endl;
289 G4cout <<
"Terminate current event processing." <<
G4endl;
298#if defined(GEANT4_USE_TIMEMORY)
315 if( trackVector !=
nullptr )
317 if( trackVector->size() == 0 )
return;
318 for(
auto newTrack : *trackVector )
324 if(newTrack->GetDynamicParticle()->GetPrimaryParticle())
331 newTrack->SetOriginTouchableHandle(newTrack->GetTouchableHandle());
336 G4cout <<
"A new track " << newTrack
337 <<
" (trackID " << newTrack->GetTrackID()
338 <<
", parentID " << newTrack->GetParentID()
339 <<
") is passed to G4StackManager." <<
G4endl;
343 trackVector->clear();
384 if (randStat ==
nullptr) randStat =
new G4String;
387 if(anEvent ==
nullptr)
395 std::ostringstream oss;
397 (*randStat) = oss.str();
402 if(tempEvent) {
delete anEvent; }
412 "G4VUserEventInformation cannot be set because of absence "\
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
@ fKillTrackAndSecondaries
std::vector< G4Track * > G4TrackVector
G4GLOB_DLL std::ostream G4cout
static std::ostream & saveFullState(std::ostream &os)
G4EvManMessenger * theMessenger
void SetUserAction(G4UserEventAction *userAction)
G4UserStackingAction * userStackingAction
void SetUserInformation(G4VUserEventInformation *anInfo)
std::unique_ptr< ProfilerConfig > eventProfiler
G4UserTrackingAction * userTrackingAction
void KeepTheCurrentEvent()
G4ProfilerConfig< G4ProfileType::Event > ProfilerConfig
G4int storetRandomNumberStatusToG4Event
G4StateManager * stateManager
static G4ThreadLocal G4EventManager * fpEventManager
G4PrimaryTransformer * transformer
void DoProcessing(G4Event *anEvent)
static G4EventManager * GetEventManager()
G4StackManager * trackContainer
G4TrajectoryContainer * trajectoryContainer
void StackTracks(G4TrackVector *trackVector, G4bool IDhasAlreadySet=false)
G4UserEventAction * userEventAction
void ProcessOneEvent(G4Event *anEvent)
G4TrackingManager * trackManager
G4UserSteppingAction * userSteppingAction
G4VUserEventInformation * GetUserInformation()
G4String randomNumberStatusToG4Event
G4int GetNumberOfPrimaryVertex() const
void SetRandomNumberStatus(G4String &st)
void KeepTheEvent(G4bool vl=true)
G4HCofThisEvent * GetHCofThisEvent() const
void SetRandomNumberStatusForProcessing(G4String &st)
void SetHCofThisEvent(G4HCofThisEvent *value)
void SetUserInformation(G4VUserEventInformation *anInfo)
G4VUserEventInformation * GetUserInformation() const
void SetTrajectoryContainer(G4TrajectoryContainer *value)
G4VTrackingManager * GetTrackingManager() const
void TerminateCurrentEvent(G4HCofThisEvent *HCE)
G4HCofThisEvent * PrepareNewEvent()
static G4SDManager * GetSDMpointerIfExist()
G4int GetNTotalTrack() const
G4int GetNUrgentTrack() const
G4Track * PopNextTrack(G4VTrajectory **newTrajectory)
G4int PushOneTrack(G4Track *newTrack, G4VTrajectory *newTrajectory=nullptr)
void SetUserStackingAction(G4UserStackingAction *value)
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
G4bool SetNewState(const G4ApplicationState &requestedState)
G4TrackStatus GetTrackStatus() const
const G4ParticleDefinition * GetParticleDefinition() const
G4int GetParentID() const
void SetUserAction(G4UserTrackingAction *apAction)
G4TrackVector * GimmeSecondaries() const
void ProcessOneTrack(G4Track *apValueG4Track)
G4VTrajectory * GimmeTrajectory() const
G4bool insert(G4VTrajectory *p)
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const
virtual void SetEventManager(G4EventManager *value)
virtual void BeginOfEventAction(const G4Event *anEvent)
virtual void EndOfEventAction(const G4Event *anEvent)
virtual void HandOverOneTrack(G4Track *aTrack)=0
virtual void MergeTrajectory(G4VTrajectory *secondTrajectory)=0