File indexing completed on 2024-04-06 11:56:05
0001 #ifndef Alignment_CommonAlignment_AlignableDetOrUnitPtr_H
0002 #define Alignment_CommonAlignment_AlignableDetOrUnitPtr_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 class Alignable;
0025 class AlignableBeamSpot;
0026 class AlignableDet;
0027 class AlignableDetUnit;
0028 class AlignmentPositionError;
0029
0030 class AlignableDetOrUnitPtr {
0031 public:
0032
0033 inline AlignableDetOrUnitPtr(AlignableBeamSpot* aliBeamSpot)
0034 : theAliBeamSpot(aliBeamSpot), theAliDet(nullptr), theAliDetUnit(nullptr) {}
0035
0036
0037 inline AlignableDetOrUnitPtr(AlignableDet* aliDet)
0038 : theAliBeamSpot(nullptr), theAliDet(aliDet), theAliDetUnit(nullptr) {}
0039
0040
0041 inline AlignableDetOrUnitPtr(AlignableDetUnit* aliDetUnit)
0042 : theAliBeamSpot(nullptr), theAliDet(nullptr), theAliDetUnit(aliDetUnit) {}
0043
0044 inline ~AlignableDetOrUnitPtr() {}
0045
0046 inline AlignableDetOrUnitPtr& operator=(AlignableBeamSpot* aliBeamSpot) {
0047 theAliBeamSpot = aliBeamSpot;
0048 theAliDet = nullptr;
0049 theAliDetUnit = nullptr;
0050 return *this;
0051 }
0052 inline AlignableDetOrUnitPtr& operator=(AlignableDet* aliDet) {
0053 theAliBeamSpot = nullptr;
0054 theAliDet = aliDet;
0055 theAliDetUnit = nullptr;
0056 return *this;
0057 }
0058 inline AlignableDetOrUnitPtr& operator=(AlignableDetUnit* aliDetUnit) {
0059 theAliBeamSpot = nullptr;
0060 theAliDet = nullptr;
0061 theAliDetUnit = aliDetUnit;
0062 return *this;
0063 }
0064
0065
0066
0067 operator Alignable*();
0068 operator const Alignable*() const;
0069 inline Alignable* operator->() { return this->operator Alignable*(); }
0070 inline const Alignable* operator->() const { return this->operator const Alignable*(); }
0071
0072 inline Alignable* alignable() { return this->operator Alignable*(); }
0073 inline const Alignable* alignable() const { return this->operator const Alignable*(); }
0074
0075
0076 inline AlignableBeamSpot* alignableBeamSpot() { return theAliBeamSpot; }
0077 inline const AlignableBeamSpot* alignableBeamSpot() const { return theAliBeamSpot; }
0078 inline AlignableDet* alignableDet() { return theAliDet; }
0079 inline const AlignableDet* alignableDet() const { return theAliDet; }
0080 inline AlignableDetUnit* alignableDetUnit() { return theAliDetUnit; }
0081 inline const AlignableDetUnit* alignableDetUnit() const { return theAliDetUnit; }
0082
0083
0084 inline bool isNull() const { return (!theAliBeamSpot && !theAliDet && !theAliDetUnit); }
0085
0086
0087
0088
0089 const AlignmentPositionError* alignmentPositionError() const;
0090
0091 private:
0092 AlignableBeamSpot* theAliBeamSpot;
0093 AlignableDet* theAliDet;
0094 AlignableDetUnit* theAliDetUnit;
0095 };
0096
0097 #endif