CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/SimG4CMS/Muon/src/MuonEndcapFrameRotation.cc

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(Local3DPoint & point,G4Step * s=0) const {
00007   if (s) {
00008     G4StepPoint * preStepPoint = s->GetPreStepPoint();
00009     G4TouchableHistory * theTouchable=(G4TouchableHistory *)
00010                                       (preStepPoint->GetTouchable());
00011     const G4ThreeVector trans=theTouchable->GetTranslation();
00012     
00013     if (trans.z()<0) {
00014       //      return Local3DPoint(point.x(),-point.z(),point.y());
00015       //      return Local3DPoint(-point.x(),point.z(),-point.y());
00016       return Local3DPoint(-point.x(),-point.z(),-point.y());
00017     } else {
00018       //      return Local3DPoint(point.x(),point.z(),-point.y());
00019       return Local3DPoint(point.x(),point.z(),-point.y());
00020     }
00021   } else {
00022     return Local3DPoint(0.,0.,0.);
00023   }
00024 }