Skip to content

Commit 32af628

Browse files
authored
Merge pull request #713 from granadogmarc/MonolithicCrystal
Monolithic crystal
2 parents 27f0273 + 21c0977 commit 32af628

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/digits_hits/src/GateVirtualSegmentationSD.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,12 @@ void GateVirtualSegmentationSD::SetVirtualID( int nBins, double pitch, G4double
332332

333333

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

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

339343

@@ -556,4 +560,3 @@ void GateVirtualSegmentationSD::SetParameters()
556560

557561

558562

559-

0 commit comments

Comments
 (0)