CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
GloballyPositioned< T > Class Template Reference

#include <GloballyPositioned.h>

Classes

class  ToLocal
 

Public Types

typedef Point3DBase< T, GlobalTagGlobalPoint
 
typedef Vector3DBase< T,
GlobalTag
GlobalVector
 
typedef Point3DBase< T, LocalTagLocalPoint
 
typedef Vector3DBase< T, LocalTagLocalVector
 
typedef Point3DBase< T, GlobalTagPositionType
 
typedef TkRotation< TRotationType
 
typedef T Scalar
 

Public Member Functions

T eta () const
 
 GloballyPositioned (const PositionType &pos, const RotationType &rot)
 
void move (const GlobalVector &displacement)
 
T phi () const
 
const PositionTypeposition () const
 
void rotate (const RotationType &rotation)
 
const RotationTyperotation () const
 
GlobalPoint toGlobal (const LocalPoint &lp) const
 
template<class U >
Point3DBase< U, GlobalTagtoGlobal (const Point3DBase< U, LocalTag > &lp) const
 
GlobalVector toGlobal (const LocalVector &lv) const
 
template<class U >
Vector3DBase< U, GlobalTagtoGlobal (const Vector3DBase< U, LocalTag > &lv) const
 
LocalPoint toLocal (const GlobalPoint &gp) const
 
template<class U >
Point3DBase< U, LocalTagtoLocal (const Point3DBase< U, GlobalTag > &gp) const
 
LocalVector toLocal (const GlobalVector &gv) const
 
template<class U >
Vector3DBase< U, LocalTagtoLocal (const Vector3DBase< U, GlobalTag > &gv) const
 
virtual ~GloballyPositioned ()
 

Static Public Member Functions

static T iniEta ()
 
static T iniPhi ()
 

Private Member Functions

void resetCache ()
 
void setCache ()
 

Private Attributes

T theEta
 
T thePhi
 
PositionType thePos
 
RotationType theRot
 

Detailed Description

template<class T>
class GloballyPositioned< T >

Base class for surfaces and volumes positioned in global 3D space. This class defines a cartesian reference frame, called in the following the local frame. It provides position, orientation, and frame transformations for points and vectors.

Definition at line 18 of file GloballyPositioned.h.

Member Typedef Documentation

template<class T>
typedef Point3DBase<T,GlobalTag> GloballyPositioned< T >::GlobalPoint

Definition at line 24 of file GloballyPositioned.h.

template<class T>
typedef Vector3DBase<T,GlobalTag> GloballyPositioned< T >::GlobalVector

Definition at line 26 of file GloballyPositioned.h.

template<class T>
typedef Point3DBase<T,LocalTag> GloballyPositioned< T >::LocalPoint

Definition at line 25 of file GloballyPositioned.h.

template<class T>
typedef Vector3DBase<T,LocalTag> GloballyPositioned< T >::LocalVector

Definition at line 27 of file GloballyPositioned.h.

template<class T>
typedef Point3DBase<T,GlobalTag> GloballyPositioned< T >::PositionType

Definition at line 22 of file GloballyPositioned.h.

template<class T>
typedef TkRotation<T> GloballyPositioned< T >::RotationType

Definition at line 23 of file GloballyPositioned.h.

template<class T>
typedef T GloballyPositioned< T >::Scalar

Definition at line 21 of file GloballyPositioned.h.

Constructor & Destructor Documentation

template<class T>
GloballyPositioned< T >::GloballyPositioned ( const PositionType pos,
const RotationType rot 
)
inline
template<class T>
virtual GloballyPositioned< T >::~GloballyPositioned ( )
inlinevirtual

Definition at line 39 of file GloballyPositioned.h.

39 {}

Member Function Documentation

template<class T>
T GloballyPositioned< T >::eta ( ) const
inline

Definition at line 49 of file GloballyPositioned.h.

Referenced by TrajectoryFactoryBase::sameSurface().

49  {
50  if (theEta==iniEta()) theEta = thePos.eta();
51  return theEta;
52  }
T eta() const
Definition: PV3DBase.h:75
template<class T>
static T GloballyPositioned< T >::iniEta ( )
inlinestatic

Definition at line 32 of file GloballyPositioned.h.

Referenced by GloballyPositioned< align::Scalar >::eta(), and GloballyPositioned< align::Scalar >::resetCache().

32  {
33  return 999.9978;
34  }
template<class T>
static T GloballyPositioned< T >::iniPhi ( )
inlinestatic

Definition at line 29 of file GloballyPositioned.h.

Referenced by GloballyPositioned< align::Scalar >::phi(), and GloballyPositioned< align::Scalar >::resetCache().

29  {
30  return 999.9978;
31  }
template<class T>
void GloballyPositioned< T >::move ( const GlobalVector displacement)
inline
template<class T>
T GloballyPositioned< T >::phi ( ) const
inline
template<class T>
const PositionType& GloballyPositioned< T >::position ( ) const
inline

Definition at line 41 of file GloballyPositioned.h.

Referenced by MuonNavigationSchool::addEndcapLayer(), MuonTkNavigationSchool::addEndcapLayer(), SiStripCalibLorentzAngle::algoBeginJob(), MuonGeometrySVGTemplate::analyze(), TestHits::analyze(), TestTrackHits::analyze(), SiPixelErrorEstimation::analyze(), GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), GeomDetLess::barrelForwardLess(), MagGeoBuilderFromDDD::buildInterpolator(), MagGeoBuilderFromDDD::buildMagVolumes(), DirectMuonNavigation::checkCompatible(), DirectTrackerNavigation::checkCompatible(), MuDetRing::compatible(), MuRodBarrelLayer::compatibleDets(), MuDetRing::compatibleDets(), MuDetRod::compatibleDets(), NavVolume6Faces::computeBounds(), TIBLayer::computeCrossings(), PixelForwardLayer::computeCrossings(), TIBRing::computeCrossings(), TIBRing::computeHelicity(), PixelCPEBase::computeLorentzShifts(), BladeShapeBuilderFromDet::computeRotation(), MuRingForwardDoubleLayer::computeSurface(), AlignableSiStripDet::consistifyAlignments(), ThreePlaneCrossing::crossing(), MuonShowerInformationFiller::crossingPoint(), BeamHaloPropagator::crossingTk(), TIBLayer::cylinder(), MultipleScatteringGeometry::detLayers(), DTDigiSyncTOFCorr::digitizerOffset(), shallow::drift(), StripCPE::driftDirection(), SiHitDigitizer::DriftDirection(), PixelCPEBase::driftDirection(), SiPixelDigitizerAlgorithm::DriftDirection(), MuonPatternRecoDumper::dumpLayer(), cms::HICSeedMeasurementEstimator::estimate(), EtaPhiMeasurementEstimator::estimate(), HICMeasurementEstimator::estimate(), PropagateToMuon::extrapolate(), RoadSearchTrackCandidateMakerAlgorithm::extrapolateTrajectory(), HIPAlignmentAlgorithm::fillRoot(), FWRecoGeometryESProducer::fillShapeAndPlacement(), DTTimingExtractor::fillTiming(), CSCEfficiency::filter(), KFTrajectoryFitter::fit(), SiTrackerGaussianSmearingRecHitConverter::gaussianSmearing(), HICMeasurementEstimator::getDetectorCode(), ClusterShapeHitFilter::getDrift(), Alignable::globalPosition(), SeedFromProtoTrack::init(), ConvBremSeedProducer::initializeLayerMap(), TrajectoryManager::initializeLayerMap(), CSCStripElectronicsSim::initParameters(), GeomDetLess::insideOutLess(), SmartPropagator::insideTkVol(), SteppingHelixPropagator::isYokeVolume(), StripCPEfromTemplate::localParameters(), PixelCPETemplateReco::localPosition(), PixelCPEGeneric::localPosition(), PixelCPEBase::lorentzShiftX(), PixelCPEBase::lorentzShiftY(), OutInConversionSeedFinder::makeEstimator(), TSGForRoadSearch::makeSeeds_3(), TrajectoryManager::makeSinglePSimHit(), MagGeoBuilderFromDDD::volumeHandle::maxPhi(), MagGeoBuilderFromDDD::volumeHandle::maxZ(), MagGeoBuilderFromDDD::volumeHandle::minZ(), GlobalTrackerMuonAlignment::misalignMuonL(), MuRingForwardDoubleLayer::MuRingForwardDoubleLayer(), MuRingForwardLayer::MuRingForwardLayer(), DTTTrigSyncFromDB::offset(), DTTTrigSyncTOFCorr::offset(), ForwardDiskSectorBuilderFromWedges::operator()(), ForwardDiskSectorBuilderFromDet::operator()(), MuonDetLayerComp::operator()(), CylinderBuilderFromDet::operator()(), CompositeTECPetal::overlap(), TIDLayer::overlapInR(), HelixForwardPlaneCrossing::pathLength(), HelixArbitraryPlaneCrossing::pathLength(), StraightLinePlaneCrossing::pathLength(), PixelForwardLayer::PixelForwardLayer(), GeometricSearchDet::position(), SurveyDet::position(), GeomDet::position(), MuonNavigationPrinter::printLayer(), MuonNavigationPrinter::printLayers(), GlobalMuonToMuonProducer::printTrackRecHits(), ShallowTrackClustersProducer::produce(), TrackingRecHitProjector< ResultingHit >::project(), GSRecHitMatcher::projectOnly(), cms::HICMuonPropagator::propagate(), cms::FastMuPropagator::propagate(), Geant4ePropagator::propagate(), CachedTrajectory::propagate(), SteppingHelixPropagator::propagate(), NavPropagator::propagateInVolume(), RKPropagatorInS::propagateParametersOnCylinder(), AnalyticalPropagator::propagateParametersOnCylinder(), RKPropagatorInS::propagateParametersOnPlane(), NavPropagator::propagateWithPath(), AnalyticalPropagator::propagateWithPath(), CSCPairResidualsConstraint::radius(), CSCEfficiency::recHitSegment_Efficiencies(), SteppingHelixPropagator::refToMagVolume(), KFBasedPixelFitter::run(), MagGeoBuilderFromDDD::volumeHandle::sameSurface(), TrajectoryFactoryBase::sameSurface(), HICMeasurementEstimator::setCuts(), ParticlePropagator::setPropagationConditions(), MagGeoBuilderFromDDD::volumeHandle::setSurface(), PixelCPEBase::setTheDet(), CSCPairResidualsConstraint::setZplane(), TrackClusterSplitter::splitCluster(), FrameChanger::toFrame(), GloballyPositioned< align::Scalar >::toGlobal(), GloballyPositioned< align::Scalar >::toLocal(), LaserDQM::trackerStatistics(), FrameChanger::transformPlane(), and AlignableDataIO::writeAbsPos().

41 { return thePos;}
template<class T>
void GloballyPositioned< T >::resetCache ( )
inlineprivate

Definition at line 172 of file GloballyPositioned.h.

Referenced by GloballyPositioned< align::Scalar >::GloballyPositioned(), GloballyPositioned< align::Scalar >::move(), and GloballyPositioned< align::Scalar >::rotate().

172  {
173  if ((thePos.x() == 0.) && (thePos.y() == 0.)) {
174  thePhi = theEta = 0.; // avoid FPE
175  } else {
176  thePhi = iniPhi();
177  theEta = iniEta();
178  }
179  }
T y() const
Definition: PV3DBase.h:62
T x() const
Definition: PV3DBase.h:61
template<class T>
void GloballyPositioned< T >::rotate ( const RotationType rotation)
inline

Rotate the frame in the global frame. Useful e.g. for alignment.

Definition at line 161 of file GloballyPositioned.h.

Referenced by AlignableBeamSpot::initialize(), AlignableDetUnit::rotateInGlobalFrame(), AlignableBeamSpot::rotateInGlobalFrame(), and AlignableComposite::rotateInGlobalFrame().

161  {
162  theRot *= rotation;
163  resetCache();
164  }
const RotationType & rotation() const
template<class T>
const RotationType& GloballyPositioned< T >::rotation ( void  ) const
inline
template<class T>
void GloballyPositioned< T >::setCache ( )
inlineprivate

Definition at line 182 of file GloballyPositioned.h.

182  {
183  if ((thePos.x() == 0.) && (thePos.y() == 0.)) {
184  thePhi = theEta = 0.; // avoid FPE
185  } else {
186  thePhi = thePos.barePhi();
187  theEta = thePos.eta();
188  }
189  }
T y() const
Definition: PV3DBase.h:62
T barePhi() const
Definition: PV3DBase.h:67
T eta() const
Definition: PV3DBase.h:75
T x() const
Definition: PV3DBase.h:61
template<class T>
GlobalPoint GloballyPositioned< T >::toGlobal ( const LocalPoint lp) const
inline

Transform a local point (i.e. a point with coordinates in the local frame) to the global frame

Definition at line 82 of file GloballyPositioned.h.

Referenced by RKPropagatorInS::globalMomentum(), RKPropagatorInS::globalPosition(), RKLocalFieldProvider::inTesla(), PathToPlane2Order::operator()(), RKPropagatorInS::propagateParametersOnPlane(), SpecialCylindricalMFGrid::toGridFrame(), TrapezoidalCartesianMFGrid::TrapezoidalCartesianMFGrid(), and GlobalGridWrapper::valueInTesla().

82  {
83  return GlobalPoint( rotation().multiplyInverse( lp.basicVector()) +
84  position().basicVector());
85  }
Point3DBase< T, GlobalTag > GlobalPoint
const RotationType & rotation() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
template<class T>
template<class U >
Point3DBase< U, GlobalTag> GloballyPositioned< T >::toGlobal ( const Point3DBase< U, LocalTag > &  lp) const
inline

Transform a local point with different float precision from the one of the reference frame, and return a global point with the same precision as the input one.

Definition at line 93 of file GloballyPositioned.h.

93  {
95  position().basicVector());
96  }
const RotationType & rotation() const
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
template<class T>
GlobalVector GloballyPositioned< T >::toGlobal ( const LocalVector lv) const
inline

Transform a local vector (i.e. a vector with coordinates in the local frame) to the global frame

Definition at line 101 of file GloballyPositioned.h.

101  {
102  return GlobalVector( rotation().multiplyInverse( lv.basicVector()));
103  }
Vector3DBase< T, GlobalTag > GlobalVector
const RotationType & rotation() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
template<class T>
template<class U >
Vector3DBase< U, GlobalTag> GloballyPositioned< T >::toGlobal ( const Vector3DBase< U, LocalTag > &  lv) const
inline

Transform a local vector with different float precision from the one of the reference frame, and return a global vector with the same precision as the input one.

Definition at line 111 of file GloballyPositioned.h.

111  {
113  }
const RotationType & rotation() const
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
template<class T>
LocalPoint GloballyPositioned< T >::toLocal ( const GlobalPoint gp) const
inline

Transform a global point (i.e. a point with coordinates in the global frame) to the local frame

Definition at line 118 of file GloballyPositioned.h.

Referenced by RPCEfficiency::analyze(), TSiStripMatchedRecHit::clone(), TkGluedMeasurementDet::collectRecHits(), RodPlaneBuilderFromDet::computeBounds(), BladeShapeBuilderFromDet::computeBounds(), NavVolume6Faces::computeBounds(), TSiStripMatchedRecHit::ComputeCoarseLocalPosition(), PixelForwardLayer::computeCrossings(), PlaneBuilderForGluedDet::computeRectBounds(), GsfConstraintAtVertex::constrainAtPoint(), BasicTrajectoryState::createLocalParameters(), CSCSegtoRPC::CSCSegtoRPC(), DTSegtoRPC::DTSegtoRPC(), DTTrigGeomUtils::DTTrigGeomUtils(), RoadSearchCloudMakerAlgorithm::FillRecHitsIntoCloudGeneral(), SpecialCylindricalMFGrid::fromGridFrame(), DTTrigGeom::getGeom(), TrackDetectorAssociator::getTAMuonChamberMatches(), HelixBarrelCylinderCrossing::HelixBarrelCylinderCrossing(), HelixBarrelPlaneCrossing2OrderLocal::HelixBarrelPlaneCrossing2OrderLocal(), RKLocalFieldProvider::inTesla(), SteppingHelixPropagator::loadState(), DTTrigGeom::localPosition(), SiTrackerGaussianSmearingRecHitConverter::matchHits(), OuterDetCompatibility::maximalLocalDisplacement(), PathToPlane2Order::operator()(), TOBRod::overlap(), PixelBlade::overlap(), DTDigitizer::produce(), TrackingRecHitProjector< ResultingHit >::project(), TestHits::projectHit(), TestSmoothHits::projectHit(), TestTrackHits::projectHit(), SiStripTrackingRecHitsValid::projectHit(), SiStripRecHitsValid::projectHit(), GlobalRecHitsAnalyzer::projectHit(), GlobalRecHitsProducer::projectHit(), GSRecHitMatcher::projectOnly(), RKPropagatorInZ::propagate(), RKPropagatorInR::propagate(), Geant4ePropagator::propagate(), Propagator::propagate(), RKPropagatorInS::propagateParametersOnCylinder(), RKPropagatorInS::propagateParametersOnPlane(), StraightLinePropagator::propagateParametersOnPlane(), RectangularCartesianMFGrid::RectangularCartesianMFGrid(), RectangularCylindricalMFGrid::RectangularCylindricalMFGrid(), RKPropagatorInS::rkMomentum(), RKPropagatorInS::rkPosition(), MagGeoBuilderFromDDD::volumeHandle::sameSurface(), CSCPairResidualsConstraint::setZplane(), SpecialCylindricalMFGrid::SpecialCylindricalMFGrid(), TkGluedMeasurementDet::testStrips(), FrameChanger::toFrame(), NavSurface::toLocal(), GeomDet::toLocal(), DTTrigGeom::toLocal(), toLocal(), FrameChanger::transformPlane(), TrapezoidalCartesianMFGrid::TrapezoidalCartesianMFGrid(), TrapezoidalCylindricalMFGrid::TrapezoidalCylindricalMFGrid(), DTTrigGeom::tubePosInCh(), and TrapezoidalCylindricalMFGrid::uncheckedValueInTesla().

118  {
119  return LocalPoint( rotation() * (gp.basicVector()-position().basicVector()));
120  }
Point3DBase< T, LocalTag > LocalPoint
const RotationType & rotation() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
template<class T>
template<class U >
Point3DBase< U, LocalTag> GloballyPositioned< T >::toLocal ( const Point3DBase< U, GlobalTag > &  gp) const
inline

Transform a global point with different float precision from the one of the reference frame, and return a local point with the same precision as the input one.

Definition at line 128 of file GloballyPositioned.h.

128  {
130  (gp.basicVector()-position().basicVector()));
131  }
const RotationType & rotation() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
template<class T>
LocalVector GloballyPositioned< T >::toLocal ( const GlobalVector gv) const
inline

Transform a global vector (i.e. a vector with coordinates in the global frame) to the local frame

Definition at line 136 of file GloballyPositioned.h.

136  {
137  return LocalVector( rotation() * gv.basicVector());
138  }
Vector3DBase< T, LocalTag > LocalVector
const RotationType & rotation() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
template<class T>
template<class U >
Vector3DBase< U, LocalTag> GloballyPositioned< T >::toLocal ( const Vector3DBase< U, GlobalTag > &  gv) const
inline

Transform a global vector with different float precision from the one of the reference frame, and return a local vector with the same precision as the input one.

Definition at line 146 of file GloballyPositioned.h.

146  {
148  }
const RotationType & rotation() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56

Member Data Documentation

template<class T>
T GloballyPositioned< T >::theEta
mutableprivate
template<class T>
T GloballyPositioned< T >::thePhi
mutableprivate
template<class T>
PositionType GloballyPositioned< T >::thePos
private
template<class T>
RotationType GloballyPositioned< T >::theRot
private