Skip to content
Snippets Groups Projects
Commit 1af0083c authored by FU Chengdong's avatar FU Chengdong
Browse files

remove hits while passing neutral particle

parent 0655a0be
No related branches found
No related tags found
No related merge requests found
...@@ -23,10 +23,11 @@ void GenericTrackerSensitiveDetector::Initialize(G4HCofThisEvent* HCE){ ...@@ -23,10 +23,11 @@ void GenericTrackerSensitiveDetector::Initialize(G4HCofThisEvent* HCE){
} }
G4bool GenericTrackerSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*){ G4bool GenericTrackerSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*){
G4TouchableHandle touchPost = step->GetPostStepPoint()->GetTouchableHandle(); G4TouchableHandle touchPost = step->GetPostStepPoint()->GetTouchableHandle();
G4TouchableHandle touchPre = step->GetPreStepPoint()->GetTouchableHandle(); G4TouchableHandle touchPre = step->GetPreStepPoint()->GetTouchableHandle();
dd4hep::sim::Geant4StepHandler h(step); dd4hep::sim::Geant4StepHandler h(step);
if (fabs(h.trackDef()->GetPDGCharge()) < 0.01) return true;
dd4hep::Position prePos = h.prePos(); dd4hep::Position prePos = h.prePos();
dd4hep::Position postPos = h.postPos(); dd4hep::Position postPos = h.postPos();
dd4hep::Position direction = postPos - prePos; dd4hep::Position direction = postPos - prePos;
......
...@@ -23,6 +23,8 @@ void TrackerCombineSensitiveDetector::Initialize(G4HCofThisEvent* HCE){ ...@@ -23,6 +23,8 @@ void TrackerCombineSensitiveDetector::Initialize(G4HCofThisEvent* HCE){
G4bool TrackerCombineSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*){ G4bool TrackerCombineSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*){
dd4hep::sim::Geant4StepHandler h(step); dd4hep::sim::Geant4StepHandler h(step);
if (fabs(h.trackDef()->GetPDGCharge()) < 0.01) return true;
bool return_code = false; bool return_code = false;
if ( userData.current == -1 ) userData.start(getCellID(step), step, h.pre); if ( userData.current == -1 ) userData.start(getCellID(step), step, h.pre);
else if ( !userData.track || userData.current != h.track->GetTrackID() ) { else if ( !userData.track || userData.current != h.track->GetTrackID() ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment