CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignmentIORoot.cc
Go to the documentation of this file.
4 
5 // this class's header
7 
8 // ----------------------------------------------------------------------------
9 // write alignment parameters
10 
11 void
13  const char* filename, int iter,
14  bool validCheck, int& ierr)
15 {
17  ierr=0;
18  int iret;
19  iret = theIO.open(filename,iter,true);
20  if (iret!=0) { ierr=-1; return;}
21  iret = theIO.write(alivec,validCheck);
22  if (iret!=0) { ierr=-2; return;}
23  iret = theIO.close();
24  if (iret!=0) { ierr=-3; return;}
25 }
26 
27 // ----------------------------------------------------------------------------
28 // read alignment parameters
31  const char* filename, int iter, int& ierr)
32 {
34 
36  ierr=0;
37  int iret;
38  iret = theIO.open(filename,iter,false);
39  if (iret!=0) { ierr=-1; return result;}
40  result = theIO.read(alivec,iret);
41  if (iret!=0) { ierr=-2; return result;}
42  iret = theIO.close();
43  if (iret!=0) { ierr=-3; return result;}
44 
45  return result;
46 }
47 
48 // ----------------------------------------------------------------------------
49 // write alignment parameters
50 void
52 (const align::Alignables& alivec, const char* filename, int iter, bool validCheck, int& ierr)
53 {
55  ierr = 0;
56  int iret = theIO.open(filename, iter, true);
57  if (iret != 0) { ierr = -1; return;}
58  iret = theIO.writeOrigRigidBody(alivec, validCheck);
59  if (iret != 0) { ierr = -2; return;}
60  iret = theIO.close();
61  if (iret != 0) { ierr = -3; return;}
62 }
63 
64 
65 // ----------------------------------------------------------------------------
66 // write correlations
67 
68 void
70  const char* filename, int iter, bool validCheck, int& ierr)
71 {
73  ierr=0;
74  int iret;
75  iret = theIO.open(filename,iter,true);
76  if (iret!=0) { ierr=-1; return;}
77  iret = theIO.write(cormap,validCheck);
78  if (iret!=0) { ierr=-2; return;}
79  iret = theIO.close();
80  if (iret!=0) { ierr=-3; return;}
81 }
82 
83 // ----------------------------------------------------------------------------
84 // read correlations
85 
87 AlignmentIORoot::readCorrelations (const align::Alignables& alivec, const char* filename,
88  int iter, int& ierr)
89 {
91 
93  ierr=0;
94  int iret;
95  iret = theIO.open(filename,iter,false);
96  if (iret!=0) { ierr=-1; return result;}
97  result = theIO.read(alivec,iret);
98  if (iret!=0) { ierr=-2; return result;}
99  iret = theIO.close();
100  if (iret!=0) { ierr=-3; return result;}
101 
102  return result;
103 }
104 
105 
106 // ----------------------------------------------------------------------------
107 // write absolute position of alignable
108 
110  const char* filename, int iter,
111  bool validCheck, int& ierr)
112 {
114  ierr=0;
115  int iret;
116  iret = theIO.open(filename,iter,true);
117  if (iret!=0) { ierr=-1; return;}
118  iret = theIO.writeAbsPos(alivec,validCheck);
119  if (iret!=0) { ierr=-2; return;}
120  iret = theIO.close();
121  if (iret!=0) { ierr=-3; return;}
122 }
123 
124 // ----------------------------------------------------------------------------
125 // read absolute position of alignable
126 
129  const char* filename, int iter, int& ierr)
130 {
132 
134  ierr=0;
135  int iret;
136  iret = theIO.open(filename,iter,false);
137  if (iret!=0) { ierr=-1; return result;}
138  result = theIO.readAbsPos(alivec,iret);
139  if (iret!=0) { ierr=-2; return result;}
140  iret = theIO.close();
141  if (iret!=0) { ierr=-3; return result;}
142 
143  return result;
144 }
145 
146 // ----------------------------------------------------------------------------
147 // write original position of alignable
148 
150  const char* filename, int iter,
151  bool validCheck, int& ierr)
152 {
154  ierr=0;
155  int iret;
156  iret = theIO.open(filename,iter,true);
157  if (iret!=0) { ierr=-1; return;}
158  iret = theIO.writeOrgPos(alivec,validCheck);
159  if (iret!=0) { ierr=-2; return;}
160  iret = theIO.close();
161  if (iret!=0) { ierr=-3; return;}
162 }
163 
164 // ----------------------------------------------------------------------------
165 // read original position of alignable
166 
169  const char* filename, int iter, int& ierr)
170 {
172 
174  ierr=0;
175  int iret;
176  iret = theIO.open(filename,iter,false);
177  if (iret!=0) { ierr=-1; return result;}
178  result = theIO.readOrgPos(alivec,iret);
179  if (iret!=0) { ierr=-2; return result;}
180  iret = theIO.close();
181  if (iret!=0) { ierr=-3; return result;}
182 
183  return result;
184 }
185 
186 // ----------------------------------------------------------------------------
187 // write relative position of alignable
188 
190  const char* filename,
191  int iter, bool validCheck, int& ierr)
192 {
194  ierr=0;
195  int iret;
196  iret = theIO.open(filename,iter,true);
197  if (iret!=0) { ierr=-1; return;}
198  iret = theIO.writeRelPos(alivec,validCheck);
199  if (iret!=0) { ierr=-2; return;}
200  iret = theIO.close();
201  if (iret!=0) { ierr=-3; return;}
202 }
203 
204 // ----------------------------------------------------------------------------
205 // read relative position of alignable
206 
209  const char* filename, int iter, int& ierr)
210 {
212 
214  ierr=0;
215  int iret;
216  iret = theIO.open(filename,iter,false);
217  if (iret!=0) { ierr=-1; return result;}
218  result = theIO.readRelPos(alivec,iret);
219  if (iret!=0) { ierr=-2; return result;}
220  iret = theIO.close();
221  if (iret!=0) { ierr=-3; return result;}
222 
223  return result;
224 }
225 
226 
227 
228 
229 
230 
AlignableAbsData readAbsPos(Alignable *ali, int &ierr)
Read absolute positions of one Alignable.
AlignableShifts readAlignableRelativePositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr)
read Alignable relative positions (shift,rotation)
AlignableAbsData readOrgPos(Alignable *ali, int &ierr)
Read original positions of one Alignable.
int writeAbsPos(Alignable *ali, bool validCheck)
Write absolute positions of one Alignable.
int write(const align::Alignables &alivec, bool validCheck)
write AlignmentParameters of many Alignables
align::Correlations read(const align::Alignables &alivec, int &ierr)
read correlations
void writeAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write Alignable original (before misalignment) absolute positions
std::map< std::pair< Alignable *, Alignable * >, AlgebraicMatrix > Correlations
Definition: Utilities.h:31
AlignablePositions readAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr)
read Alignable original (before misalignment) absolute positions
int open(const char *filename, int iteration, bool writemode)
Open IO.
std::vector< AlignableRelData > AlignableShifts
Definition: AlignableData.h:52
tuple result
Definition: mps_fire.py:95
void writeCorrelations(const align::Correlations &cormap, const char *filename, int iter, bool validCheck, int &ierr)
write Correlations
AlignablePositions readAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr)
read Alignable current absolute positions
int writeOrigRigidBody(const align::Alignables &alivec, bool validCheck)
write original RigidBodyAlignmentParameters of many Alignables
int writeOrgPos(Alignable *ali, bool validCheck)
Write original positions of one Alignable.
concrete class for ROOT based IO of Alignable positions
align::Correlations readCorrelations(const align::Alignables &alivec, const char *filename, int iter, int &ierr)
read Correlations
align::Parameters read(const align::Alignables &alivec, int &ierr)
read AlignmentParameters of many Alignables
int writeRelPos(Alignable *ali, bool validCheck)
Write relative positions of one Alignable.
void writeAlignableRelativePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write Alignable relative positions (shift,rotation)
AlignableRelData readRelPos(Alignable *ali, int &ierr)
Read relative positions of one Alignable.
void writeAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write AlignmentParameters
int open(const char *filename, int iteration, bool writemode)
open IO
std::vector< Alignable * > Alignables
Definition: Utilities.h:28
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:29
tuple filename
Definition: lut2db_cfg.py:20
int open(const char *filename, int iteration, bool writemode)
open IO
std::vector< AlignableAbsData > AlignablePositions
Definition: AlignableData.h:51
int write(const align::Correlations &cor, bool validCheck)
write correlations
void writeAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write Alignable current absolute positions
align::Parameters readAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, int &ierr)
read AlignmentParameters
void writeOrigRigidBodyAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write RigidBodyAlignmentParameters as applied on top of original positions
Concrete class for ROOT based IO of Correlations.
int close(void)
close IO