Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:29:27

0001 #include "SimG4CMS/Muon/interface/MuonRPCFrameRotation.h"
0002 #include "SimG4CMS/Muon/interface/MuonG4Numbering.h"
0003 #include "Geometry/MuonNumbering/interface/MuonGeometryConstants.h"
0004 #include "Geometry/MuonNumbering/interface/MuonBaseNumber.h"
0005 
0006 #include "G4Step.hh"
0007 
0008 MuonRPCFrameRotation::MuonRPCFrameRotation(const MuonGeometryConstants& muonConstants,
0009                                            const MuonOffsetMap* offMap,
0010                                            bool dd4hep)
0011     : MuonFrameRotation::MuonFrameRotation() {
0012   g4numbering = new MuonG4Numbering(muonConstants, offMap, dd4hep);
0013   int theLevelPart = muonConstants.getValue("level");
0014   theRegion = muonConstants.getValue("mr_region") / theLevelPart;
0015 }
0016 
0017 MuonRPCFrameRotation::~MuonRPCFrameRotation() { delete g4numbering; }
0018 
0019 Local3DPoint MuonRPCFrameRotation::transformPoint(const Local3DPoint& point, const G4Step* aStep) const {
0020   //check if endcap
0021   MuonBaseNumber num = g4numbering->PhysicalVolumeToBaseNumber(aStep);
0022   bool endcap_muon = (num.getSuperNo(theRegion) != 1);
0023   return (endcap_muon) ? Local3DPoint(point.x(), point.z(), -point.y()) : Local3DPoint(point.x(), point.y(), point.z());
0024 }