File indexing completed on 2024-04-06 12:30:10
0001 #include "SimG4CMS/Muon/interface/MuonEndcapFrameRotation.h"
0002 #include "SimG4Core/SensitiveDetector/interface/FrameRotation.h"
0003
0004 #include "G4Step.hh"
0005 #include "G4StepPoint.hh"
0006 #include "G4TouchableHistory.hh"
0007
0008 Local3DPoint MuonEndcapFrameRotation::transformPoint(const Local3DPoint& point, const G4Step* step) const {
0009 const G4StepPoint* preStepPoint = step->GetPreStepPoint();
0010 const G4TouchableHistory* theTouchable = (const G4TouchableHistory*)preStepPoint->GetTouchable();
0011 const G4ThreeVector& trans = theTouchable->GetTranslation();
0012
0013 return (trans.z() < 0) ? Local3DPoint(-point.x(), -point.z(), -point.y())
0014 : Local3DPoint(point.x(), point.z(), -point.y());
0015 }