fix circular module dep: thread trackID counter via pointer instead of include
G4tracking cannot include G4EventManager.hh because G4event already depends on G4tracking, creating a circular dependency. Fix: pass a raw G4int* pointer to the event-level trackIDCounter from G4EventManager through G4TrackingManager::SetTrackIDCounter into G4SteppingManager, where ProcessSecondariesFromParticleChange uses it to pre-assign track IDs without any new include. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,9 +59,6 @@ class G4EventManager
|
||||
static G4EventManager* GetEventManager();
|
||||
// This method returns the singleton pointer of G4EventManager.
|
||||
|
||||
G4int ReserveNextTrackID();
|
||||
// Pre-assign the next sequential track ID to a secondary being born inside
|
||||
// G4SteppingManager, so that its ID is available in UserSteppingAction.
|
||||
|
||||
G4EventManager();
|
||||
~G4EventManager();
|
||||
|
||||
@@ -172,6 +172,8 @@ void G4EventManager::DoProcessing(G4Event* anEvent,
|
||||
}
|
||||
#endif
|
||||
|
||||
trackManager->SetTrackIDCounter(&trackIDCounter);
|
||||
|
||||
std::unordered_set<G4VTrackingManager *> trackingManagersToFlush;
|
||||
|
||||
do
|
||||
@@ -401,11 +403,6 @@ G4int G4EventManager::StoreSubEvent(G4Event* evt, G4int& subEvtType, G4SubEvent*
|
||||
return evt->StoreSubEvent(subEvtType,se);
|
||||
}
|
||||
|
||||
G4int G4EventManager::ReserveNextTrackID()
|
||||
{
|
||||
return ++trackIDCounter;
|
||||
}
|
||||
|
||||
void G4EventManager::StackTracks(G4TrackVector* trackVector,
|
||||
G4bool IDhasAlreadySet)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user