Skip to content

Commit

Permalink
Merge pull request #641 from tontyoutoure/likun_fix_mfd
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarrut committed Oct 25, 2023
2 parents 07f892c + b8125f7 commit 46d5657
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions source/digits_hits/include/GateActorManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,21 @@ private:
static GateActorManager *singleton_ActorManager;
};

/*!
Empty SD class doing nothing for removing existing SD from G4SDManager
*/
// Created by tontyoutoure@gmail.com 2023/10/24

class GateEmptySD : public G4VSensitiveDetector
{

public:
//! Constructor.
//! The argument is the name of the sensitive detector
GateEmptySD(const G4String& name):G4VSensitiveDetector(name){Activate(false);}

//! Reinplementation is mendatory.
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) override {return true;}
};

#endif /* end #define GATEACTORMANAGER_HH */
2 changes: 1 addition & 1 deletion source/digits_hits/src/GateActorManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void GateActorManager::SetMultiFunctionalDetector(GateVActor * actor, GateVVolum
G4String detectorName2 = "MSD_"+ num.str();

// Remove attached SD by replacing with a deactivated clone SD
G4VSensitiveDetector* replacementSD = volume->GetLogicalVolume()->GetSensitiveDetector()->Clone();
G4VSensitiveDetector* replacementSD = new GateEmptySD(volume->GetLogicalVolume()->GetSensitiveDetector()->GetName());
G4SDManager::GetSDMpointer()->AddNewDetector(replacementSD);
replacementSD->Activate(false);

Expand Down

0 comments on commit 46d5657

Please sign in to comment.