From 82ba48a78b76c7beb87d178b7807819b776a31ad Mon Sep 17 00:00:00 2001 From: kochebina Date: Tue, 17 Sep 2024 16:17:32 +0200 Subject: [PATCH] Remove keep-options in policy for CoinSorter --- .../include/GateCoincidenceSorter.hh | 21 ++++++-- .../digits_hits/src/GateCoincidenceSorter.cc | 51 +++++++++++++++---- .../src/GateCoincidenceSorterMessenger.cc | 2 +- 3 files changed, 59 insertions(+), 15 deletions(-) diff --git a/source/digits_hits/include/GateCoincidenceSorter.hh b/source/digits_hits/include/GateCoincidenceSorter.hh index be6a893c0..67446af2d 100644 --- a/source/digits_hits/include/GateCoincidenceSorter.hh +++ b/source/digits_hits/include/GateCoincidenceSorter.hh @@ -39,16 +39,29 @@ class GateDigitizerMgr; // 01/2016 Rewritten completely by Jared.STRYDHORST@cea.fr +// 2023 Added to GND kochebina@gmail.com + +/* + 09/24 kochebina@gmail.com + Simplification of number of options for multiple coincidences + remove "keep" and replace (or remove if double) with "take", + i.e. all coincidecnes are now written on disk + keepIfAllAreGoods = takeWinnerIfAllAreGoods + keepIfOnlyOneGood = takeWinnerIfOnlyOneGood + keepIfAnyIsGood = takeWinnerOfGoods + kKeepAll = removed +*/ typedef enum {kKillAll, kTakeAllGoods, kKillAllIfMultipleGoods, kTakeWinnerOfGoods, kTakeWinnerIfIsGood, kTakeWinnerIfAllAreGoods, - kKeepIfAllAreGoods, - kKeepIfOnlyOneGood, - kKeepIfAnyIsGood, - kKeepAll} multiple_policy_t; + kTakeWinnerIfOnlyOneGood + //kKeepIfOnlyOneGood, + //kKeepIfAnyIsGood, + //kKeepAll + } multiple_policy_t; diff --git a/source/digits_hits/src/GateCoincidenceSorter.cc b/source/digits_hits/src/GateCoincidenceSorter.cc index f77f905fd..2c1f24a4b 100644 --- a/source/digits_hits/src/GateCoincidenceSorter.cc +++ b/source/digits_hits/src/GateCoincidenceSorter.cc @@ -43,7 +43,7 @@ GateCoincidenceSorter::GateCoincidenceSorter(GateDigitizerMgr* itsDigitizerMgr, m_minS (-1), m_maxDeltaZ ( -1), m_forceMinSecDifferenceToZero(false), - m_multiplesPolicy(kKeepIfAllAreGoods), + m_multiplesPolicy(kTakeWinnerIfAllAreGoods), m_allDigiOpenCoincGate(false), m_depth(1), m_presortBufferSize(256), @@ -132,15 +132,31 @@ void GateCoincidenceSorter::SetMultiplesPolicy(const G4String& policy) else if (policy=="killAllIfMultipleGoods") m_multiplesPolicy=kKillAllIfMultipleGoods; else if (policy=="keepIfAnyIsGood") - m_multiplesPolicy=kKeepIfAnyIsGood; + { + m_multiplesPolicy= kTakeWinnerOfGoods;//kKeepIfAnyIsGood; + G4cout<<"WARNING (Coincidence Sorter): used policy keepIfAnyIsGood is outdated. Please, use takeWinnerOfGoods instead.\n"; + } else if (policy=="keepIfOnlyOneGood") - m_multiplesPolicy=kKeepIfOnlyOneGood; - else if (policy=="keepAll") - m_multiplesPolicy=kKeepAll; + { + m_multiplesPolicy= kTakeWinnerIfOnlyOneGood;//kKeepIfOnlyOneGood; + G4cout<<"WARNING (Coincidence Sorter): used policy keepIfOnlyOneGood is outdated. Please, use takeWinnerIfOnlyOneGood instead.\n"; + } + else if (policy=="takeWinnerIfOnlyOneGood") + { + m_multiplesPolicy= kTakeWinnerIfOnlyOneGood; + } + + //else if (policy=="keepAll") + // m_multiplesPolicy=kKeepAll; else { - if (policy!="keepIfAllAreGoods") - G4cout<<"WARNING : policy not recognized, using default : keepMultiplesIfAllAreGoods\n"; - m_multiplesPolicy=kKeepIfAllAreGoods; + if(policy == "keepIfAllAreGoods") + G4cout<<"WARNING (Coincidence Sorter): used policy keepIfAllAreGoods is outdated. Please, use takeWinnerIfAllAreGoods instead.\n"; + else + if (policy!="takeWinnerIfAllAreGoods" ) + G4cout<<"WARNING : policy not recognized, using default : takeWinnerIfAllAreGoods\n"; + + m_multiplesPolicy= kTakeWinnerIfAllAreGoods;//kKeepIfAllAreGoods; + } } //------------------------------------------------------------------------------------------------------ @@ -454,9 +470,9 @@ void GateCoincidenceSorter::ProcessCompletedCoincidenceWindow(GateCoincidenceDig return; } - //G4cout<<"nGoods = "<< nGoods<SetGuidance("How to treat multiples coincidences"); - MultiplePolicyCmd->SetCandidates("killAll takeAllGoods killAllIfMultipleGoods takeWinnerOfGoods takeWinnerIfIsGood takeWinnerIfAllAreGoods keepAll keepIfAnyIsGood keepIfOnlyOneGood keepIfAllAreGoods"); + MultiplePolicyCmd->SetCandidates("killAll takeAllGoods killAllIfMultipleGoods takeWinnerOfGoods takeWinnerIfIsGood takeWinnerIfAllAreGoods takeWinnerIfOnlyOneGood keepIfAllAreGoods keepIfOnlyOneGood keepIfAnyIsGood"); cmdName = GetDirectoryName()+"allDigiOpenCoincGate"; AllDigiOpenCoincGateCmd = new G4UIcmdWithABool(cmdName,this);