CMS 3D CMS Logo

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() [1/3]

AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableBeamSpot aliBeamSpot)
inline

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

Definition at line 33 of file AlignableDetOrUnitPtr.h.

34  : theAliBeamSpot(aliBeamSpot), theAliDet(nullptr), theAliDetUnit(nullptr) {}
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() [2/3]

AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDet aliDet)
inline

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

Definition at line 37 of file AlignableDetOrUnitPtr.h.

38  : theAliBeamSpot(nullptr), theAliDet(aliDet), theAliDetUnit(nullptr) {}
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() [3/3]

AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDetUnit aliDetUnit)
inline

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

Definition at line 41 of file AlignableDetOrUnitPtr.h.

42  : theAliBeamSpot(nullptr), theAliDet(nullptr), 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::~AlignableDetOrUnitPtr ( )
inline

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

Definition at line 44 of file AlignableDetOrUnitPtr.h.

44 {}

Member Function Documentation

◆ alignable() [1/2]

Alignable* AlignableDetOrUnitPtr::alignable ( )
inline

Definition at line 72 of file AlignableDetOrUnitPtr.h.

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

72 { return this->operator Alignable*(); }

◆ alignable() [2/2]

const Alignable* AlignableDetOrUnitPtr::alignable ( ) const
inline

Definition at line 73 of file AlignableDetOrUnitPtr.h.

73 { return this->operator const Alignable*(); }

◆ alignableBeamSpot() [1/2]

AlignableBeamSpot* AlignableDetOrUnitPtr::alignableBeamSpot ( )
inline

Definition at line 76 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot.

76 { return theAliBeamSpot; }
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.

◆ alignableBeamSpot() [2/2]

const AlignableBeamSpot* AlignableDetOrUnitPtr::alignableBeamSpot ( ) const
inline

Definition at line 77 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot.

77 { return theAliBeamSpot; }
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.

◆ alignableDet() [1/2]

AlignableDet* AlignableDetOrUnitPtr::alignableDet ( )
inline

Definition at line 78 of file AlignableDetOrUnitPtr.h.

References theAliDet.

78 { return theAliDet; }
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.

◆ alignableDet() [2/2]

const AlignableDet* AlignableDetOrUnitPtr::alignableDet ( ) const
inline

Definition at line 79 of file AlignableDetOrUnitPtr.h.

References theAliDet.

79 { return theAliDet; }
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.

◆ alignableDetUnit() [1/2]

AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit ( )
inline

Definition at line 80 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

80 { return theAliDetUnit; }
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.

◆ alignableDetUnit() [2/2]

const AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit ( ) const
inline

Definition at line 81 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

81 { return theAliDetUnit; }
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.

◆ alignmentPositionError()

const AlignmentPositionError * AlignableDetOrUnitPtr::alignmentPositionError ( ) const

alignment position error (see comments in specific classes)

Definition at line 40 of file AlignableDetOrUnitPtr.cc.

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

40  {
41  if (theAliBeamSpot)
43  else if (theAliDet)
45  else if (theAliDetUnit)
47  else
48  return nullptr;
49 }
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! ...
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.
const AlignmentPositionError * alignmentPositionError() const
alignment position error - for checking only, otherwise use alignmentErrors() above! ...
Definition: AlignableDet.h:44

◆ isNull()

bool AlignableDetOrUnitPtr::isNull ( ) const
inline

check for empty pointer

Definition at line 84 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

84 { 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.

◆ operator Alignable *()

AlignableDetOrUnitPtr::operator Alignable * ( )

Definition at line 20 of file AlignableDetOrUnitPtr.cc.

20  {
21  if (theAliBeamSpot)
22  return theAliBeamSpot;
23  else if (theAliDet)
24  return theAliDet;
25  else
26  return theAliDetUnit;
27 }
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.

◆ operator const Alignable *()

AlignableDetOrUnitPtr::operator const Alignable * ( ) const

Definition at line 30 of file AlignableDetOrUnitPtr.cc.

30  {
31  if (theAliBeamSpot)
32  return theAliBeamSpot;
33  else if (theAliDet)
34  return theAliDet;
35  else
36  return theAliDetUnit;
37 }
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.

◆ operator->() [1/2]

Alignable* AlignableDetOrUnitPtr::operator-> ( )
inline

Definition at line 69 of file AlignableDetOrUnitPtr.h.

69 { return this->operator Alignable*(); }

◆ operator->() [2/2]

const Alignable* AlignableDetOrUnitPtr::operator-> ( ) const
inline

Definition at line 70 of file AlignableDetOrUnitPtr.h.

70 { return this->operator const Alignable*(); }

◆ operator=() [1/3]

AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableBeamSpot aliBeamSpot)
inline

Definition at line 46 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

46  {
47  theAliBeamSpot = aliBeamSpot;
48  theAliDet = nullptr;
49  theAliDetUnit = nullptr;
50  return *this;
51  }
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.

◆ operator=() [2/3]

AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDet aliDet)
inline

Definition at line 52 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

52  {
53  theAliBeamSpot = nullptr;
54  theAliDet = aliDet;
55  theAliDetUnit = nullptr;
56  return *this;
57  }
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.

◆ operator=() [3/3]

AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDetUnit aliDetUnit)
inline

Definition at line 58 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

58  {
59  theAliBeamSpot = nullptr;
60  theAliDet = nullptr;
61  theAliDetUnit = aliDetUnit;
62  return *this;
63  }
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

◆ theAliBeamSpot

AlignableBeamSpot* AlignableDetOrUnitPtr::theAliBeamSpot
private

Pointer to Alignable if it is the beam spot.

Definition at line 92 of file AlignableDetOrUnitPtr.h.

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

◆ theAliDet

AlignableDet* AlignableDetOrUnitPtr::theAliDet
private

Pointer to Alignable if it is a Det.

Definition at line 93 of file AlignableDetOrUnitPtr.h.

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

◆ theAliDetUnit

AlignableDetUnit* AlignableDetOrUnitPtr::theAliDetUnit
private

Pointer to Alignable if it is a DetUnit.

Definition at line 94 of file AlignableDetOrUnitPtr.h.

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