Go to the documentation of this file.00001 #include "SimG4CMS/Muon/interface/MuonEndcapFrameRotation.h"
00002
00003 #include "G4StepPoint.hh"
00004 #include "G4TouchableHistory.hh"
00005
00006 Local3DPoint MuonEndcapFrameRotation::transformPoint(const Local3DPoint & point,const G4Step * s=0) const {
00007 if (!s)
00008 return Local3DPoint(0.,0.,0.);
00009
00010 const G4StepPoint * preStepPoint = s->GetPreStepPoint();
00011 const G4TouchableHistory * theTouchable = (const G4TouchableHistory *)preStepPoint->GetTouchable();
00012 const G4ThreeVector trans=theTouchable->GetTranslation();
00013
00014 if (trans.z()<0) {
00015
00016
00017 return Local3DPoint(-point.x(),-point.z(),-point.y());
00018 } else {
00019
00020 return Local3DPoint(point.x(),point.z(),-point.y());
00021 }
00022 }