From 706af32ef35d22e11566ad6b5e972dbc97c19dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADez?= <77273709+DavidDiezIb@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:31:45 +0200 Subject: [PATCH 1/2] Identify events directly from generator --- src/TRestGeant4AnalysisProcess.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TRestGeant4AnalysisProcess.cxx b/src/TRestGeant4AnalysisProcess.cxx index 253f6e2..d7c326b 100644 --- a/src/TRestGeant4AnalysisProcess.cxx +++ b/src/TRestGeant4AnalysisProcess.cxx @@ -512,6 +512,9 @@ TRestEvent* TRestGeant4AnalysisProcess::ProcessEvent(TRestEvent* inputEvent) { if (fOutputG4Event->GetSubID() != 0) { subEventPrimaryParticleName = fOutputG4Event->GetSubEventPrimaryEventParticleName(); } + else{ + subEventPrimaryParticleName = "generator"; + } SetObservableValue("subEventPrimaryParticleName", subEventPrimaryParticleName); TVector3 primaryDirection(xDirection, yDirection, zDirection); From d7a392e97d0d13ef7cceaaf1770651de1dacddf8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:33:27 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestGeant4AnalysisProcess.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/TRestGeant4AnalysisProcess.cxx b/src/TRestGeant4AnalysisProcess.cxx index d7c326b..d2e34a7 100644 --- a/src/TRestGeant4AnalysisProcess.cxx +++ b/src/TRestGeant4AnalysisProcess.cxx @@ -511,8 +511,7 @@ TRestEvent* TRestGeant4AnalysisProcess::ProcessEvent(TRestEvent* inputEvent) { string subEventPrimaryParticleName; if (fOutputG4Event->GetSubID() != 0) { subEventPrimaryParticleName = fOutputG4Event->GetSubEventPrimaryEventParticleName(); - } - else{ + } else { subEventPrimaryParticleName = "generator"; } SetObservableValue("subEventPrimaryParticleName", subEventPrimaryParticleName);