Skip to content

Commit

Permalink
fix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Oct 9, 2024
1 parent e02b7d4 commit 5006a4c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/TRestGeant4Track.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ void TRestGeant4Track::PrintTrack(size_t maxHits) const {
<< (GetParentTrack() != nullptr
? TString::Format(" - Parent particle: %s", GetParentTrack()->GetParticleName().Data()).Data()
: "")
<< " - Created by '" << fCreatorProcess
<< "' with initial "
"KE of "
<< ToEnergyString(fInitialKineticEnergy) << "" << endl;
<< " - Created by '" << fCreatorProcess << "' in volume '" << GetInitialVolume()
<< "' with initial KE of " << ToEnergyString(fInitialKineticEnergy) << " - Initial position "
<< VectorToString(fInitialPosition) << " mm at time " << ToTimeString(fGlobalTimestamp)
<< " - Time length of " << ToTimeString(fTimeLength) << " and spatial length of "
<< ToLengthString(fLength) << endl;

cout << " Initial position " << VectorToString(fInitialPosition) << " mm at time "
<< ToTimeString(fGlobalTimestamp) << " - Time length of " << ToTimeString(fTimeLength)
Expand Down Expand Up @@ -187,11 +188,10 @@ void TRestGeant4Track::PrintTrackFilterVolumes(const std::set<std::string>& volu
? TString::Format(" - Parent particle: %s", GetParentTrack()->GetParticleName().Data()).Data()
: "")
<< " - Created by '" << fCreatorProcess << "' in volume '" << GetInitialVolume()
<< "' with initial KE of " << ToEnergyString(fInitialKineticEnergy) << "" << endl;

cout << " Initial position " << VectorToString(fInitialPosition) << " mm at time "
<< ToTimeString(fGlobalTimestamp) << " - Time length of " << ToTimeString(fTimeLength)
<< " and spatial length of " << ToLengthString(fLength) << endl;
<< "' with initial KE of " << ToEnergyString(fInitialKineticEnergy) << " - Initial position "
<< VectorToString(fInitialPosition) << " mm at time " << ToTimeString(fGlobalTimestamp)
<< " - Time length of " << ToTimeString(fTimeLength) << " and spatial length of "
<< ToLengthString(fLength) << endl;

for (unsigned int i = 0; i < GetNumberOfHits(); i++) {
TString processName = GetProcessName(fHits.GetHitProcess(i));
Expand All @@ -205,6 +205,9 @@ void TRestGeant4Track::PrintTrackFilterVolumes(const std::set<std::string>& volu
// in case process name is not found, use ID
volumeName = TString(std::to_string(fHits.GetHitVolume(i)));
}
if (volumeNames.find(volumeName.Data()) == volumeNames.end()) {
continue;
}
cout << " - Hit " << i << " - Energy: " << ToEnergyString(fHits.GetEnergy(i))
<< " - Process: " << processName << " - Volume: " << volumeName
<< " - Position: " << VectorToString(TVector3(fHits.GetX(i), fHits.GetY(i), fHits.GetZ(i)))
Expand Down

0 comments on commit 5006a4c

Please sign in to comment.