CMS 3D CMS Logo

AlignableDataIO.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignmentAlgorithm_AlignableDataIO_H
2 #define Alignment_CommonAlignmentAlgorithm_AlignableDataIO_H
3 
6 
7 class Alignable;
8 
11 
13 protected:
14  enum PosType { Abs, Org, Rel };
15 
18 
20  virtual ~AlignableDataIO(){};
21 
23  virtual int open(const char* filename, int iteration, bool writemode) = 0;
24 
26  virtual int close(void) = 0;
27 
29  int writeAbsPos(Alignable* ali, bool validCheck);
30 
32  int writeAbsPos(const align::Alignables& alivec, bool validCheck);
33 
35  AlignableAbsData readAbsPos(Alignable* ali, int& ierr);
36 
38  AlignablePositions readAbsPos(const align::Alignables& alivec, int& ierr);
39 
41  int writeOrgPos(Alignable* ali, bool validCheck);
42 
44  int writeOrgPos(const align::Alignables& alivec, bool validCheck);
45 
47  AlignableAbsData readOrgPos(Alignable* ali, int& ierr);
48 
50  AlignablePositions readOrgPos(const align::Alignables& alivec, int& ierr);
51 
53  int writeRelPos(Alignable* ali, bool validCheck);
54 
56  int writeRelPos(const align::Alignables& alivec, bool validCheck);
57 
59  AlignableRelData readRelPos(Alignable* ali, int& ierr);
60 
62  AlignableShifts readRelPos(const align::Alignables& alivec, int& ierr);
63 
64  // 'raw' read/write methods
65  // must be provided by concrete derived class
66 
68  virtual int writeAbsRaw(const AlignableAbsData& ad) = 0;
70  virtual AlignableAbsData readAbsRaw(Alignable* ali, int& ierr) = 0;
72  virtual int writeRelRaw(const AlignableRelData& ad) = 0;
74  virtual AlignableRelData readRelRaw(Alignable* ali, int& ierr) = 0;
75 
76  // Data members
77  PosType thePosType; // Defines whether absolute/orig/relative pos. are used
78 };
79 
80 #endif
virtual int writeAbsRaw(const AlignableAbsData &ad)=0
Write absolute positions.
AlignableAbsData readAbsPos(Alignable *ali, int &ierr)
Read absolute positions of one Alignable.
AlignableAbsData readOrgPos(Alignable *ali, int &ierr)
Read original positions of one Alignable.
int writeAbsPos(Alignable *ali, bool validCheck)
Write absolute positions of one Alignable.
virtual int open(const char *filename, int iteration, bool writemode)=0
Open IO handle.
std::vector< AlignableRelData > AlignableShifts
Definition: AlignableData.h:48
virtual AlignableAbsData readAbsRaw(Alignable *ali, int &ierr)=0
Read absolute positions.
int writeOrgPos(Alignable *ali, bool validCheck)
Write original positions of one Alignable.
int writeRelPos(Alignable *ali, bool validCheck)
Write relative positions of one Alignable.
virtual AlignableRelData readRelRaw(Alignable *ali, int &ierr)=0
Read relative positions.
AlignableDataIO(PosType p)
Constructor.
AlignableRelData readRelPos(Alignable *ali, int &ierr)
Read relative positions of one Alignable.
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
virtual int close(void)=0
Close IO handle.
virtual int writeRelRaw(const AlignableRelData &ad)=0
Write relative positions.
std::vector< AlignableAbsData > AlignablePositions
Definition: AlignableData.h:47
virtual ~AlignableDataIO()
Destructor.