CMS 3D CMS Logo

Public Member Functions | Private Attributes

AlignableDetOrUnitPtr Class Reference

#include <AlignableDetOrUnitPtr.h>

List of all members.

Public Member Functions

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

Private Attributes

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

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:
2010/09/10 10:29:17
Revision:
1.4

(last update by

Author:
mussgill

)

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.

    : theAliBeamSpot(aliBeamSpot), theAliDet(0), theAliDetUnit(0) {}
AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDet aliDet) [inline]

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

Definition at line 39 of file AlignableDetOrUnitPtr.h.

    : theAliBeamSpot(0), theAliDet(aliDet), theAliDetUnit(0) {}
AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDetUnit aliDetUnit) [inline]

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

Definition at line 43 of file AlignableDetOrUnitPtr.h.

    : theAliBeamSpot(0), theAliDet(0), theAliDetUnit(aliDetUnit) {}
AlignableDetOrUnitPtr::~AlignableDetOrUnitPtr ( ) [inline]

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

Definition at line 46 of file AlignableDetOrUnitPtr.h.

{}

Member Function Documentation

Alignable* AlignableDetOrUnitPtr::alignable ( ) [inline]
const Alignable* AlignableDetOrUnitPtr::alignable ( ) const [inline]

Definition at line 63 of file AlignableDetOrUnitPtr.h.

References operator const Alignable *().

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

Definition at line 66 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot.

{ return theAliBeamSpot;}
const AlignableBeamSpot* AlignableDetOrUnitPtr::alignableBeamSpot ( ) const [inline]

Definition at line 67 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot.

{ return theAliBeamSpot;}
AlignableDet* AlignableDetOrUnitPtr::alignableDet ( ) [inline]

Definition at line 68 of file AlignableDetOrUnitPtr.h.

References theAliDet.

{ return theAliDet;}
const AlignableDet* AlignableDetOrUnitPtr::alignableDet ( ) const [inline]

Definition at line 69 of file AlignableDetOrUnitPtr.h.

References theAliDet.

{ return theAliDet;}
const AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit ( ) const [inline]

Definition at line 71 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

{ return theAliDetUnit;}
AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit ( ) [inline]

Definition at line 70 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

{ return theAliDetUnit;}
const AlignmentPositionError * AlignableDetOrUnitPtr::alignmentPositionError ( ) const
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().

{ return (!theAliBeamSpot && !theAliDet && !theAliDetUnit);}
AlignableDetOrUnitPtr::operator Alignable * ( )

Definition at line 20 of file AlignableDetOrUnitPtr.cc.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

Referenced by alignable(), and operator->().

{ 
  if (theAliBeamSpot) return theAliBeamSpot;
  else if (theAliDet) return theAliDet;
  else                return theAliDetUnit;
}
AlignableDetOrUnitPtr::operator const Alignable * ( ) const

Definition at line 28 of file AlignableDetOrUnitPtr.cc.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

Referenced by alignable(), and operator->().

{
  if (theAliBeamSpot) return theAliBeamSpot;
  else if (theAliDet) return theAliDet;
  else                return theAliDetUnit;
}
Alignable* AlignableDetOrUnitPtr::operator-> ( ) [inline]

Definition at line 59 of file AlignableDetOrUnitPtr.h.

References operator Alignable *().

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

Definition at line 60 of file AlignableDetOrUnitPtr.h.

References operator const Alignable *().

{ return this->operator const Alignable*();}
AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDetUnit aliDetUnit) [inline]

Definition at line 52 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

                                                                          {
    theAliBeamSpot = 0; theAliDet = 0; theAliDetUnit = aliDetUnit; return *this;}
AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableBeamSpot aliBeamSpot) [inline]

Definition at line 48 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

                                                                            {
    theAliBeamSpot = aliBeamSpot; theAliDet = 0; theAliDetUnit = 0; return *this;}
AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDet aliDet) [inline]

Definition at line 50 of file AlignableDetOrUnitPtr.h.

References theAliBeamSpot, theAliDet, and theAliDetUnit.

                                                                  {
    theAliBeamSpot = 0; theAliDet = aliDet; theAliDetUnit = 0; return *this;}

Member Data Documentation