CMS 3D CMS Logo

AlignmentIORoot.cc
Go to the documentation of this file.
4 
5 // this class's header
7 
8 // ----------------------------------------------------------------------------
9 // write alignment parameters
10 
12  const align::Alignables& alivec, const char* filename, int iter, bool validCheck, int& ierr) {
14  ierr = 0;
15  int iret;
16  iret = theIO.open(filename, iter, true);
17  if (iret != 0) {
18  ierr = -1;
19  return;
20  }
21  iret = theIO.write(alivec, validCheck);
22  if (iret != 0) {
23  ierr = -2;
24  return;
25  }
26  iret = theIO.close();
27  if (iret != 0) {
28  ierr = -3;
29  return;
30  }
31 }
32 
33 // ----------------------------------------------------------------------------
34 // read alignment parameters
36  const char* filename,
37  int iter,
38  int& ierr) {
40 
42  ierr = 0;
43  int iret;
44  iret = theIO.open(filename, iter, false);
45  if (iret != 0) {
46  ierr = -1;
47  return result;
48  }
49  result = theIO.read(alivec, iret);
50  if (iret != 0) {
51  ierr = -2;
52  return result;
53  }
54  iret = theIO.close();
55  if (iret != 0) {
56  ierr = -3;
57  return result;
58  }
59 
60  return result;
61 }
62 
63 // ----------------------------------------------------------------------------
64 // write alignment parameters
66  const align::Alignables& alivec, const char* filename, int iter, bool validCheck, int& ierr) {
68  ierr = 0;
69  int iret = theIO.open(filename, iter, true);
70  if (iret != 0) {
71  ierr = -1;
72  return;
73  }
74  iret = theIO.writeOrigRigidBody(alivec, validCheck);
75  if (iret != 0) {
76  ierr = -2;
77  return;
78  }
79  iret = theIO.close();
80  if (iret != 0) {
81  ierr = -3;
82  return;
83  }
84 }
85 
86 // ----------------------------------------------------------------------------
87 // write correlations
88 
90  const align::Correlations& cormap, const char* filename, int iter, bool validCheck, int& ierr) {
92  ierr = 0;
93  int iret;
94  iret = theIO.open(filename, iter, true);
95  if (iret != 0) {
96  ierr = -1;
97  return;
98  }
99  iret = theIO.write(cormap, validCheck);
100  if (iret != 0) {
101  ierr = -2;
102  return;
103  }
104  iret = theIO.close();
105  if (iret != 0) {
106  ierr = -3;
107  return;
108  }
109 }
110 
111 // ----------------------------------------------------------------------------
112 // read correlations
113 
115  const char* filename,
116  int iter,
117  int& ierr) {
119 
121  ierr = 0;
122  int iret;
123  iret = theIO.open(filename, iter, false);
124  if (iret != 0) {
125  ierr = -1;
126  return result;
127  }
128  result = theIO.read(alivec, iret);
129  if (iret != 0) {
130  ierr = -2;
131  return result;
132  }
133  iret = theIO.close();
134  if (iret != 0) {
135  ierr = -3;
136  return result;
137  }
138 
139  return result;
140 }
141 
142 // ----------------------------------------------------------------------------
143 // write absolute position of alignable
144 
146  const align::Alignables& alivec, const char* filename, int iter, bool validCheck, int& ierr) {
148  ierr = 0;
149  int iret;
150  iret = theIO.open(filename, iter, true);
151  if (iret != 0) {
152  ierr = -1;
153  return;
154  }
155  iret = theIO.writeAbsPos(alivec, validCheck);
156  if (iret != 0) {
157  ierr = -2;
158  return;
159  }
160  iret = theIO.close();
161  if (iret != 0) {
162  ierr = -3;
163  return;
164  }
165 }
166 
167 // ----------------------------------------------------------------------------
168 // read absolute position of alignable
169 
171  const char* filename,
172  int iter,
173  int& ierr) {
175 
177  ierr = 0;
178  int iret;
179  iret = theIO.open(filename, iter, false);
180  if (iret != 0) {
181  ierr = -1;
182  return result;
183  }
184  result = theIO.readAbsPos(alivec, iret);
185  if (iret != 0) {
186  ierr = -2;
187  return result;
188  }
189  iret = theIO.close();
190  if (iret != 0) {
191  ierr = -3;
192  return result;
193  }
194 
195  return result;
196 }
197 
198 // ----------------------------------------------------------------------------
199 // write original position of alignable
200 
202  const align::Alignables& alivec, const char* filename, int iter, bool validCheck, int& ierr) {
204  ierr = 0;
205  int iret;
206  iret = theIO.open(filename, iter, true);
207  if (iret != 0) {
208  ierr = -1;
209  return;
210  }
211  iret = theIO.writeOrgPos(alivec, validCheck);
212  if (iret != 0) {
213  ierr = -2;
214  return;
215  }
216  iret = theIO.close();
217  if (iret != 0) {
218  ierr = -3;
219  return;
220  }
221 }
222 
223 // ----------------------------------------------------------------------------
224 // read original position of alignable
225 
227  const char* filename,
228  int iter,
229  int& ierr) {
231 
233  ierr = 0;
234  int iret;
235  iret = theIO.open(filename, iter, false);
236  if (iret != 0) {
237  ierr = -1;
238  return result;
239  }
240  result = theIO.readOrgPos(alivec, iret);
241  if (iret != 0) {
242  ierr = -2;
243  return result;
244  }
245  iret = theIO.close();
246  if (iret != 0) {
247  ierr = -3;
248  return result;
249  }
250 
251  return result;
252 }
253 
254 // ----------------------------------------------------------------------------
255 // write relative position of alignable
256 
258  const align::Alignables& alivec, const char* filename, int iter, bool validCheck, int& ierr) {
260  ierr = 0;
261  int iret;
262  iret = theIO.open(filename, iter, true);
263  if (iret != 0) {
264  ierr = -1;
265  return;
266  }
267  iret = theIO.writeRelPos(alivec, validCheck);
268  if (iret != 0) {
269  ierr = -2;
270  return;
271  }
272  iret = theIO.close();
273  if (iret != 0) {
274  ierr = -3;
275  return;
276  }
277 }
278 
279 // ----------------------------------------------------------------------------
280 // read relative position of alignable
281 
283  const char* filename,
284  int iter,
285  int& ierr) {
287 
289  ierr = 0;
290  int iret;
291  iret = theIO.open(filename, iter, false);
292  if (iret != 0) {
293  ierr = -1;
294  return result;
295  }
296  result = theIO.readRelPos(alivec, iret);
297  if (iret != 0) {
298  ierr = -2;
299  return result;
300  }
301  iret = theIO.close();
302  if (iret != 0) {
303  ierr = -3;
304  return result;
305  }
306 
307  return result;
308 }
AlignableShifts readAlignableRelativePositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Alignable relative positions (shift,rotation)
AlignableAbsData readAbsPos(Alignable *ali, int &ierr)
Read absolute positions of one Alignable.
int open(const char *filename, int iteration, bool writemode) override
Open IO.
AlignableAbsData readOrgPos(Alignable *ali, int &ierr)
Read original positions of one Alignable.
AlignablePositions readAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Alignable original (before misalignment) absolute positions
int writeAbsPos(Alignable *ali, bool validCheck)
Write absolute positions of one Alignable.
align::Correlations readCorrelations(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Correlations
int write(const align::Alignables &alivec, bool validCheck)
write AlignmentParameters of many Alignables
void writeAlignableRelativePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable relative positions (shift,rotation)
void writeCorrelations(const align::Correlations &cormap, const char *filename, int iter, bool validCheck, int &ierr) override
write Correlations
std::map< std::pair< Alignable *, Alignable * >, AlgebraicMatrix > Correlations
Definition: Utilities.h:36
void writeAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable original (before misalignment) absolute positions
int close(void) override
close IO
std::vector< AlignableRelData > AlignableShifts
Definition: AlignableData.h:48
void writeOrigRigidBodyAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write RigidBodyAlignmentParameters as applied on top of original positions
void writeAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write AlignmentParameters
int writeOrigRigidBody(const align::Alignables &alivec, bool validCheck)
write original RigidBodyAlignmentParameters of many Alignables
align::Parameters readAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read AlignmentParameters
AlignablePositions readAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Alignable current absolute positions
int writeOrgPos(Alignable *ali, bool validCheck)
Write original positions of one Alignable.
concrete class for ROOT based IO of Alignable positions
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.
AlignableRelData readRelPos(Alignable *ali, int &ierr)
Read relative positions of one Alignable.
int write(const align::Correlations &cor, bool validCheck) override
write correlations
int close(void) override
close IO
void writeAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable current absolute positions
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:33
align::Correlations read(const align::Alignables &alivec, int &ierr) override
read correlations
std::vector< AlignableAbsData > AlignablePositions
Definition: AlignableData.h:47
int open(const char *filename, int iteration, bool writemode) override
open IO
int close(void) override
Close IO.
Concrete class for ROOT based IO of Correlations.
int open(const char *filename, int iteration, bool writemode) override
open IO