CMS 3D CMS Logo

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, GlobalTagGlobalVector
 
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 ()
 
 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 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

◆ GlobalPoint

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

Definition at line 23 of file GloballyPositioned.h.

◆ GlobalVector

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

Definition at line 25 of file GloballyPositioned.h.

◆ LocalPoint

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

Definition at line 24 of file GloballyPositioned.h.

◆ LocalVector

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

Definition at line 26 of file GloballyPositioned.h.

◆ PositionType

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

Definition at line 21 of file GloballyPositioned.h.

◆ RotationType

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

Definition at line 22 of file GloballyPositioned.h.

◆ Scalar

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

Definition at line 20 of file GloballyPositioned.h.

Constructor & Destructor Documentation

◆ GloballyPositioned() [1/2]

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

Definition at line 31 of file GloballyPositioned.h.

31 { setCache(); }

◆ GloballyPositioned() [2/2]

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

◆ ~GloballyPositioned()

template<class T>
virtual GloballyPositioned< T >::~GloballyPositioned ( )
inlinevirtual

Definition at line 34 of file GloballyPositioned.h.

34 {}

Member Function Documentation

◆ eta()

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

◆ iniEta()

template<class T>
static T GloballyPositioned< T >::iniEta ( )
inlinestatic

Definition at line 29 of file GloballyPositioned.h.

29 { return 999.9978; }

◆ iniPhi()

template<class T>
static T GloballyPositioned< T >::iniPhi ( )
inlinestatic

Definition at line 28 of file GloballyPositioned.h.

28 { return 999.9978; }

◆ move()

template<class T>
void GloballyPositioned< T >::move ( const GlobalVector displacement)
inline

Move the position of the frame in the global frame.
Useful e.g. for alignment.

Definition at line 128 of file GloballyPositioned.h.

Referenced by AlignableComposite::addComponent(), AlignableBeamSpot::initialize(), AlignableDetUnit::move(), AlignableBeamSpot::move(), AlignableComposite::move(), Alignable::recenterSurface(), and Alignable::updateMother().

128  {
129  thePos += displacement;
130  setCache();
131  }

◆ phi()

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

◆ position()

template<class T>
const PositionType& GloballyPositioned< T >::position ( ) const
inline

Definition at line 36 of file GloballyPositioned.h.

Referenced by cms::Phase2TrackerDigitizer::accumulatePixelHits(), SiStripCalibLorentzAngle::algoBeginJob(), SiPixelBadModuleReader::analyze(), TestHits::analyze(), TestTrackHits::analyze(), SiPixelErrorEstimation::analyze(), SiPixelLorentzAnglePCLWorker::analyze(), GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), magneticfield::InterpolatorBuilder::build(), magneticfield::MagGeoBuilder::buildInterpolator(), MagGeoBuilderFromDDD::buildInterpolator(), magneticfield::MagGeoBuilder::buildMagVolumes(), MagGeoBuilderFromDDD::buildMagVolumes(), MTDTrayBarrelLayer::compatibleDets(), MuRodBarrelLayer::compatibleDets(), MTDDetRing::compatibleDets(), MuDetRing::compatibleDets(), MTDDetTray::compatibleDets(), MuDetRod::compatibleDets(), TIBRing::computeCrossings(), TIBRing::computeHelicity(), TIBLayer::computeIndexes(), Phase1PixelBlade::computeRadiusRanges(), AlignableStackDet::consistifyAlignments(), AlignableSiStripDet::consistifyAlignments(), fastsim::TrackerSimHitProducer::createHitOnDetector(), BeamHaloPropagator::crossingTk(), shallow::drift(), Phase2TrackerDigitizerAlgorithm::drift(), StripCPE::driftDirection(), Phase2StripCPE::driftDirection(), SiHitDigitizer::DriftDirection(), Phase2TrackerDigitizerAlgorithm::driftDirection(), PixelCPEBase::driftDirection(), SiPixelDigitizerAlgorithm::DriftDirection(), Pixel3DDigitizerAlgorithm::driftFor3DSensors(), EtaPhiMeasurementEstimator::estimate(), fastProp(), ApeEstimator::fillHitVariables(), FWRecoGeometryESProducer::fillShapeAndPlacement(), DTTimingExtractor::fillTiming(), CSCEfficiency::filter(), ClusterShapeHitFilter::getDrift(), SiStripLorentzAngleRunInfoTableProducer::globalBeginRunProduce(), Alignable::globalPosition(), SeedFromProtoTrack::init(), CSCStripElectronicsSim::initParameters(), SmartPropagator::insideTkVol(), SteppingHelixPropagator::isYokeVolume(), OutInConversionSeedFinder::makeEstimator(), TSGForRoadSearch::makeSeeds_3(), magneticfield::BaseVolumeHandle::maxPhi(), magneticfield::BaseVolumeHandle::maxZ(), magneticfield::BaseVolumeHandle::minZ(), GlobalTrackerMuonAlignment::misalignMuonL(), DTTTrigSyncFromDB::offset(), MTDDiskSectorBuilderFromDet::operator()(), ForwardDiskSectorBuilderFromWedges::operator()(), ForwardDiskSectorBuilderFromDet::operator()(), MuonDetLayerComp::operator()(), CylinderBuilderFromDet::operator()(), HelixArbitraryPlaneCrossing::pathLength(), HelixForwardPlaneCrossing::pathLength(), StraightLinePlaneCrossing::pathLength(), PixelForwardLayer::PixelForwardLayer(), PixelForwardLayerPhase1::PixelForwardLayerPhase1(), GeometricSearchDet::position(), SurveyDet::position(), GeomDet::position(), GlobalMuonToMuonProducer::printTrackRecHits(), ShallowTrackClustersProducer::produce(), CachedTrajectory::propagate(), SteppingHelixPropagator::propagate(), RKPropagatorInS::propagateParametersOnCylinder(), AnalyticalPropagator::propagateParametersOnCylinder(), RKPropagatorInS::propagateParametersOnPlane(), CSCPairResidualsConstraint::radius(), magneticfield::volumeHandle::referencePlane(), SteppingHelixPropagator::refToMagVolume(), TrajectoryFactoryBase::sameSurface(), CSCPairResidualsConstraint::setZplane(), HIPAlignmentAlgorithm::terminate(), FrameChanger::toFrame(), GloballyPositioned< align::Scalar >::toGlobal(), GloballyPositioned< align::Scalar >::toLocal(), LaserDQM::trackerStatistics(), FrameChanger::transformPlane(), Geant4ePropagator::transformToG4SurfaceTarget(), SiTrackerMultiRecHitUpdator::update(), Alignable::update(), and AlignableDataIO::writeAbsPos().

36 { return thePos; }

◆ rotate()

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 136 of file GloballyPositioned.h.

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

136  {
137  theRot *= rotation;
138  setCache();
139  }
const RotationType & rotation() const

◆ rotation()

template<class T>
const RotationType& GloballyPositioned< T >::rotation ( void  ) const
inline

Definition at line 38 of file GloballyPositioned.h.

Referenced by GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), magneticfield::bLayer::bLayer(), magneticfield::InterpolatorBuilder::build(), magneticfield::MagGeoBuilder::buildInterpolator(), MagGeoBuilderFromDDD::buildInterpolator(), magneticfield::MagGeoBuilder::buildMagVolumes(), MagGeoBuilderFromDDD::buildMagVolumes(), AlignableStackDet::consistifyAlignments(), AlignableSiStripDet::consistifyAlignments(), SiHitDigitizer::DriftDirection(), Phase2TrackerDigitizerAlgorithm::driftDirection(), PixelCPEBase::driftDirection(), SiPixelDigitizerAlgorithm::DriftDirection(), FWRecoGeometryESProducer::fillShapeAndPlacement(), Alignable::globalRotation(), JacobianCartesianToLocal::JacobianCartesianToLocal(), JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(), JacobianLocalToCartesian::JacobianLocalToCartesian(), JacobianLocalToCurvilinear::JacobianLocalToCurvilinear(), GlobalTrackerMuonAlignment::misalignMuonL(), SteppingHelixPropagator::propagate(), SteppingHelixPropagator::refToMagVolume(), GloballyPositioned< align::Scalar >::rotate(), SurveyDet::rotation(), GeomDet::rotation(), tt::SensorModule::SensorModule(), FrameChanger::toFrame(), GloballyPositioned< align::Scalar >::toGlobal(), GloballyPositioned< align::Scalar >::toLocal(), ErrorFrameTransformer::transform(), FrameChanger::transformPlane(), Geant4ePropagator::transformToG4SurfaceTarget(), and AlignableDataIO::writeAbsPos().

38 { return theRot; }

◆ setCache()

template<class T>
void GloballyPositioned< T >::setCache ( )
inlineprivate

Definition at line 156 of file GloballyPositioned.h.

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

156  {
157  if ((thePos.x() == 0.) && (thePos.y() == 0.)) {
158  thePhi = theEta = 0.; // avoid FPE
159  } else {
160  thePhi = thePos.barePhi();
161  theEta = thePos.eta();
162  }
163  }
T eta() const
Definition: PV3DBase.h:73
T barePhi() const
Definition: PV3DBase.h:65
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60

◆ toGlobal() [1/4]

template<class T>
GlobalPoint GloballyPositioned< T >::toGlobal ( const LocalPoint lp) const
inline

◆ toGlobal() [2/4]

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 75 of file GloballyPositioned.h.

75  {
77  }
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const PositionType & position() const
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
const RotationType & rotation() const

◆ toGlobal() [3/4]

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 82 of file GloballyPositioned.h.

82  {
83  return GlobalVector(rotation().multiplyInverse(lv.basicVector()));
84  }
Vector3DBase< T, GlobalTag > GlobalVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const RotationType & rotation() const

◆ toGlobal() [4/4]

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 91 of file GloballyPositioned.h.

91  {
93  }
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
const RotationType & rotation() const

◆ toLocal() [1/4]

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 98 of file GloballyPositioned.h.

Referenced by MuonGeometrySanityCheck::analyze(), SiPixelLorentzAnglePCLWorker::analyze(), OverlapValidation::analyzeTrajectory(), SeedingOTEDProducer::buildInitialTSOS(), tkDetUtil::calculatePhiWindow(), GEMEfficiencyAnalyzer::checkBounds(), TkGluedMeasurementDet::collectRecHits(), RodPlaneBuilderFromDet::computeBounds(), PixelForwardLayer::computeCrossings(), VectorHitBuilderAlgorithmBase::computeParallaxCorrection(), Phase1PixelBlade::computeRadiusRanges(), Geant4ePropagator::configureAnyPropagation(), GsfConstraintAtVertex::constrainAtPoint(), JetCoreMCtruthSeedGenerator::coreHitsFilling(), BasicTrajectoryState::createLocalParameters(), JetCoreMCtruthSeedGenerator::DetectorSelector(), DeepCoreSeedGenerator::DetectorSelector(), DTTrigGeomUtils::DTTrigGeomUtils(), fastProp(), SpecialCylindricalMFGrid::fromGridFrame(), DTTrigGeom::getGeom(), TrackDetectorAssociator::getTAMuonChamberMatches(), SiStripLorentzAngleRunInfoTableProducer::globalBeginRunProduce(), HelixBarrelCylinderCrossing::HelixBarrelCylinderCrossing(), RKLocalFieldProvider::inTesla(), SteppingHelixPropagator::loadState(), DTTrigGeom::localPosition(), RKPropagatorInZ::myPropagate(), RKPropagatorInR::myPropagate(), TkClonerImpl::operator()(), PathToPlane2Order::operator()(), PixelBlade::overlap(), Phase1PixelBlade::overlap(), FastTrackerRecHitMatcher::produce(), JetCoreMCtruthSeedGenerator::produce(), DeepCoreSeedGenerator::produce(), TkClonerImpl::project(), RKPropagatorInS::propagateParametersOnCylinder(), StraightLinePropagator::propagateParametersOnPlane(), RKPropagatorInS::propagateParametersOnPlane(), RectangularCartesianMFGrid::RectangularCartesianMFGrid(), RectangularCylindricalMFGrid::RectangularCylindricalMFGrid(), RKPropagatorInS::rkMomentum(), RKPropagatorInS::rkPosition(), JetCoreMCtruthSeedGenerator::seedParFilling(), ME0TriggerPseudoBuilder::segmentConversion(), CSCPairResidualsConstraint::setZplane(), SpecialCylindricalMFGrid::SpecialCylindricalMFGrid(), Traj2TrackHits::split(), GeomDet::toLocal(), DTTrigGeom::toLocal(), TrapezoidalCartesianMFGrid::TrapezoidalCartesianMFGrid(), TrapezoidalCylindricalMFGrid::TrapezoidalCylindricalMFGrid(), DTTrigGeom::tubePosInCh(), and TrapezoidalCylindricalMFGrid::uncheckedValueInTesla().

98  {
99  return LocalPoint(rotation() * (gp.basicVector() - position().basicVector()));
100  }
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const PositionType & position() const
Point3DBase< T, LocalTag > LocalPoint
const RotationType & rotation() const

◆ toLocal() [2/4]

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 107 of file GloballyPositioned.h.

107  {
108  return Point3DBase<U, LocalTag>(rotation() * (gp.basicVector() - position().basicVector()));
109  }
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const PositionType & position() const
const RotationType & rotation() const

◆ toLocal() [3/4]

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 114 of file GloballyPositioned.h.

114 { return LocalVector(rotation() * gv.basicVector()); }
Vector3DBase< T, LocalTag > LocalVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const RotationType & rotation() const

◆ toLocal() [4/4]

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 121 of file GloballyPositioned.h.

121  {
123  }
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const RotationType & rotation() const

Member Data Documentation

◆ theEta

template<class T>
T GloballyPositioned< T >::theEta
private

◆ thePhi

template<class T>
T GloballyPositioned< T >::thePhi
private

◆ thePos

template<class T>
PositionType GloballyPositioned< T >::thePos
private

◆ theRot

template<class T>
RotationType GloballyPositioned< T >::theRot
private