CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/Alignment/CommonAlignmentAlgorithm/interface/AlignableDataIO.h

Go to the documentation of this file.
00001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignableDataIO_H
00002 #define Alignment_CommonAlignmentAlgorithm_AlignableDataIO_H
00003 
00004 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignableData.h"
00005 
00008 
00009 class AlignableDataIO
00010 {
00011 
00012   protected:
00013 
00014   enum PosType { Abs, Org, Rel };
00015 
00017   AlignableDataIO(PosType p) : thePosType(p) {}; 
00018 
00020   virtual ~AlignableDataIO(){};
00021 
00023   virtual int open( const char* filename, int iteration, bool writemode ) = 0;
00024 
00026   virtual int close(void) = 0;
00027 
00029   int writeAbsPos(Alignable* ali, bool validCheck);
00030 
00032   int writeAbsPos(const align::Alignables& alivec, bool validCheck);
00033 
00035   AlignableAbsData readAbsPos(Alignable* ali, int& ierr);
00036 
00038   AlignablePositions readAbsPos(const align::Alignables& alivec, int& ierr);
00039 
00040 
00042   int writeOrgPos(Alignable* ali, bool validCheck);
00043 
00045   int writeOrgPos(const align::Alignables& alivec, bool validCheck);
00046 
00048   AlignableAbsData readOrgPos(Alignable* ali, int& ierr);
00049 
00051   AlignablePositions readOrgPos(const align::Alignables& alivec, int& ierr);
00052 
00053 
00055   int writeRelPos(Alignable* ali, bool validCheck);
00056 
00058   int writeRelPos(const align::Alignables& alivec, bool validCheck);
00059 
00061   AlignableRelData readRelPos(Alignable* ali, int& ierr);
00062 
00064   AlignableShifts readRelPos(const align::Alignables& alivec, int& ierr);
00065 
00066   // 'raw' read/write methods
00067   // must be provided by concrete derived class
00068 
00070   virtual int writeAbsRaw(const AlignableAbsData &ad) =0;
00072   virtual AlignableAbsData readAbsRaw(Alignable* ali,int& ierr) =0;
00074   virtual int writeRelRaw(const AlignableRelData &ad) =0;
00076   virtual AlignableRelData readRelRaw(Alignable* ali,int& ierr) =0;
00077 
00078   // Data members
00079   PosType thePosType; // Defines whether absolute/orig/relative pos. are used
00080 
00081 };
00082 
00083 #endif