Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:37

0001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignableDataIO_H
0002 #define Alignment_CommonAlignmentAlgorithm_AlignableDataIO_H
0003 
0004 #include "Alignment/CommonAlignment/interface/Utilities.h"
0005 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignableData.h"
0006 
0007 class Alignable;
0008 
0009 /// Abstract base class for IO of alignable positions/shifts.
0010 /// Derived concrete class must implement raw read/write methods
0011 
0012 class AlignableDataIO {
0013 protected:
0014   enum PosType { Abs, Org, Rel };
0015 
0016   /// Constructor
0017   AlignableDataIO(PosType p) : thePosType(p){};
0018 
0019   /// Destructor
0020   virtual ~AlignableDataIO(){};
0021 
0022   /// Open IO handle
0023   virtual int open(const char* filename, int iteration, bool writemode) = 0;
0024 
0025   /// Close IO handle
0026   virtual int close(void) = 0;
0027 
0028   /// Write absolute positions of one Alignable
0029   int writeAbsPos(Alignable* ali, bool validCheck);
0030 
0031   /// Write absolute positions of many Alignables
0032   int writeAbsPos(const align::Alignables& alivec, bool validCheck);
0033 
0034   /// Read absolute positions of one Alignable
0035   AlignableAbsData readAbsPos(Alignable* ali, int& ierr);
0036 
0037   /// Read absolute positions of many Alignables
0038   AlignablePositions readAbsPos(const align::Alignables& alivec, int& ierr);
0039 
0040   /// Write original positions of one Alignable
0041   int writeOrgPos(Alignable* ali, bool validCheck);
0042 
0043   /// Write original positions of many Alignables
0044   int writeOrgPos(const align::Alignables& alivec, bool validCheck);
0045 
0046   /// Read original positions of one Alignable
0047   AlignableAbsData readOrgPos(Alignable* ali, int& ierr);
0048 
0049   /// Read original positions of many Alignables
0050   AlignablePositions readOrgPos(const align::Alignables& alivec, int& ierr);
0051 
0052   /// Write relative positions of one Alignable
0053   int writeRelPos(Alignable* ali, bool validCheck);
0054 
0055   /// Write relative positions of many Alignables
0056   int writeRelPos(const align::Alignables& alivec, bool validCheck);
0057 
0058   /// Read relative positions of one Alignable
0059   AlignableRelData readRelPos(Alignable* ali, int& ierr);
0060 
0061   /// Read relative positions of many Alignables
0062   AlignableShifts readRelPos(const align::Alignables& alivec, int& ierr);
0063 
0064   // 'raw' read/write methods
0065   // must be provided by concrete derived class
0066 
0067   /// Write absolute positions
0068   virtual int writeAbsRaw(const AlignableAbsData& ad) = 0;
0069   /// Read absolute positions
0070   virtual AlignableAbsData readAbsRaw(Alignable* ali, int& ierr) = 0;
0071   /// Write relative positions
0072   virtual int writeRelRaw(const AlignableRelData& ad) = 0;
0073   /// Read relative positions
0074   virtual AlignableRelData readRelRaw(Alignable* ali, int& ierr) = 0;
0075 
0076   // Data members
0077   PosType thePosType;  // Defines whether absolute/orig/relative pos. are used
0078 };
0079 
0080 #endif