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
 
GlobalVector toGlobal (const LocalVector &lv) const
 
template<class U >
Point3DBase< U, GlobalTagtoGlobal (const Point3DBase< U, LocalTag > &lp) const
 
template<class U >
Vector3DBase< U, GlobalTagtoGlobal (const Vector3DBase< U, LocalTag > &lv) const
 
LocalPoint toLocal (const GlobalPoint &gp) const
 
LocalVector toLocal (const GlobalVector &gv) const
 
template<class U >
Point3DBase< U, LocalTagtoLocal (const Point3DBase< U, GlobalTag > &gp) 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

Definition at line 32 of file GloballyPositioned.h.

32 : thePos(pos), theRot(rot) { setCache(); }

◆ ~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.

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

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

◆ 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.

36 { return thePos; }

Referenced by cms::Phase2TrackerDigitizer::accumulatePixelHits(), SiStripCalibLorentzAngle::algoBeginJob(), TestHits::analyze(), TestTrackHits::analyze(), SiPixelErrorEstimation::analyze(), GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), 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(), AlignableSiStripDet::consistifyAlignments(), fastsim::TrackerSimHitProducer::createHitOnDetector(), BeamHaloPropagator::crossingTk(), shallow::drift(), Pixel3DDigitizerAlgorithm::drift(), Phase2TrackerDigitizerAlgorithm::drift(), StripCPE::driftDirection(), Phase2StripCPE::driftDirection(), SiHitDigitizer::DriftDirection(), Phase2TrackerDigitizerAlgorithm::DriftDirection(), PixelCPEBase::driftDirection(), SiPixelDigitizerAlgorithm::DriftDirection(), EtaPhiMeasurementEstimator::estimate(), fastProp(), ApeEstimator::fillHitVariables(), FWRecoGeometryESProducer::fillShapeAndPlacement(), DTTimingExtractor::fillTiming(), CSCEfficiency::filter(), ClusterShapeHitFilter::getDrift(), 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(), Alignable::update(), SiTrackerMultiRecHitUpdator::update(), and AlignableDataIO::writeAbsPos().

◆ 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.

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

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

◆ rotation()

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

◆ setCache()

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

Definition at line 156 of file GloballyPositioned.h.

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  }

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

◆ toGlobal() [1/4]

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

◆ toGlobal() [2/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  }

◆ toGlobal() [3/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  {
76  return Point3DBase<U, GlobalTag>(rotation().multiplyInverse(lp.basicVector()) + position().basicVector());
77  }

◆ 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  {
92  return Vector3DBase<U, GlobalTag>(rotation().multiplyInverse(lv.basicVector()));
93  }

◆ 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.

98  {
99  return LocalPoint(rotation() * (gp.basicVector() - position().basicVector()));
100  }

Referenced by MuonGeometrySanityCheck::analyze(), OverlapValidation::analyze(), 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(), 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().

◆ toLocal() [2/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()); }

◆ toLocal() [3/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  }

◆ 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  }

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
Vector3DBase
Definition: Vector3DBase.h:8
GloballyPositioned::LocalPoint
Point3DBase< T, LocalTag > LocalPoint
Definition: GloballyPositioned.h:24
GloballyPositioned::GlobalPoint
Point3DBase< T, GlobalTag > GlobalPoint
Definition: GloballyPositioned.h:23
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
pos
Definition: PixelAliasList.h:18
GloballyPositioned::GlobalVector
Vector3DBase< T, GlobalTag > GlobalVector
Definition: GloballyPositioned.h:25
GloballyPositioned::thePhi
T thePhi
Definition: GloballyPositioned.h:165
Point3DBase
Definition: Point3DBase.h:10
GloballyPositioned::setCache
void setCache()
Definition: GloballyPositioned.h:156
GloballyPositioned::LocalVector
Vector3DBase< T, LocalTag > LocalVector
Definition: GloballyPositioned.h:26
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
GloballyPositioned::theRot
RotationType theRot
Definition: GloballyPositioned.h:143
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
GloballyPositioned::theEta
T theEta
Definition: GloballyPositioned.h:166
GloballyPositioned::thePos
PositionType thePos
Definition: GloballyPositioned.h:142
GloballyPositioned::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38