CMS 3D CMS Logo

MuonRpcFrameRotation Class Reference

implementation of FrameRotation for the muon rpc More...

#include <SimG4CMS/Muon/interface/MuonRpcFrameRotation.h>

Inheritance diagram for MuonRpcFrameRotation:

MuonFrameRotation

List of all members.

Public Member Functions

 MuonRpcFrameRotation (const DDCompactView &cpv)
virtual Local3DPoint transformPoint (Local3DPoint &, G4Step *) const
virtual ~MuonRpcFrameRotation ()

Private Attributes

MuonG4Numberingg4numbering
int theRegion


Detailed Description

implementation of FrameRotation for the muon rpc

Author:
Arno Straessner, CERN <arno.straessner@cern.ch>
Modification:

Definition at line 21 of file MuonRpcFrameRotation.h.


Constructor & Destructor Documentation

MuonRpcFrameRotation::MuonRpcFrameRotation ( const DDCompactView cpv  ) 

Definition at line 9 of file MuonRpcFrameRotation.cc.

References g4numbering, MuonDDDConstants::getValue(), and theRegion.

00009                                                                    : MuonFrameRotation::MuonFrameRotation(cpv) {
00010   g4numbering = new MuonG4Numbering(cpv);
00011   MuonDDDConstants muonConstants(cpv);
00012   int theLevelPart=muonConstants.getValue("level");
00013   theRegion=muonConstants.getValue("mr_region")/theLevelPart;
00014 }

MuonRpcFrameRotation::~MuonRpcFrameRotation (  )  [virtual]

Definition at line 16 of file MuonRpcFrameRotation.cc.

References g4numbering.

00016                                            {
00017   delete g4numbering;
00018 }


Member Function Documentation

Local3DPoint MuonRpcFrameRotation::transformPoint ( Local3DPoint point,
G4Step *  aStep = 0 
) const [virtual]

Implements MuonFrameRotation.

Definition at line 20 of file MuonRpcFrameRotation.cc.

References g4numbering, MuonBaseNumber::getSuperNo(), funct::num(), MuonG4Numbering::PhysicalVolumeToBaseNumber(), theRegion, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

00020                                                                                              {
00021   if (aStep) {
00022     //check if endcap
00023     G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
00024     G4TouchableHistory * theTouchable=(G4TouchableHistory *)
00025                                       (preStepPoint->GetTouchable());
00026     const G4ThreeVector trans=theTouchable->GetTranslation();
00027     
00028     //    G4VPhysicalVolume * pv = s->GetPreStepPoint()->GetPhysicalVolume();
00029 
00030     //old way with strings
00031     //string name=v->GetName();
00032     //string det_name=name(1,1);
00033     //bool endcap_muon=(det_name == "E");
00034     
00035     //new way with base number
00036     MuonBaseNumber num = g4numbering->PhysicalVolumeToBaseNumber(aStep);
00037     bool endcap_muon = (num.getSuperNo(theRegion)!=1);
00038     if (endcap_muon){
00039       if (trans.z()<0.) {
00040       //      return Local3DPoint(point.x(),point.y(),-point.z());
00041         return Local3DPoint(point.x(),-point.z(),point.y());
00042       } else {
00043         return Local3DPoint(point.x(),point.z(),-point.y());
00044       }
00045     } else {
00046       return point; 
00047     }
00048   } else {
00049     return Local3DPoint(0.,0.,0.);
00050   }
00051 }


Member Data Documentation

MuonG4Numbering* MuonRpcFrameRotation::g4numbering [private]

Definition at line 27 of file MuonRpcFrameRotation.h.

Referenced by MuonRpcFrameRotation(), transformPoint(), and ~MuonRpcFrameRotation().

int MuonRpcFrameRotation::theRegion [private]

Definition at line 28 of file MuonRpcFrameRotation.h.

Referenced by MuonRpcFrameRotation(), and transformPoint().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:47 2009 for CMSSW by  doxygen 1.5.4