52 while(nextVertex !=
nullptr)
55 nextVertex = thisVertex->
GetNext();
59 thePrimaryVertex =
nullptr;
62 if(trajectoryContainer !=
nullptr)
65 delete trajectoryContainer;
68 delete randomNumberStatus;
69 delete randomNumberStatusForProcessing;
75 G4int remainingSE = 0;
76 for(
auto& sem : fSubEvtStackMap)
78 if((sem.second!=
nullptr)&&!(sem.second->empty()))
80 remainingSE += sem.second->size();
81 for(
auto& se : *(sem.second))
83 se->clearAndDestroy();
91 ed <<
"Deleting G4Event (id:" << eventID <<
") that still has "
92 << remainingSE <<
" sub-events un-processed.";
96 if(!(fSubEvtVector.empty()))
99 ed <<
"Deleting G4Event (id:" << eventID <<
") that has "
100 << fSubEvtVector.size() <<
" sub-events still processing.";
102 for(
auto& se : fSubEvtVector)
104 se->clearAndDestroy();
112 return ( eventID == right.eventID );
117 return ( eventID != right.eventID );
128 if(pVVisManager ==
nullptr)
return;
130 if(trajectoryContainer !=
nullptr)
132 std::size_t n_traj = trajectoryContainer->
entries();
133 for(std::size_t i=0; i<n_traj; ++i)
134 { (*trajectoryContainer)[i]->DrawTrajectory(); }
140 for(std::size_t j=0; j<n_HC; ++j)
150 for(std::size_t j=0; j<n_DC; ++j)
160 std::set<G4SubEvent*>* sev =
nullptr;
161 auto ses = fSubEvtStackMap.find(ty);
162 if(ses==fSubEvtStackMap.end())
164 sev =
new std::set<G4SubEvent*>;
165 fSubEvtStackMap[ty] = sev;
168 { sev = ses->second; }
170 return (
G4int)sev->size();
176 auto ses = fSubEvtStackMap.find(ty);
177 if(ses!=fSubEvtStackMap.end())
179 auto sev = ses->second;
182 se = sev->extract(sev->begin()).value();
191 auto ss = fSubEvtVector.find(se);
192 if(ss!=fSubEvtVector.end())
196 <<
" with " << se->
GetNTrack() <<
" tracks has already spawned.";
197 G4Exception(
"G4Event::SpawnSubEvent",
"SubEvent9001",
200 fSubEvtVector.insert(se);
201 return (
G4int)fSubEvtVector.size();
206#ifdef G4_STORE_TRAJECTORY
207 if(se->trajectoryContainer!=
nullptr && se->trajectoryContainer->
size()>0)
210 for(
auto& trj : *(se->trajectoryContainer->
GetVector()))
221 auto ss = fSubEvtVector.find(se);
222 if(ss==fSubEvtVector.end())
226 <<
" with " << se->
GetNTrack() <<
" tracks has never been spawned.";
227 G4Exception(
"G4Event::TerminateSubEvent",
"SubEvent9002",
231 fSubEvtVector.erase(ss);
233 ss = fSubEvtVector.find(se);
234 if(ss!=fSubEvtVector.end())
238 <<
" with " << se->
GetNTrack() <<
" appears more than once. PANIC!";
239 G4Exception(
"G4Event::TerminateSubEvent",
"SubEvent9003",
245 return (
G4int)fSubEvtVector.size();
G4Allocator< G4Event > *& anEventAllocator()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4VDigiCollection * GetDC(G4int i) const
size_t GetCapacity() const
G4int StoreSubEvent(G4int, G4SubEvent *)
void MergeSubEventResults(const G4Event *se)
G4bool operator!=(const G4Event &right) const
G4SubEvent * PopSubEvent(G4int)
G4bool operator==(const G4Event &right) const
G4int TerminateSubEvent(G4SubEvent *)
G4int SpawnSubEvent(G4SubEvent *)
G4VHitsCollection * GetHC(G4int i)
G4PrimaryVertex * GetNext() const
G4int GetSubEventType() const
std::size_t GetNTrack() const
TrajectoryVector * GetVector() const
void push_back(G4VTrajectory *p)
std::size_t entries() const
virtual void DrawAllDigi()
virtual void DrawAllHits()
static G4VVisManager * GetConcreteInstance()
#define G4ThreadLocalStatic