diff --git a/core/opengate_core/opengate_lib/GatePhaseSpaceActor.cpp b/core/opengate_core/opengate_lib/GatePhaseSpaceActor.cpp index 651f80472..0230eca88 100644 --- a/core/opengate_core/opengate_lib/GatePhaseSpaceActor.cpp +++ b/core/opengate_core/opengate_lib/GatePhaseSpaceActor.cpp @@ -16,6 +16,7 @@ G4Mutex TotalEntriesMutex = G4MUTEX_INITIALIZER; GatePhaseSpaceActor::GatePhaseSpaceActor(py::dict &user_info) : GateVActor(user_info, true) { + std::cout << __func__ << std::endl; fActions.insert("StartSimulationAction"); fActions.insert("BeginOfRunAction"); fActions.insert("BeginOfEventAction"); @@ -35,10 +36,12 @@ GatePhaseSpaceActor::GatePhaseSpaceActor(py::dict &user_info) } GatePhaseSpaceActor::~GatePhaseSpaceActor() { + std::cout << __func__ << std::endl; // for debug } void GatePhaseSpaceActor::InitializeUserInput(py::dict &user_info) { + std::cout << __func__ << std::endl; GateVActor::InitializeUserInput(user_info); fDigiCollectionName = DictGetStr(user_info, "name"); fUserDigiAttributeNames = DictGetVecStr(user_info, "attributes"); @@ -53,6 +56,7 @@ void GatePhaseSpaceActor::InitializeUserInput(py::dict &user_info) { } void GatePhaseSpaceActor::InitializeCpp() { + std::cout << __func__ << std::endl; fHits = nullptr; fTotalNumberOfEntries = 0; fNumberOfAbsorbedEvents = 0; @@ -60,6 +64,7 @@ void GatePhaseSpaceActor::InitializeCpp() { // Called when the simulation start void GatePhaseSpaceActor::StartSimulationAction() { + std::cout << __func__ << std::endl; fHits = GateDigiCollectionManager::GetInstance()->NewDigiCollection( fDigiCollectionName); @@ -84,11 +89,13 @@ void GatePhaseSpaceActor::StartSimulationAction() { // Called every time a Run starts void GatePhaseSpaceActor::BeginOfRunAction(const G4Run *run) { + std::cout << __func__ << std::endl; if (run->GetRunID() == 0) fHits->RootInitializeTupleForWorker(); } void GatePhaseSpaceActor::BeginOfEventAction(const G4Event * /*event*/) { + std::cout << __func__ << std::endl; auto &l = fThreadLocalData.Get(); l.fFirstStepInVolume = true; if (fStoreAbsorbedEvent) { @@ -102,6 +109,7 @@ void GatePhaseSpaceActor::BeginOfEventAction(const G4Event * /*event*/) { } void GatePhaseSpaceActor::PreUserTrackingAction(const G4Track *track) { + std::cout << __func__ << std::endl; auto &l = fThreadLocalData.Get(); l.fFirstStepInVolume = true; if (fDebug) { @@ -114,6 +122,7 @@ void GatePhaseSpaceActor::PreUserTrackingAction(const G4Track *track) { // Called every time a batch of step must be processed void GatePhaseSpaceActor::SteppingAction(G4Step *step) { + std::cout << __func__ << std::endl; /* Only store if the particle enters and/or exits the volume. (We CANNOT use step->IsFirstStepInVolume() because it fails with parallel @@ -185,6 +194,7 @@ void GatePhaseSpaceActor::SteppingAction(G4Step *step) { } void GatePhaseSpaceActor::EndOfEventAction(const G4Event *event) { + std::cout << __func__ << std::endl; // For a given event, when no step never reach the phsp: // if the option is on, we store a "fake" step, with the event information. // All other attributes will be "empty" (mostly 0) @@ -223,6 +233,7 @@ void GatePhaseSpaceActor::EndOfEventAction(const G4Event *event) { // Called every time a Run ends void GatePhaseSpaceActor::EndOfRunAction(const G4Run * /*unused*/) { + std::cout << __func__ << std::endl; { G4AutoLock mutex(&TotalEntriesMutex); fTotalNumberOfEntries += fHits->GetSize(); @@ -233,19 +244,23 @@ void GatePhaseSpaceActor::EndOfRunAction(const G4Run * /*unused*/) { // Called every time a Run ends void GatePhaseSpaceActor::EndOfSimulationWorkerAction( const G4Run * /*unused*/) { + std::cout << __func__ << std::endl; fHits->Write(); } // Called when the simulation ends void GatePhaseSpaceActor::EndSimulationAction() { + std::cout << __func__ << std::endl; fHits->Write(); fHits->Close(); } int GatePhaseSpaceActor::GetNumberOfAbsorbedEvents() const { + std::cout << __func__ << std::endl; return fNumberOfAbsorbedEvents; } int GatePhaseSpaceActor::GetTotalNumberOfEntries() const { + std::cout << __func__ << std::endl; return fTotalNumberOfEntries; }