Skip to content

Commit

Permalink
Fixing bug at virtual segmentation for hits at the back surface
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Granado committed Nov 28, 2024
1 parent c26b199 commit 21c0977
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/digits_hits/src/GateVirtualSegmentationSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ G4double GateVirtualSegmentationSD::calculatePitch(G4double crystal_size, G4doub
double min_diff = 999;
int num_pitches = 1;

if (std::fmod(crystal_size, target_pitch) == 0) return target_pitch;

while (true) {
double pitch = crystal_size / num_pitches;

Expand Down Expand Up @@ -334,8 +332,12 @@ void GateVirtualSegmentationSD::SetVirtualID( int nBins, double pitch, G4double


bin = std::floor(pos/pitch+nBins/2.);
if (bin == nBins) bin -=1;
if (bin < 0) bin = 0;
m_outputDigi->SetOutputVolumeID(bin,depth);

//std::cout<<"Pos at depth"<<depth<<" and nBins = "<<nBins<<" is = "<<pos<<" and the virtualID is = "<<bin<<std::endl;
//if (bin == nBins) std::cout<<"Pos at depth"<<depth<<" and nBins = "<<nBins<<" is = "<<pos<<" and the virtualID is = "<<bin<<std::endl;
}


Expand Down Expand Up @@ -558,4 +560,3 @@ void GateVirtualSegmentationSD::SetParameters()




0 comments on commit 21c0977

Please sign in to comment.