From 2257a09cf3a370405641f2593b39a978ccb16fcc Mon Sep 17 00:00:00 2001 From: Tamas Vami Date: Wed, 17 Apr 2024 10:20:41 -0700 Subject: [PATCH 1/2] added method for tagging recoil electrons for nonfiducial filter --- include/SimCore/UserEventInformation.h | 1 + include/SimCore/UserTrackInformation.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/SimCore/UserEventInformation.h b/include/SimCore/UserEventInformation.h index 65e9e008..9dd94ce9 100644 --- a/include/SimCore/UserEventInformation.h +++ b/include/SimCore/UserEventInformation.h @@ -118,6 +118,7 @@ class UserEventInformation : public G4VUserEventInformation { bool wasLastStepEN() const { return last_step_en_; } private: + /// Total number of brem candidates in the event int bremCandidateCount_{0}; diff --git a/include/SimCore/UserTrackInformation.h b/include/SimCore/UserTrackInformation.h index cbf8882c..1efa6379 100644 --- a/include/SimCore/UserTrackInformation.h +++ b/include/SimCore/UserTrackInformation.h @@ -5,6 +5,7 @@ #include "G4Track.hh" #include "G4VUserTrackInformation.hh" + namespace simcore { /** @@ -83,6 +84,23 @@ class UserTrackInformation : public G4VUserTrackInformation { isBremCandidate_ = isBremCandidate; } +/** + * Check whether this track is a recoil electron. + * + * @return true if this track is a recoil electron, false otherwise. + */ + bool isRecoilElectron() const { return isRecoilElectron_; } + + /** + * Tag this track as a recoil electron by the biasing filters. + * + * @param[in] isRecoilElectron flag indicating whether this track is + * a recoil electron or not. + */ + void tagRecoilElectron(bool isRecoilElectron = true) { + isRecoilElectron_ = isRecoilElectron; + } + /** * Check whether this track is a photon that has undergone a * photo-nuclear reaction. @@ -131,6 +149,9 @@ class UserTrackInformation : public G4VUserTrackInformation { /// Flag indicating whether this track is a brem candidate bool isBremCandidate_{false}; + /// Flag indicating whether this track is a recoil electron + bool isRecoilElectron_{false}; + /** * Flag indicating whether this track has undergone a photo-nuclear * reaction. From 06bf0c77718fc9cac475523c3002df585874ba8e Mon Sep 17 00:00:00 2001 From: Tamas Vami Date: Wed, 17 Apr 2024 12:18:59 -0700 Subject: [PATCH 2/2] Apply clang-format --- include/SimCore/UserEventInformation.h | 1 - include/SimCore/UserTrackInformation.h | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/SimCore/UserEventInformation.h b/include/SimCore/UserEventInformation.h index 9dd94ce9..65e9e008 100644 --- a/include/SimCore/UserEventInformation.h +++ b/include/SimCore/UserEventInformation.h @@ -118,7 +118,6 @@ class UserEventInformation : public G4VUserEventInformation { bool wasLastStepEN() const { return last_step_en_; } private: - /// Total number of brem candidates in the event int bremCandidateCount_{0}; diff --git a/include/SimCore/UserTrackInformation.h b/include/SimCore/UserTrackInformation.h index 1efa6379..89c33a6f 100644 --- a/include/SimCore/UserTrackInformation.h +++ b/include/SimCore/UserTrackInformation.h @@ -5,7 +5,6 @@ #include "G4Track.hh" #include "G4VUserTrackInformation.hh" - namespace simcore { /** @@ -84,7 +83,7 @@ class UserTrackInformation : public G4VUserTrackInformation { isBremCandidate_ = isBremCandidate; } -/** + /** * Check whether this track is a recoil electron. * * @return true if this track is a recoil electron, false otherwise. @@ -149,7 +148,7 @@ class UserTrackInformation : public G4VUserTrackInformation { /// Flag indicating whether this track is a brem candidate bool isBremCandidate_{false}; - /// Flag indicating whether this track is a recoil electron + /// Flag indicating whether this track is a recoil electron bool isRecoilElectron_{false}; /**