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 ()
 
 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 ( )
inline

Definition at line 36 of file GloballyPositioned.h.

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

Definition at line 40 of file GloballyPositioned.h.

40 {}

Member Function Documentation

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

Definition at line 50 of file GloballyPositioned.h.

Referenced by TrajectoryFactoryBase::sameSurface().

50  {
51  if (theEta==iniEta()) theEta = thePos.eta();
52  return theEta;
53  }
T eta() const
Definition: PV3DBase.h:76
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

Definition at line 46 of file GloballyPositioned.h.

Referenced by TECLayer::computeCrossings(), and TrajectoryFactoryBase::sameSurface().

46  {
47  if (thePhi==iniPhi()) thePhi = thePos.barePhi();
48  return thePhi;
49  }
T barePhi() const
Definition: PV3DBase.h:68
template<class T>
const PositionType& GloballyPositioned< T >::position ( ) const
inline

Definition at line 42 of file GloballyPositioned.h.

Referenced by cms::SiPixelDigitizer::accumulatePixelHits(), SiStripDigitizer::accumulateStripHits(), SiStripCalibLorentzAngle::algoBeginJob(), MuonGeometrySVGTemplate::analyze(), TestHits::analyze(), TestTrackHits::analyze(), SiPixelErrorEstimation::analyze(), GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), GeomDetLess::barrelForwardLess(), MagGeoBuilderFromDDD::buildInterpolator(), MagGeoBuilderFromDDD::buildMagVolumes(), MuRodBarrelLayer::compatibleDets(), MuDetRing::compatibleDets(), MuDetRod::compatibleDets(), BladeShapeBuilderFromDet::computeRotation(), AlignableSiStripDet::consistifyAlignments(), ThreePlaneCrossing::crossing(), SiStripLorentzAngleCalibration::derivatives(), SiPixelLorentzAngleCalibration::derivatives(), SiStripBackplaneCalibration::derivatives(), DTDigiSyncTOFCorr::digitizerOffset(), shallow::drift(), SiPixelDigitizerAlgorithm::drift(), StripCPE::driftDirection(), SiHitDigitizer::DriftDirection(), PixelCPEBase::driftDirection(), SiPixelDigitizerAlgorithm::DriftDirection(), fastProp(), HIPAlignmentAlgorithm::fillRoot(), FWRecoGeometryESProducer::fillShapeAndPlacement(), DTTimingExtractor::fillTiming(), ClusterShapeHitFilter::getDrift(), Alignable::globalPosition(), SeedFromProtoTrack::init(), CSCStripElectronicsSim::initParameters(), GeomDetLess::insideOutLess(), StripCPEfromTemplate::localParameters(), OutInConversionSeedFinder::makeEstimator(), TSGForRoadSearch::makeSeeds_3(), MagGeoBuilderFromDDD::volumeHandle::maxPhi(), MagGeoBuilderFromDDD::volumeHandle::maxZ(), MagGeoBuilderFromDDD::volumeHandle::minZ(), GlobalTrackerMuonAlignment::misalignMuonL(), DTTTrigSyncFromDB::offset(), DTTTrigSyncTOFCorr::offset(), MuonDetLayerComp::operator()(), CylinderBuilderFromDet::operator()(), PixelCPEBase::param(), StraightLinePlaneCrossing::pathLength(), GeometricSearchDet::position(), SurveyDet::position(), GeomDet::position(), QuadrupletSeedMerger::printHit(), MuonNavigationPrinter::printLayer(), MuonNavigationPrinter::printLayers(), GlobalMuonToMuonProducer::printTrackRecHits(), ShallowTrackClustersProducer::produce(), CachedTrajectory::propagate(), CSCPairResidualsConstraint::radius(), KFBasedPixelFitter::run(), MagGeoBuilderFromDDD::volumeHandle::sameSurface(), TrajectoryFactoryBase::sameSurface(), 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().

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

Definition at line 173 of file GloballyPositioned.h.

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

173  {
174  if ((thePos.x() == 0.) && (thePos.y() == 0.)) {
175  thePhi = theEta = 0.; // avoid FPE
176  } else {
177  thePhi = iniPhi();
178  theEta = iniEta();
179  }
180  }
T y() const
Definition: PV3DBase.h:63
T x() const
Definition: PV3DBase.h:62
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 162 of file GloballyPositioned.h.

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

162  {
163  theRot *= rotation;
164  resetCache();
165  }
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 183 of file GloballyPositioned.h.

183  {
184  if ((thePos.x() == 0.) && (thePos.y() == 0.)) {
185  thePhi = theEta = 0.; // avoid FPE
186  } else {
187  thePhi = thePos.barePhi();
188  theEta = thePos.eta();
189  }
190  }
T y() const
Definition: PV3DBase.h:63
T barePhi() const
Definition: PV3DBase.h:68
T eta() const
Definition: PV3DBase.h:76
T x() const
Definition: PV3DBase.h:62
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 83 of file GloballyPositioned.h.

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

83  {
84  return GlobalPoint( rotation().multiplyInverse( lp.basicVector()) +
85  position().basicVector());
86  }
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 94 of file GloballyPositioned.h.

94  {
96  position().basicVector());
97  }
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 102 of file GloballyPositioned.h.

102  {
103  return GlobalVector( rotation().multiplyInverse( lv.basicVector()));
104  }
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 112 of file GloballyPositioned.h.

112  {
114  }
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 119 of file GloballyPositioned.h.

Referenced by RodPlaneBuilderFromDet::computeBounds(), BladeShapeBuilderFromDet::computeBounds(), PlaneBuilderForGluedDet::computeRectBounds(), GsfConstraintAtVertex::constrainAtPoint(), BasicTrajectoryState::createLocalParameters(), SiStripLorentzAngleCalibration::derivatives(), SiPixelLorentzAngleCalibration::derivatives(), SiStripBackplaneCalibration::derivatives(), DTTrigGeomUtils::DTTrigGeomUtils(), fastProp(), SpecialCylindricalMFGrid::fromGridFrame(), DTTrigGeom::getGeom(), TrackDetectorAssociator::getTAMuonChamberMatches(), HelixBarrelPlaneCrossing2OrderLocal::HelixBarrelPlaneCrossing2OrderLocal(), RKLocalFieldProvider::inTesla(), DTTrigGeom::localPosition(), SiTrackerGaussianSmearingRecHitConverter::matchHits(), PathToPlane2Order::operator()(), PixelCPEBase::param(), DTDigitizer::produce(), Propagator::propagate(), RectangularCartesianMFGrid::RectangularCartesianMFGrid(), RectangularCylindricalMFGrid::RectangularCylindricalMFGrid(), MagGeoBuilderFromDDD::volumeHandle::sameSurface(), PixelCPEBase::setTheDet(), CSCPairResidualsConstraint::setZplane(), SpecialCylindricalMFGrid::SpecialCylindricalMFGrid(), FrameChanger::toFrame(), NavSurface::toLocal(), GeomDet::toLocal(), DTTrigGeom::toLocal(), toLocal(), FrameChanger::transformPlane(), TrapezoidalCartesianMFGrid::TrapezoidalCartesianMFGrid(), TrapezoidalCylindricalMFGrid::TrapezoidalCylindricalMFGrid(), DTTrigGeom::tubePosInCh(), and TrapezoidalCylindricalMFGrid::uncheckedValueInTesla().

119  {
120  return LocalPoint( rotation() * (gp.basicVector()-position().basicVector()));
121  }
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 129 of file GloballyPositioned.h.

129  {
131  (gp.basicVector()-position().basicVector()));
132  }
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 137 of file GloballyPositioned.h.

137  {
138  return LocalVector( rotation() * gv.basicVector());
139  }
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 147 of file GloballyPositioned.h.

147  {
149  }
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