CMS 3D CMS Logo

Public Member Functions | Private Attributes

MuonGemFrameRotation Class Reference

#include <MuonGemFrameRotation.h>

Inheritance diagram for MuonGemFrameRotation:
MuonFrameRotation

List of all members.

Public Member Functions

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

Private Attributes

MuonG4Numberingg4numbering
int theSectorLevel

Detailed Description

implementation of FrameRotation for the muon gem

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

Modification:

Definition at line 21 of file MuonGemFrameRotation.h.


Constructor & Destructor Documentation

MuonGemFrameRotation::MuonGemFrameRotation ( const DDCompactView cpv)

Definition at line 10 of file MuonGemFrameRotation.cc.

References gather_cfg::cout, g4numbering, MuonDDDConstants::getValue(), and theSectorLevel.

                                                                   : MuonFrameRotation::MuonFrameRotation(cpv) {
  g4numbering     = new MuonG4Numbering(cpv);
  MuonDDDConstants muonConstants(cpv);
  int theLevelPart= muonConstants.getValue("level");
  theSectorLevel  = muonConstants.getValue("mg_sector")/theLevelPart;
#ifdef LOCAL_DEBUG
  std::cout << "MuonGemFrameRotation: theSectorLevel " << theSectorLevel 
            << std::endl;
#endif
}
MuonGemFrameRotation::~MuonGemFrameRotation ( ) [virtual]

Definition at line 21 of file MuonGemFrameRotation.cc.

References g4numbering.

                                            {
  delete g4numbering;
}

Member Function Documentation

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

Implements MuonFrameRotation.

Definition at line 25 of file MuonGemFrameRotation.cc.

References gather_cfg::cout, g4numbering, MuonBaseNumber::getBaseNo(), MuonG4Numbering::PhysicalVolumeToBaseNumber(), theSectorLevel, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

                                                                                                         {
  if (!aStep) return Local3DPoint(0.,0.,0.);  

  //check if it is rotated
#ifdef LOCAL_DEBUG
  std::cout << "Position " << aStep->GetPreStepPoint()->GetPosition() << std::endl;
#endif
  MuonBaseNumber num = g4numbering->PhysicalVolumeToBaseNumber(aStep);
  bool rotated       = (num.getBaseNo(theSectorLevel)>=50);
#ifdef LOCAL_DEBUG
  std::cout << "MuonGemFrameRotation num " << num.getBaseNo(theSectorLevel)
            << " Rotation " << rotated << std::endl;
#endif
  if (rotated) {
    return Local3DPoint(-point.x(),point.z(),point.y());
  } else {
    return Local3DPoint(point.x(),point.z(),-point.y());
  }
}

Member Data Documentation

Definition at line 30 of file MuonGemFrameRotation.h.

Referenced by MuonGemFrameRotation(), and transformPoint().