CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
AlignableDetOrUnitPtr Class Reference

#include <AlignableDetOrUnitPtr.h>

Public Member Functions

Alignablealignable ()
 
const Alignablealignable () const
 
AlignableBeamSpotalignableBeamSpot ()
 
const AlignableBeamSpotalignableBeamSpot () const
 
AlignableDetalignableDet ()
 
const AlignableDetalignableDet () const
 
 AlignableDetOrUnitPtr (AlignableBeamSpot *aliBeamSpot)
 Constructor from AlignableBeamSpot* (non-explicit: for automatic conversions) More...
 
 AlignableDetOrUnitPtr (AlignableDet *aliDet)
 Constructor from AlignableDet* (non-explicit: for automatic conversions) More...
 
 AlignableDetOrUnitPtr (AlignableDetUnit *aliDetUnit)
 Constructor from AlignableDetUnit* (non-explicit: for automatic conversions) More...
 
AlignableDetUnitalignableDetUnit ()
 
const AlignableDetUnitalignableDetUnit () const
 
const AlignmentPositionErroralignmentPositionError () const
 alignment position error (see comments in specific classes) More...
 
bool isNull () const
 check for empty pointer More...
 
 operator Alignable * ()
 
 operator const Alignable * () const
 
Alignableoperator-> ()
 
const Alignableoperator-> () const
 
AlignableDetOrUnitPtroperator= (AlignableBeamSpot *aliBeamSpot)
 
AlignableDetOrUnitPtroperator= (AlignableDet *aliDet)
 
AlignableDetOrUnitPtroperator= (AlignableDetUnit *aliDetUnit)
 
 ~AlignableDetOrUnitPtr ()
 Non-virtual destructor: do not use as base class. More...
 

Private Attributes

AlignableBeamSpottheAliBeamSpot
 Pointer to Alignable if it is the beam spot. More...
 
AlignableDettheAliDet
 Pointer to Alignable if it is a Det. More...
 
AlignableDetUnittheAliDetUnit
 Pointer to Alignable if it is a DetUnit. More...
 

Detailed Description

Class to hold either a pointer to an AlignableDet or to an AlignableDetUnit. As such it is like a pointer to an Alignable of that hierarchy level on which hits can exists. Therefore it should be used whenever it should be ensured by C++ type safety that a lowest level Alignable* is dealt with.

Conversion and '->' operators exist to use this class as a pointer to the base class Alignable. On the other hand, the accessors alignableDet() and alignableDetUnit() can be used to check which concrete type it is.

Since this class is very light weighted, it can be used by value.

Original author: Gero Flucke, April 2007

Date:
2009/02/28 21:04:59
Revision:
1.3

(last update by

Author:
flucke

)

Definition at line 30 of file AlignableDetOrUnitPtr.h.

Constructor & Destructor Documentation

AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableBeamSpot aliBeamSpot)
inline

Constructor from AlignableBeamSpot* (non-explicit: for automatic conversions)

Definition at line 35 of file AlignableDetOrUnitPtr.h.

36  : theAliBeamSpot(aliBeamSpot), theAliDet(0), theAliDetUnit(0) {}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDet aliDet)
inline

Constructor from AlignableDet* (non-explicit: for automatic conversions)

Definition at line 39 of file AlignableDetOrUnitPtr.h.

40  : theAliBeamSpot(0), theAliDet(aliDet), theAliDetUnit(0) {}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDetUnit aliDetUnit)
inline

Constructor from AlignableDetUnit* (non-explicit: for automatic conversions)

Definition at line 43 of file AlignableDetOrUnitPtr.h.

44  : theAliBeamSpot(0), theAliDet(0), theAliDetUnit(aliDetUnit) {}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetOrUnitPtr::~AlignableDetOrUnitPtr ( )
inline

Non-virtual destructor: do not use as base class.

Definition at line 46 of file AlignableDetOrUnitPtr.h.

46 {}

Member Function Documentation

Alignable* AlignableDetOrUnitPtr::alignable ( )
inline

Definition at line 62 of file AlignableDetOrUnitPtr.h.

Referenced by CSCAlignmentCorrections::applyAlignment(), and CSCChamberFitter::radiusCorrection().

62 { return this->operator Alignable*();}
const Alignable* AlignableDetOrUnitPtr::alignable ( ) const
inline

Definition at line 63 of file AlignableDetOrUnitPtr.h.

63 { return this->operator const Alignable*();}
AlignableBeamSpot* AlignableDetOrUnitPtr::alignableBeamSpot ( )
inline

Definition at line 66 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot.

66 { return theAliBeamSpot;}
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
const AlignableBeamSpot* AlignableDetOrUnitPtr::alignableBeamSpot ( ) const
inline

Definition at line 67 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot.

67 { return theAliBeamSpot;}
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet* AlignableDetOrUnitPtr::alignableDet ( )
inline

Definition at line 68 of file AlignableDetOrUnitPtr.h.

References theAliDet.

68 { return theAliDet;}
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
const AlignableDet* AlignableDetOrUnitPtr::alignableDet ( ) const
inline

Definition at line 69 of file AlignableDetOrUnitPtr.h.

References theAliDet.

69 { return theAliDet;}
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit ( )
inline

Definition at line 70 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

70 { return theAliDetUnit;}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
const AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit ( ) const
inline

Definition at line 71 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

71 { return theAliDetUnit;}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
const AlignmentPositionError * AlignableDetOrUnitPtr::alignmentPositionError ( ) const

alignment position error (see comments in specific classes)

Definition at line 36 of file AlignableDetOrUnitPtr.cc.

References AlignableDet::alignmentPositionError(), AlignableBeamSpot::alignmentPositionError(), AlignableDetUnit::alignmentPositionError(), theAliBeamSpot, theAliDet, and theAliDetUnit.

37 {
39  else if (theAliDet) return theAliDet->alignmentPositionError();
41  else return 0;
42 }
const AlignmentPositionError * alignmentPositionError() const
alignment position error - for checking only, otherwise use alignmentErrors() above! ...
Definition: AlignableDet.h:43
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
const AlignmentPositionError * alignmentPositionError() const
alignment position error - for checking only, otherwise use alignmentErrors() above! ...
const AlignmentPositionError * alignmentPositionError() const
alignment position error - for checking only, otherwise use alignmentErrors() above! ...
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
bool AlignableDetOrUnitPtr::isNull ( ) const
inline

check for empty pointer

Definition at line 74 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

Referenced by CurrentAlignmentKFUpdator::includeCurrentAlignmentEstimate().

74 { return (!theAliBeamSpot && !theAliDet && !theAliDetUnit);}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetOrUnitPtr::operator Alignable * ( )

Definition at line 20 of file AlignableDetOrUnitPtr.cc.

21 {
22  if (theAliBeamSpot) return theAliBeamSpot;
23  else if (theAliDet) return theAliDet;
24  else return theAliDetUnit;
25 }
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetOrUnitPtr::operator const Alignable * ( ) const

Definition at line 28 of file AlignableDetOrUnitPtr.cc.

29 {
30  if (theAliBeamSpot) return theAliBeamSpot;
31  else if (theAliDet) return theAliDet;
32  else return theAliDetUnit;
33 }
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
Alignable* AlignableDetOrUnitPtr::operator-> ( )
inline

Definition at line 59 of file AlignableDetOrUnitPtr.h.

59 { return this->operator Alignable*();}
const Alignable* AlignableDetOrUnitPtr::operator-> ( ) const
inline

Definition at line 60 of file AlignableDetOrUnitPtr.h.

60 { return this->operator const Alignable*();}
AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableBeamSpot aliBeamSpot)
inline

Definition at line 48 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

48  {
49  theAliBeamSpot = aliBeamSpot; theAliDet = 0; theAliDetUnit = 0; return *this;}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDet aliDet)
inline

Definition at line 50 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

50  {
51  theAliBeamSpot = 0; theAliDet = aliDet; theAliDetUnit = 0; return *this;}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDetUnit aliDetUnit)
inline

Definition at line 52 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

52  {
53  theAliBeamSpot = 0; theAliDet = 0; theAliDetUnit = aliDetUnit; return *this;}
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.

Member Data Documentation

AlignableBeamSpot* AlignableDetOrUnitPtr::theAliBeamSpot
private

Pointer to Alignable if it is the beam spot.

Definition at line 82 of file AlignableDetOrUnitPtr.h.

Referenced by alignableBeamSpot(), alignmentPositionError(), isNull(), and operator=().

AlignableDet* AlignableDetOrUnitPtr::theAliDet
private

Pointer to Alignable if it is a Det.

Definition at line 83 of file AlignableDetOrUnitPtr.h.

Referenced by alignableDet(), alignmentPositionError(), isNull(), and operator=().

AlignableDetUnit* AlignableDetOrUnitPtr::theAliDetUnit
private

Pointer to Alignable if it is a DetUnit.

Definition at line 84 of file AlignableDetOrUnitPtr.h.

Referenced by alignableDetUnit(), alignmentPositionError(), isNull(), and operator=().