CMS 3D CMS Logo

AlignableDetOrUnitPtr.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignment_AlignableDetOrUnitPtr_H
2 #define Alignment_CommonAlignment_AlignableDetOrUnitPtr_H
3 
24 class Alignable;
25 class AlignableBeamSpot;
26 class AlignableDet;
27 class AlignableDetUnit;
29 
31 public:
34  : theAliBeamSpot(aliBeamSpot), theAliDet(nullptr), theAliDetUnit(nullptr) {}
35 
38  : theAliBeamSpot(nullptr), theAliDet(aliDet), theAliDetUnit(nullptr) {}
39 
42  : theAliBeamSpot(nullptr), theAliDet(nullptr), theAliDetUnit(aliDetUnit) {}
45 
47  theAliBeamSpot = aliBeamSpot;
48  theAliDet = nullptr;
49  theAliDetUnit = nullptr;
50  return *this;
51  }
53  theAliBeamSpot = nullptr;
54  theAliDet = aliDet;
55  theAliDetUnit = nullptr;
56  return *this;
57  }
59  theAliBeamSpot = nullptr;
60  theAliDet = nullptr;
61  theAliDetUnit = aliDetUnit;
62  return *this;
63  }
64  // Default operator= and default copy constructor are fine, no need to code them here.
65 
66  // conversions to Alignable* etc.
67  operator Alignable*();
68  operator const Alignable*() const;
69  inline Alignable* operator->() { return this->operator Alignable*(); }
70  inline const Alignable* operator->() const { return this->operator const Alignable*(); }
71  // explicit call if needed:
72  inline Alignable* alignable() { return this->operator Alignable*(); }
73  inline const Alignable* alignable() const { return this->operator const Alignable*(); }
74 
75  // explicit access to specific types
77  inline const AlignableBeamSpot* alignableBeamSpot() const { return theAliBeamSpot; }
78  inline AlignableDet* alignableDet() { return theAliDet; }
79  inline const AlignableDet* alignableDet() const { return theAliDet; }
81  inline const AlignableDetUnit* alignableDetUnit() const { return theAliDetUnit; }
82 
84  inline bool isNull() const { return (!theAliBeamSpot && !theAliDet && !theAliDetUnit); }
85 
86  // interface to methods specific for AlignableDet(Unit),
87  // slightly breaking idea of 'pointerness' of this class
90 
91 private:
95 };
96 
97 #endif
AlignableDetOrUnitPtr::alignable
Alignable * alignable()
Definition: AlignableDetOrUnitPtr.h:72
AlignableDetOrUnitPtr::theAliDet
AlignableDet * theAliDet
Pointer to Alignable if it is a Det.
Definition: AlignableDetOrUnitPtr.h:93
AlignableDetOrUnitPtr::alignableBeamSpot
AlignableBeamSpot * alignableBeamSpot()
Definition: AlignableDetOrUnitPtr.h:76
AlignableDetOrUnitPtr::isNull
bool isNull() const
check for empty pointer
Definition: AlignableDetOrUnitPtr.h:84
AlignableDetOrUnitPtr::operator->
Alignable * operator->()
Definition: AlignableDetOrUnitPtr.h:69
Alignable
Definition: Alignable.h:27
AlignableDetOrUnitPtr::operator=
AlignableDetOrUnitPtr & operator=(AlignableBeamSpot *aliBeamSpot)
Definition: AlignableDetOrUnitPtr.h:46
AlignableDetOrUnitPtr::theAliBeamSpot
AlignableBeamSpot * theAliBeamSpot
Pointer to Alignable if it is the beam spot.
Definition: AlignableDetOrUnitPtr.h:92
AlignableDetOrUnitPtr::AlignableDetOrUnitPtr
AlignableDetOrUnitPtr(AlignableDet *aliDet)
Constructor from AlignableDet* (non-explicit: for automatic conversions)
Definition: AlignableDetOrUnitPtr.h:37
AlignableDetOrUnitPtr::alignableDet
AlignableDet * alignableDet()
Definition: AlignableDetOrUnitPtr.h:78
AlignableDetOrUnitPtr
Definition: AlignableDetOrUnitPtr.h:30
AlignableDetOrUnitPtr::alignable
const Alignable * alignable() const
Definition: AlignableDetOrUnitPtr.h:73
AlignableDet
Definition: AlignableDet.h:8
AlignableDetOrUnitPtr::AlignableDetOrUnitPtr
AlignableDetOrUnitPtr(AlignableBeamSpot *aliBeamSpot)
Constructor from AlignableBeamSpot* (non-explicit: for automatic conversions)
Definition: AlignableDetOrUnitPtr.h:33
AlignableDetOrUnitPtr::AlignableDetOrUnitPtr
AlignableDetOrUnitPtr(AlignableDetUnit *aliDetUnit)
Constructor from AlignableDetUnit* (non-explicit: for automatic conversions)
Definition: AlignableDetOrUnitPtr.h:41
AlignableDetOrUnitPtr::operator->
const Alignable * operator->() const
Definition: AlignableDetOrUnitPtr.h:70
AlignableDetOrUnitPtr::~AlignableDetOrUnitPtr
~AlignableDetOrUnitPtr()
Non-virtual destructor: do not use as base class.
Definition: AlignableDetOrUnitPtr.h:44
AlignableDetOrUnitPtr::alignableBeamSpot
const AlignableBeamSpot * alignableBeamSpot() const
Definition: AlignableDetOrUnitPtr.h:77
AlignableBeamSpot
Definition: AlignableBeamSpot.h:19
AlignableDetOrUnitPtr::alignmentPositionError
const AlignmentPositionError * alignmentPositionError() const
alignment position error (see comments in specific classes)
Definition: AlignableDetOrUnitPtr.cc:40
AlignableDetOrUnitPtr::alignableDetUnit
const AlignableDetUnit * alignableDetUnit() const
Definition: AlignableDetOrUnitPtr.h:81
AlignableDetOrUnitPtr::operator=
AlignableDetOrUnitPtr & operator=(AlignableDet *aliDet)
Definition: AlignableDetOrUnitPtr.h:52
AlignableDetOrUnitPtr::theAliDetUnit
AlignableDetUnit * theAliDetUnit
Pointer to Alignable if it is a DetUnit.
Definition: AlignableDetOrUnitPtr.h:94
AlignableDetOrUnitPtr::operator=
AlignableDetOrUnitPtr & operator=(AlignableDetUnit *aliDetUnit)
Definition: AlignableDetOrUnitPtr.h:58
AlignableDetOrUnitPtr::alignableDet
const AlignableDet * alignableDet() const
Definition: AlignableDetOrUnitPtr.h:79
AlignableDetOrUnitPtr::alignableDetUnit
AlignableDetUnit * alignableDetUnit()
Definition: AlignableDetOrUnitPtr.h:80
AlignmentPositionError
Definition: AlignmentPositionError.h:10
AlignableDetUnit
Definition: AlignableDetUnit.h:12