Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:06

0001 /** \file AlignableDetOrUnitPtr
0002  *
0003  *  Original author: Gero Flucke, April 2007
0004  *
0005  *  $Date: 2009/02/28 21:05:00 $
0006  *  $Revision: 1.3 $
0007  *  (last update by $Author: flucke $)
0008  */
0009 
0010 #include "Alignment/CommonAlignment/interface/AlignableDetOrUnitPtr.h"
0011 #include "Alignment/CommonAlignment/interface/AlignableBeamSpot.h"
0012 #include "Alignment/CommonAlignment/interface/AlignableDet.h"
0013 #include "Alignment/CommonAlignment/interface/AlignableDetUnit.h"
0014 
0015 // Due to some implications with includes
0016 // (needed for converison from AlignableDet(Unit)* to Alignable*)
0017 // it is currently not possible to inline the following methods in the header...
0018 
0019 ///////////////////////////////////////////////////////////////////////////////////////////////////
0020 AlignableDetOrUnitPtr::operator Alignable*() {
0021   if (theAliBeamSpot)
0022     return theAliBeamSpot;
0023   else if (theAliDet)
0024     return theAliDet;
0025   else
0026     return theAliDetUnit;
0027 }
0028 
0029 ///////////////////////////////////////////////////////////////////////////////////////////////////
0030 AlignableDetOrUnitPtr::operator const Alignable*() const {
0031   if (theAliBeamSpot)
0032     return theAliBeamSpot;
0033   else if (theAliDet)
0034     return theAliDet;
0035   else
0036     return theAliDetUnit;
0037 }
0038 
0039 ///////////////////////////////////////////////////////////////////////////////////////////////////
0040 const AlignmentPositionError* AlignableDetOrUnitPtr::alignmentPositionError() const {
0041   if (theAliBeamSpot)
0042     return theAliBeamSpot->alignmentPositionError();
0043   else if (theAliDet)
0044     return theAliDet->alignmentPositionError();
0045   else if (theAliDetUnit)
0046     return theAliDetUnit->alignmentPositionError();
0047   else
0048     return nullptr;
0049 }