CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/Alignment/CommonAlignment/src/AlignableDetOrUnitPtr.cc

Go to the documentation of this file.
00001 
00010 #include "Alignment/CommonAlignment/interface/AlignableDetOrUnitPtr.h"
00011 #include "Alignment/CommonAlignment/interface/AlignableBeamSpot.h"
00012 #include "Alignment/CommonAlignment/interface/AlignableDet.h"
00013 #include "Alignment/CommonAlignment/interface/AlignableDetUnit.h"
00014 
00015 // Due to some implications with includes
00016 // (needed for converison from AlignableDet(Unit)* to Alignable*)
00017 // it is currently not possible to inline the following methods in the header...
00018 
00020 AlignableDetOrUnitPtr::operator Alignable* ()
00021 { 
00022   if (theAliBeamSpot) return theAliBeamSpot;
00023   else if (theAliDet) return theAliDet;
00024   else                return theAliDetUnit;
00025 }
00026 
00028 AlignableDetOrUnitPtr::operator const Alignable* () const 
00029 {
00030   if (theAliBeamSpot) return theAliBeamSpot;
00031   else if (theAliDet) return theAliDet;
00032   else                return theAliDetUnit;
00033 }
00034 
00036 const AlignmentPositionError* AlignableDetOrUnitPtr::alignmentPositionError() const
00037 {
00038   if (theAliBeamSpot)     return theAliBeamSpot->alignmentPositionError();
00039   else if (theAliDet)     return theAliDet->alignmentPositionError();
00040   else if (theAliDetUnit) return theAliDetUnit->alignmentPositionError();
00041   else                    return 0;
00042 }
00043