diff --git a/src/PMTSD.cc b/src/PMTSD.cc index ead1631bbfa2220c8da587a6083be4e9447cf44e..099337a126bc24f28722e13f8147bf1067689596 100644 --- a/src/PMTSD.cc +++ b/src/PMTSD.cc @@ -116,9 +116,11 @@ G4bool PMTSD::ProcessHits(G4Step* aStep,G4TouchableHistory*){ // Fill ouput vectors if(INTERMEDIATE){ - m_PtrVec[0]->push_back( hitPos.x() ); //Where the photon landed on the PMT in x - m_PtrVec[1]->push_back( hitPos.y() ); //Where the photon landed on the PMT in y - m_PtrVec[2]->push_back( hitPos.z() ); //Where the photon landed on the PMT in z + if(momentum.y() < 0.0){ + m_PtrVec[0]->push_back( hitPos.x() ); //Where the photon landed on the SD in x + m_PtrVec[1]->push_back( hitPos.y() ); //Where the photon landed on the SD in y + m_PtrVec[2]->push_back( hitPos.z() ); //Where the photon landed on the SD in z + } }else{ m_PtrVec[0]->push_back( origin.x() ); //Origin of the photon in x m_PtrVec[1]->push_back( origin.y() ); //Origin of the photon in y