Skip to content

Commit

Permalink
corrections in CoinSort
Browse files Browse the repository at this point in the history
  • Loading branch information
kochebina committed Jul 27, 2023
1 parent e0c643d commit 2e90f2d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 5 additions & 0 deletions source/digits_hits/include/GateDigi.hh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public:
inline const GateOutputVolumeID& GetOutputVolumeID() const { return m_outputVolumeID; }
inline G4int GetComponentID(size_t depth) const { return (m_outputVolumeID.size()>depth) ? m_outputVolumeID[depth] : -1; }

inline void SetSystemID(const G4int systemID) { m_systemID = systemID; }
inline G4int GetSystemID() const { return m_systemID; }


#ifdef GATE_USE_OPTICAL
inline void SetOptical(G4bool optical = true) { m_optical = optical;}
Expand Down Expand Up @@ -221,6 +224,8 @@ public:
G4ThreeVector m_scannerPos; //!< Position of the scanner
G4double m_scannerRotAngle; //!< Rotation angle of the scanner
GateOutputVolumeID m_outputVolumeID;
G4int m_systemID; // system ID in for the multi-system approach

#ifdef GATE_USE_OPTICAL
G4bool m_optical; //!< Is the pulse generated by optical photons
#endif
Expand Down
13 changes: 11 additions & 2 deletions source/digits_hits/src/GateCoincidenceSorter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See LICENSE.md for further details

#include "GateVolumeID.hh"
#include "GateObjectStore.hh"
#include "GateSystemListManager.hh"


#include "GateCoincidenceSorterMessenger.hh"
Expand Down Expand Up @@ -665,7 +666,14 @@ G4int GateCoincidenceSorter::ComputeSectorID(const GateDigi& digi)
// Check whether a coincidence is invalid: ring difference or sector difference too small...
G4bool GateCoincidenceSorter::IsForbiddenCoincidence(const GateDigi* digi1, const GateDigi* digi2)
{
G4int blockID1 = m_system->GetMainComponentIDGND(digi1),

if(!GateSystemListManager::GetInstance()->GetIsAnySystemDefined())
{
// TODO GND define case if there is no system defiend!

}

G4int blockID1 = m_system->GetMainComponentIDGND(digi1),
blockID2 = m_system->GetMainComponentIDGND(digi2);

// Modif by D. Lazaro, February 25th, 2004
Expand Down Expand Up @@ -721,7 +729,8 @@ G4bool GateCoincidenceSorter::IsForbiddenCoincidence(const GateDigi* digi1, cons
G4int sectorDifference = std::min(sectorDiff1,sectorDiff2);

//Compare the sector difference with the minimum differences for valid coincidences
if (sectorDifference<m_minSectorDifference && !m_forceMinSecDifferenceToZero) {
if (sectorDifference<m_minSectorDifference && (digi1->GetSystemID()==digi2->GetSystemID())&& !m_forceMinSecDifferenceToZero ) {
//G4cout<<digi1->GetSystemID()<<" "<<digi2->GetSystemID()<<G4endl;
if (nVerboseLevel>1)
G4cout << "[GateCoincidenceSorter::IsForbiddenCoincidence]: coincidence between neighbour blocks --> refused\n";
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ void GateDigitizerInitializationModule::Digitize()
Digi->SetComptonVolumeName( (*inHC)[i]->GetComptonVolumeName() );
Digi->SetRayleighVolumeName( (*inHC)[i]->GetRayleighVolumeName() );
Digi->SetVolumeID( (*inHC)[i]->GetVolumeID() );
Digi->SetSystemID( (*inHC)[i]->GetSystemID() );
Digi->SetScannerPos( (*inHC)[i]->GetScannerPos() );
Digi->SetScannerRotAngle( (*inHC)[i]->GetScannerRotAngle() );
#ifdef GATE_USE_OPTICAL
Expand Down
6 changes: 3 additions & 3 deletions source/digits_hits/src/GateDigitizerMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ void GateDigitizerMerger::Digitize()
{
//GateDigiCollection* IDCerror = 0;
//G4String err = fDM->GetDigiCollection(m_DCID-1)->GetName();
//TODO add more clean error messege
GateError("***ERROR*** Wrong usage of Merger Digitizer Module: the Digi collection that you want to use doesn't exist yet (not digitized yet). The Merger must be inserted as a module of last called sensitive detector\n "
"Please, read the description here: XXXX \n\n");
GateError("***ERROR*** Wrong usage of Merger Digitizer Module: the Digi collection that you want to use doesn't exist yet (not digitized yet?). The Merger must be inserted as a module of last called sensitive detector\n "
"Please, read the description here: https://opengate.readthedocs.io/en/latest/digitizer_and_detector_modeling.html#id28 \n "
"It is also possible that your input collection is empty at the first event. This bug will be addressed soon. \n\n");
return;

}
Expand Down

0 comments on commit 2e90f2d

Please sign in to comment.