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 }
AlignableDataIORoot.h
AlignmentIORoot.h
AlignmentIORoot::writeAlignableAbsolutePositions
void writeAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable current absolute positions
Definition: AlignmentIORoot.cc:145
AlignmentParametersIORoot::close
int close(void) override
Close IO.
Definition: AlignmentParametersIORoot.cc:109
AlignmentParametersIO::read
align::Parameters read(const align::Alignables &alivec, int &ierr)
read AlignmentParameters of many Alignables
Definition: AlignmentParametersIO.cc:60
AlignmentCorrelationsIORoot::write
int write(const align::Correlations &cor, bool validCheck) override
write correlations
Definition: AlignmentCorrelationsIORoot.cc:42
AlignmentIORoot::readAlignmentParameters
align::Parameters readAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read AlignmentParameters
Definition: AlignmentIORoot.cc:35
AlignmentIORoot::writeAlignmentParameters
void writeAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write AlignmentParameters
Definition: AlignmentIORoot.cc:11
AlignableDataIO::readOrgPos
AlignableAbsData readOrgPos(Alignable *ali, int &ierr)
Read original positions of one Alignable.
Definition: AlignableDataIO.cc:13
AlignableDataIO::Org
Definition: AlignableDataIO.h:14
AlignmentIORoot::readAlignableOriginalPositions
AlignablePositions readAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Alignable original (before misalignment) absolute positions
Definition: AlignmentIORoot.cc:226
AlignableDataIO::writeOrgPos
int writeOrgPos(Alignable *ali, bool validCheck)
Write original positions of one Alignable.
Definition: AlignableDataIO.cc:58
AlignableDataIO::writeAbsPos
int writeAbsPos(Alignable *ali, bool validCheck)
Write absolute positions of one Alignable.
Definition: AlignableDataIO.cc:19
AlignmentIORoot::readAlignableRelativePositions
AlignableShifts readAlignableRelativePositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Alignable relative positions (shift,rotation)
Definition: AlignmentIORoot.cc:282
AlignmentParametersIO::writeOrigRigidBody
int writeOrigRigidBody(const align::Alignables &alivec, bool validCheck)
write original RigidBodyAlignmentParameters of many Alignables
Definition: AlignmentParametersIO.cc:42
AlignmentIORoot::writeAlignableOriginalPositions
void writeAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable original (before misalignment) absolute positions
Definition: AlignmentIORoot.cc:201
AlignableDataIO::Abs
Definition: AlignableDataIO.h:14
AlignableShifts
std::vector< AlignableRelData > AlignableShifts
Definition: AlignableData.h:48
AlignableDataIORoot::open
int open(const char *filename, int iteration, bool writemode) override
open IO
Definition: AlignableDataIORoot.h:22
AlignmentCorrelationsIORoot::open
int open(const char *filename, int iteration, bool writemode) override
open IO
Definition: AlignmentCorrelationsIORoot.h:18
AlignmentIORoot::readAlignableAbsolutePositions
AlignablePositions readAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Alignable current absolute positions
Definition: AlignmentIORoot.cc:170
AlignableDataIO::Rel
Definition: AlignableDataIO.h:14
AlignmentCorrelationsIORoot::close
int close(void) override
close IO
Definition: AlignmentCorrelationsIORoot.h:23
AlignmentIORoot::readCorrelations
align::Correlations readCorrelations(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Correlations
Definition: AlignmentIORoot.cc:114
AlignmentIORoot::writeAlignableRelativePositions
void writeAlignableRelativePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable relative positions (shift,rotation)
Definition: AlignmentIORoot.cc:257
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
AlignmentParametersIO::write
int write(const align::Alignables &alivec, bool validCheck)
write AlignmentParameters of many Alignables
Definition: AlignmentParametersIO.cc:25
align::Correlations
std::map< std::pair< Alignable *, Alignable * >, AlgebraicMatrix > Correlations
Definition: Utilities.h:35
AlignableDataIO::readAbsPos
AlignableAbsData readAbsPos(Alignable *ali, int &ierr)
Read absolute positions of one Alignable.
Definition: AlignableDataIO.cc:10
AlignableDataIORoot::close
int close(void) override
close IO
Definition: AlignableDataIORoot.h:28
AlignmentParametersIORoot::open
int open(const char *filename, int iteration, bool writemode) override
Open IO.
Definition: AlignmentParametersIORoot.h:30
AlignmentParametersIORoot.h
AlignmentCorrelationsIORoot.h
AlignableDataIO::writeRelPos
int writeRelPos(Alignable *ali, bool validCheck)
Write relative positions of one Alignable.
Definition: AlignableDataIO.cc:42
align::Parameters
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
AlignableDataIORoot
concrete class for ROOT based IO of Alignable positions
Definition: AlignableDataIORoot.h:14
AlignmentIORoot::writeOrigRigidBodyAlignmentParameters
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
Definition: AlignmentIORoot.cc:65
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
AlignmentCorrelationsIORoot::read
align::Correlations read(const align::Alignables &alivec, int &ierr) override
read correlations
Definition: AlignmentCorrelationsIORoot.cc:71
AlignmentIORoot::writeCorrelations
void writeCorrelations(const align::Correlations &cormap, const char *filename, int iter, bool validCheck, int &ierr) override
write Correlations
Definition: AlignmentIORoot.cc:89
AlignmentCorrelationsIORoot
Concrete class for ROOT based IO of Correlations.
Definition: AlignmentCorrelationsIORoot.h:10
mps_fire.result
result
Definition: mps_fire.py:303
AlignableDataIO::readRelPos
AlignableRelData readRelPos(Alignable *ali, int &ierr)
Read relative positions of one Alignable.
Definition: AlignableDataIO.cc:16
AlignablePositions
std::vector< AlignableAbsData > AlignablePositions
Definition: AlignableData.h:47
AlignmentParametersIORoot
Definition: AlignmentParametersIORoot.h:16