| The Gaudi Framework v32r1 (f65d50dc)

TupleDecorator.cpp
Go to the documentation of this file.
1 #ifdef __ICC
2 // disable icc remark #1572: floating-point equality and inequality comparisons are unreliable
3 // Coming from ROOT GenVector
4 # pragma warning( disable : 1572 )
5 #endif
6 // ============================================================================
7 // Include files
8 // ============================================================================
9 // CLHEP
10 // ============================================================================/
11 #include "CLHEP/Matrix/GenMatrix.h"
12 #include "CLHEP/Matrix/Matrix.h"
13 #include "CLHEP/Matrix/Vector.h"
14 // Handle CLHEP 2.0.x move to CLHEP namespace
15 namespace CLHEP {}
16 using namespace CLHEP;
17 // CLHEP is just #()$)*#)*@#)$@ Not even the git master (as of Aug 2015) has HepVector::begin and HepVector::end
18 // defined!!!
19 // fortunately, ADL comes to the rescue...
20 namespace CLHEP {
21 class HepVector;
22 double* begin( CLHEP::HepVector& v ) { return &v[0]; }
23 const double* begin( const CLHEP::HepVector& v ) { return &v[0]; }
24 } // namespace CLHEP
25
26 // ============================================================================/
27 // GaudiAlg
28 // ============================================================================
29 #include "GaudiAlg/Tuple.h"
30 #include "GaudiAlg/TupleObj.h"
31 // ============================================================================
32 // GaudiPython
33 // ============================================================================
34 #include "GaudiPython/TupleDecorator.h"
35 #include "GaudiPython/Vector.h"
36 // ===========================================================================
42 // ============================================================================
43 namespace {
44 // ==========================================================================
45 template <class TYPE>
46 inline StatusCode _fill( const Tuples::Tuple& tuple, const std::string& name, const TYPE& value ) {
47 return tuple.valid() ? tuple->column( name, value ) : StatusCode::FAILURE;
48 }
49 // ==========================================================================
50 } // namespace
51 // ============================================================================
52 INTuple* GaudiPython::TupleDecorator::nTuple( const Tuples::Tuple& tuple ) {
53 if ( !tuple.valid() ) { return 0; }
54 return tuple->tuple();
55 }
56 // ============================================================================
57 NTuple::Tuple* GaudiPython::TupleDecorator::ntuple( const Tuples::Tuple& tuple ) {
58 if ( !tuple.valid() ) { return 0; }
59 return tuple->tuple();
60 }
61 // ============================================================================
62 bool GaudiPython::TupleDecorator::valid( const Tuples::Tuple& tuple ) { return tuple.valid(); }
63 // ============================================================================
64 StatusCode GaudiPython::TupleDecorator::write( const Tuples::Tuple& tuple ) {
65 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
66 return tuple->write();
67 }
68 // ============================================================================
69 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name, const int value ) {
70 return _fill( tuple, name, value );
71 }
72 // ============================================================================
73 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name, const int value,
74 const int minv, const int maxv ) {
75 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
76 return tuple->column( name, value, minv, maxv );
77 }
78 // ============================================================================
79 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
80 const double value ) {
81 return _fill( tuple, name, value );
82 }
83 // ============================================================================
84 StatusCode GaudiPython::TupleDecorator::column_ll( const Tuples::Tuple& tuple, const std::string& name,
85 const long long value ) {
86 return _fill( tuple, name, value );
87 }
88 // ============================================================================
89 StatusCode GaudiPython::TupleDecorator::column_ull( const Tuples::Tuple& tuple, const std::string& name,
90 const unsigned long long value ) {
91 return _fill( tuple, name, value );
92 }
93 // ============================================================================
94 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
95 const bool value ) {
96 return _fill( tuple, name, value );
97 }
98 // ============================================================================
99 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
100 IOpaqueAddress* value ) {
101 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
102 return tuple->column( name, value );
103 }
104 // ============================================================================
105 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, IOpaqueAddress* value ) {
106 return column( tuple, "Address", value );
107 }
108 // ============================================================================
109 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
110 const Gaudi::LorentzVector& value ) {
111 return _fill( tuple, name, value );
112 }
113 // ============================================================================
114 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
115 const Gaudi::XYZVector& value ) {
116 return _fill( tuple, name, value );
117 }
118 // ============================================================================
119 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
120 const Gaudi::XYZPoint& value ) {
121 return _fill( tuple, name, value );
122 }
123 // ============================================================================
124 StatusCode GaudiPython::TupleDecorator::farray( const Tuples::Tuple& tuple, const std::string& name,
125 const std::vector<double>& data, const std::string& length,
126 const size_t maxv ) {
127 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
128 return tuple->farray( name, data.begin(), data.end(), length, maxv );
129 }
130 // ============================================================================
131 StatusCode GaudiPython::TupleDecorator::fmatrix( const Tuples::Tuple& tuple, const std::string& name,
132 const GaudiPython::Matrix& data,
133 const Tuples::TupleObj::MIndex cols, // fixed !!!
134 const std::string& length, const size_t maxv ) {
135 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
136 if ( !data.empty() && cols != data.front().size() ) {
137 return tuple->Error( "GP:fmatrix(1): mismatch in matrix dimensions!" );
138 }
139 return tuple->fmatrix( name, data, data.size(), cols, length, maxv );
140 }
141 // ============================================================================
142 StatusCode GaudiPython::TupleDecorator::fmatrix( const Tuples::Tuple& tuple, const std::string& name,
143 const GaudiUtils::VectorMap<int, double>& info,
144 const std::string& length, const size_t maxv ) {
145 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
146 return tuple->fmatrix( name, info, length, maxv );
147 }
148 // ============================================================================
149 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
150 const std::vector<double>& data ) {
151 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
152 return tuple->array( name, data.begin(), data.end() );
153 }
154 // ============================================================================
155 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
156 const Gaudi::Vector1& data ) {
157 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
158 return tuple->array( name, data );
159 }
160 // ============================================================================
161 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
162 const Gaudi::Vector2& data ) {
163 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
164 return tuple->array( name, data );
165 }
166 // ============================================================================
167 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
168 const Gaudi::Vector3& data ) {
169 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
170 return tuple->array( name, data.begin(), data.begin() + 3 );
171 }
172 // ============================================================================
173 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
174 const Gaudi::Vector4& data ) {
175 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
176 // return tuple->array( name , data ) ;
177 return tuple->array( name, data.begin(), data.begin() + 4 );
178 }
179 // ============================================================================
180 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
181 const Gaudi::Vector5& data ) {
182 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
183 return tuple->array( name, data );
184 }
185 // ============================================================================
186 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
187 const Gaudi::Vector6& data ) {
188 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
189 return tuple->array( name, data );
190 }
191 // ============================================================================
192 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
193 const Gaudi::Vector7& data ) {
194 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
195 return tuple->array( name, data );
196 }
197 // ============================================================================
198 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
199 const Gaudi::Vector8& data ) {
200 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
201 return tuple->array( name, data );
202 }
203 // ============================================================================
204 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
205 const Gaudi::Vector9& data ) {
206 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
207 return tuple->array( name, data );
208 }
209 // ============================================================================
210 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
211 const GaudiPython::Matrix& data,
212 const Tuples::TupleObj::MIndex cols ) // fixed !!!
213 {
214 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
215 if ( data.empty() ) { return tuple->Warning( "GP:matrix(1): empty fixed matrix, skip matrix " ); }
216 if ( cols != data.front().size() ) { return tuple->Error( "GP:matrix(1): mismatch in fixed matrix dimensions!" ); }
217 return tuple->matrix( name, data, data.size(), cols );
218 }
219 // ============================================================================
220 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
221 const Gaudi::Matrix1x1& data ) {
222 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
223 return tuple->matrix( name, data );
224 }
225 // ============================================================================
226 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
227 const Gaudi::Matrix2x2& data ) {
228 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
229 return tuple->matrix( name, data );
230 }
231 // ============================================================================
232 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
233 const Gaudi::Matrix3x3& data ) {
234 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
235 return tuple->matrix( name, data );
236 }
237 // ============================================================================
238 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
239 const Gaudi::Matrix4x4& data ) {
240 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
241 return tuple->matrix( name, data );
242 }
243 // ============================================================================
244 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
245 const Gaudi::Matrix5x5& data ) {
246 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
247 return tuple->matrix( name, data );
248 }
249 // ============================================================================
250 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
251 const Gaudi::Matrix6x6& data ) {
252 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
253 return tuple->matrix( name, data );
254 }
255 // ============================================================================
256 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
257 const Gaudi::Matrix7x7& data ) {
258 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
259 return tuple->matrix( name, data );
260 }
261 // ============================================================================
262 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
263 const Gaudi::Matrix8x8& data ) {
264 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
265 return tuple->matrix( name, data );
266 }
267 // ============================================================================
268 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
269 const Gaudi::Matrix9x9& data ) {
270 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
271 return tuple->matrix( name, data );
272 }
273 // ============================================================================
274 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
275 const Gaudi::Matrix1x3& data ) {
276 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
277 return tuple->matrix( name, data );
278 }
279 // ============================================================================
280 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
281 const Gaudi::Matrix1x5& data ) {
282 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
283 return tuple->matrix( name, data );
284 }
285 // ============================================================================
286 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
287 const Gaudi::Matrix1x6& data ) {
288 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
289 return tuple->matrix( name, data );
290 }
291 // ============================================================================
292 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
293 const Gaudi::Matrix4x3& data ) {
294 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
295 return tuple->matrix( name, data );
296 }
297 // ============================================================================
298 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
299 const Gaudi::Matrix3x4& data ) {
300 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
301 return tuple->matrix( name, data );
302 }
303 // ============================================================================
304 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
305 const Gaudi::Matrix3x5& data ) {
306 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
307 return tuple->matrix( name, data );
308 }
309 // ============================================================================
310 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
311 const Gaudi::Matrix3x6& data ) {
312 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
313 return tuple->matrix( name, data );
314 }
315 // ============================================================================
316 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
317 const Gaudi::Matrix2x3& data ) {
318 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
319 return tuple->matrix( name, data );
320 }
321 // ============================================================================
322 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
323 const Gaudi::Matrix3x2& data ) {
324 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
325 return tuple->matrix( name, data );
326 }
327 // ============================================================================
328 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
329 const Gaudi::SymMatrix1x1& data ) {
330 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
331 return tuple->matrix( name, data );
332 }
333 // ============================================================================
334 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
335 const Gaudi::SymMatrix2x2& data ) {
336 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
337 return tuple->matrix( name, data );
338 }
339 // ============================================================================
340 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
341 const Gaudi::SymMatrix3x3& data ) {
342 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
343 return tuple->matrix( name, data );
344 }
345 // ============================================================================
346 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
347 const Gaudi::SymMatrix4x4& data ) {
348 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
349 return tuple->matrix( name, data );
350 }
351 // ============================================================================
352 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
353 const Gaudi::SymMatrix5x5& data ) {
354 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
355 return tuple->matrix( name, data );
356 }
357 // ============================================================================
358 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
359 const Gaudi::SymMatrix6x6& data ) {
360 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
361 return tuple->matrix( name, data );
362 }
363 // ============================================================================
364 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
365 const Gaudi::SymMatrix7x7& data ) {
366 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
367 return tuple->matrix( name, data );
368 }
369 // ============================================================================
370 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
371 const Gaudi::SymMatrix8x8& data ) {
372 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
373 return tuple->matrix( name, data );
374 }
375 // ============================================================================
376 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
377 const Gaudi::SymMatrix9x9& data ) {
378 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
379 return tuple->matrix( name, data );
380 }
381 // ============================================================================
382 // advanced column: time
383 // ============================================================================
384 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const Gaudi::Time& value ) {
385 return column( tuple, "", value );
386 }
387 // ============================================================================
388 // advanced column: time
389 // ============================================================================
390 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
391 const Gaudi::Time& value ) {
392 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
393 StatusCode sc = StatusCode::SUCCESS;
394 //
395 sc = tuple->column( name + "year", value.year( true ), 1970, 2070 );
396 if ( sc.isFailure() ) { return sc; }
397 sc = tuple->column( name + "month", value.month( true ) + 1, 1, 16 );
398 if ( sc.isFailure() ) { return sc; }
399 sc = tuple->column( name + "day", value.day( true ), 0, 32 );
400 if ( sc.isFailure() ) { return sc; }
401 sc = tuple->column( name + "hour", value.hour( true ), 0, 25 );
402 if ( sc.isFailure() ) { return sc; }
403 sc = tuple->column( name + "minute", value.minute( true ), 0, 61 );
404 if ( sc.isFailure() ) { return sc; }
405 sc = tuple->column( name + "second", value.second( true ), 0, 61 );
406 if ( sc.isFailure() ) { return sc; }
407 sc = tuple->column( name + "nsecond", value.nsecond() );
408 //
409 return sc;
410 }
411 // ============================================================================
412
413 // ============================================================================
414 // Legacy:
415 // ============================================================================
416 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
417 const CLHEP::HepVector& data ) {
418 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
419 return tuple->array( name, data, data.num_row() );
420 }
421 // ============================================================================
422 StatusCode GaudiPython::TupleDecorator::farray( const Tuples::Tuple& tuple, const std::string& name,
423 const CLHEP::HepVector& data, const std::string& length,
424 const size_t maxv ) {
425 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
426 // use the trick!
427 const double* begin = &( data[0] );
428 const double* end = begin + data.num_row();
429 return tuple->farray( name, begin, end, length, maxv );
430 }
431 // ============================================================================
432 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
433 const CLHEP::HepGenMatrix& data ) {
434 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
435 if ( 1 > data.num_col() ) { return tuple->Error( "GP:matrix(2): illegal fixed matrix num_col" ); }
436 if ( 1 > data.num_row() ) { return tuple->Error( "GP:matrix(2): illegal fixed matrix num_row" ); }
437 return tuple->matrix( name, data, data.num_row(), data.num_col() );
438 }
439 // ============================================================================
440 StatusCode GaudiPython::TupleDecorator::fmatrix( const Tuples::Tuple& tuple, const std::string& name,
441 const CLHEP::HepGenMatrix& data,
442 const Tuples::TupleObj::MIndex cols, // fixed !!!
443 const std::string& length, const size_t maxv ) {
444 if ( !tuple.valid() ) { return StatusCode::FAILURE; }
445 if ( cols != data.num_col() ) { return tuple->Error( "GP:fmatrix(2): mismatch in matrix dimensions!" ); }
446 return tuple->fmatrix( name, data, data.num_row(), cols, length, maxv );
447 }
448 // ============================================================================
449
450 // ============================================================================
451 // Tuple-Alg-decorator
452 // ============================================================================
453 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const std::string& title,
454 const CLID& clid ) {
455 return algo.nTuple( title, clid );
456 }
457 // ============================================================================
458 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID,
459 const std::string& title, const CLID& clid ) {
460 return algo.nTuple( ID, title, clid );
461 }
462 // ============================================================================
463 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const int ID, const std::string& title,
464 const CLID& clid ) {
465 return algo.nTuple( ID, title, clid );
466 }
467 // ============================================================================
468 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const std::string& ID,
469 const std::string& title, const CLID& clid ) {
470 return algo.nTuple( ID, title, clid );
471 }
472 // ============================================================================
473 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const std::string& title,
474 const CLID& clid ) {
475 return algo.evtCol( title, clid );
476 }
477 // ============================================================================
478 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID,
479 const std::string& title, const CLID& clid ) {
480 return algo.evtCol( ID, title, clid );
481 }
482 // ============================================================================
483 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const int ID, const std::string& title,
484 const CLID& clid ) {
485 return algo.evtCol( ID, title, clid );
486 }
487 // ============================================================================
488 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const std::string& ID,
489 const std::string& title, const CLID& clid ) {
490 return algo.evtCol( ID, title, clid );
491 }
492 // ============================================================================
493 // The END
494 // ============================================================================
Gaudi::Matrix8x8
ROOT::Math::SMatrix< double, 8, 8 > Matrix8x8
Generic 8x8 matrix (double)
Definition: GenericMatrixTypes.h:36
GaudiPython::TupleDecorator::fmatrix
static StatusCode fmatrix(const Tuples::Tuple &tuple, const std::string &name, const GaudiPython::Matrix &data, const Tuples::TupleObj::MIndex cols, const std::string &length, const size_t maxv)
Advanced columns: floating-size matrices.
Definition: TupleDecorator.cpp:131
Gaudi::Matrix4x4
ROOT::Math::SMatrix< double, 4, 4 > Matrix4x4
Generic 4x4 matrix (double)
Definition: GenericMatrixTypes.h:32
Gaudi::Time::year
int year(bool local) const
Get the year.
Definition: Time.cpp:166
GaudiUtils::VectorMap
A bit modified version of 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandr...
Definition: VectorMap.h:102
std::vector::empty
T empty(T... args)
Gaudi::SymMatrix1x1
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > SymMatrix1x1
Symmetrix 1x1 matrix (double)
Definition: SymmetricMatrixTypes.h:27
Tuples::TupleObj::matrix
StatusCode matrix(const std::string &name, const MATRIX &data, const MIndex &rows, const MIndex &cols)
fill N-Tuple with fixed-size matrix
Definition: TupleObj.h:1688
Gaudi::Matrix3x5
ROOT::Math::SMatrix< double, 3, 5 > Matrix3x5
Generic 3x5 matrix (double)
Definition: GenericMatrixTypes.h:44
Vector.h
GaudiPython::TupleDecorator::nTuple
static INTuple * nTuple(const Tuples::Tuple &tuple)
accessors to internal
Definition: TupleDecorator.cpp:52
Gaudi::SymMatrix5x5
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > SymMatrix5x5
Symmetrix 5x5 matrix (double)
Definition: SymmetricMatrixTypes.h:35
Gaudi::Time::day
int day(bool local) const
Get the day of month, numbered [1,31].
Definition: Time.cpp:172
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Vector7
ROOT::Math::SVector< double, 7 > Vector7
7D Vector (double)
Definition: GenericVectorTypes.h:35
GaudiTupleAlg
Simple class to extend the functionality of class GaudiHistoAlg.
Definition: GaudiTupleAlg.h:41
TupleObj.h
Header file for class TupleObj.
std::vector::front
T front(T... args)
Gaudi::SymMatrix3x3
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > SymMatrix3x3
Symmetrix 3x3 matrix (double)
Definition: SymmetricMatrixTypes.h:31
GaudiPython::TupleDecorator::valid
static bool valid(const Tuples::Tuple &tuple)
status of the tuple
Definition: TupleDecorator.cpp:62
Gaudi::SymMatrix9x9
ROOT::Math::SMatrix< double, 9, 9, ROOT::Math::MatRepSym< double, 9 > > SymMatrix9x9
Symmetrix 9x9 matrix (double)
Definition: SymmetricMatrixTypes.h:43
Tuples::TupleObj::column
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:292
GaudiPython::TupleDecorator::column_ll
static StatusCode column_ll(const Tuples::Tuple &tuple, const std::string &name, const long long value)
more or less simple columns: long long
Definition: TupleDecorator.cpp:84
GaudiPython::TupleDecorator::farray
static StatusCode farray(const Tuples::Tuple &tuple, const std::string &name, const std::vector< double > &data, const std::string &length, const size_t maxv)
Advanced columns: floating-size arrays.
Definition: TupleDecorator.cpp:124
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
GaudiPython::TupleDecorator::matrix
static StatusCode matrix(const Tuples::Tuple &tuple, const std::string &name, const GaudiPython::Matrix &data, const Tuples::TupleObj::MIndex cols)
Advanced columns: fixed size matrices.
Definition: TupleDecorator.cpp:210
Gaudi::Matrix9x9
ROOT::Math::SMatrix< double, 9, 9 > Matrix9x9
Generic 9x9 matrix (double)
Definition: GenericMatrixTypes.h:37
Gaudi::Vector3
ROOT::Math::SVector< double, 3 > Vector3
3D Vector (double)
Definition: GenericVectorTypes.h:31
std::vector::end
T end(T... args)
Gaudi::Matrix3x3
ROOT::Math::SMatrix< double, 3, 3 > Matrix3x3
Generic 3x3 matrix (double)
Definition: GenericMatrixTypes.h:31
Tuples::TupleObj::fmatrix
StatusCode fmatrix(const std::string &name, const MATRIX &data, size_t rows, const MIndex &cols, const std::string &length, size_t maxv)
Fill N-Tuple with data from variable-size matrix.
Definition: TupleObj.h:1292
Gaudi::Time::hour
int hour(bool local) const
Get the hour, numbered [0, 23].
Definition: Time.cpp:175
Tuples::TupleObj::MIndex
unsigned short MIndex
Definition: TupleObj.h:245
TupleDecorator.h
Gaudi::Matrix3x2
ROOT::Math::SMatrix< double, 3, 2 > Matrix3x2
Generic 3x2 matrix (double)
Definition: GenericMatrixTypes.h:47
ROOT::Math::PositionVector3D
Definition: IMagneticFieldSvc.h:15
Gaudi::Vector9
ROOT::Math::SVector< double, 9 > Vector9
9D Vector (double)
Definition: GenericVectorTypes.h:37
Gaudi::SymMatrix7x7
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > SymMatrix7x7
Symmetrix 7x7 matrix (double)
Definition: SymmetricMatrixTypes.h:39
Gaudi::Vector2
ROOT::Math::SVector< double, 2 > Vector2
2D Vector (double)
Definition: GenericVectorTypes.h:30
Gaudi::SymMatrix4x4
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SymMatrix4x4
Symmetrix 4x4 matrix (double)
Definition: SymmetricMatrixTypes.h:33
Tuples::TupleObj::farray
StatusCode farray(const std::string &name, ITERATOR1 &&first, ITERATOR2 &&last, const std::string &length, size_t maxv)
Add an indexed array (of type float) to N-tuple.
Definition: TupleObj.h:876
Gaudi::SymMatrix6x6
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > SymMatrix6x6
Symmetrix 6x6 matrix (double)
Definition: SymmetricMatrixTypes.h:37
Gaudi::Vector8
ROOT::Math::SVector< double, 8 > Vector8
8D Vector (double)
Definition: GenericVectorTypes.h:36
Tuples::TupleObj::Warning
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
std::string
STL class.
Gaudi::Matrix1x1
ROOT::Math::SMatrix< double, 1, 1 > Matrix1x1
Generic 1x1 matrix (double)
Definition: GenericMatrixTypes.h:29
INTuple
NTuple interface class definition.
Definition: INTuple.h:81
Tuples::Tuple
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: Tuple.h:116
Gaudi::Matrix3x6
ROOT::Math::SMatrix< double, 3, 6 > Matrix3x6
Generic 3x6 matrix (double)
Definition: GenericMatrixTypes.h:45
Gaudi::Matrix4x3
ROOT::Math::SMatrix< double, 4, 3 > Matrix4x3
Generic 4x3 matrix (double)
Definition: GenericMatrixTypes.h:42
Gaudi::Matrix2x3
ROOT::Math::SMatrix< double, 2, 3 > Matrix2x3
Generic 2x3 matrix (double)
Definition: GenericMatrixTypes.h:46
Gaudi::Matrix1x6
ROOT::Math::SMatrix< double, 1, 6 > Matrix1x6
Generic 1x6 matrix (double)
Definition: GenericMatrixTypes.h:41
Gaudi::Matrix6x6
ROOT::Math::SMatrix< double, 6, 6 > Matrix6x6
Generic 6x6 matrix (double)
Definition: GenericMatrixTypes.h:34
GaudiTuples::nTuple
Tuple nTuple(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an N-Tuple object (book on-demand) with unique identifier.
Definition: GaudiTuples.icpp:107
GaudiPython::TupleDecorator::column
static StatusCode column(const Tuples::Tuple &tuple, const std::string &name, const int value)
more or less simple columns: long
Definition: TupleDecorator.cpp:69
Gaudi::Time
Based on seal::Time.
Definition: Time.h:231
GaudiPython::TupleAlgDecorator::nTuple
static Tuples::Tuple nTuple(const GaudiTupleAlg &algo, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
Definition: TupleDecorator.cpp:453
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
GaudiPython::TupleDecorator::ntuple
static NTuple::Tuple * ntuple(const Tuples::Tuple &tuple)
accessors to internal
Definition: TupleDecorator.cpp:57
Gaudi::Matrix5x5
ROOT::Math::SMatrix< double, 5, 5 > Matrix5x5
Generic 5x5 matrix (double)
Definition: GenericMatrixTypes.h:33
Gaudi::Time::second
int second(bool local) const
Get the seconds, numbered [0,61] (allowing one or two leap seconds, years with leap seconds can have ...
Definition: Time.cpp:183
Gaudi::SymMatrix8x8
ROOT::Math::SMatrix< double, 8, 8, ROOT::Math::MatRepSym< double, 8 > > SymMatrix8x8
Symmetrix 8x8 matrix (double)
Definition: SymmetricMatrixTypes.h:41
Gaudi::Time::nsecond
int nsecond() const
Get the nanoseconds.
Definition: Time.cpp:188
Gaudi::Matrix7x7
ROOT::Math::SMatrix< double, 7, 7 > Matrix7x7
Generic 7x7 matrix (double)
Definition: GenericMatrixTypes.h:35
Tuples::TupleObj::write
StatusCode write()
write a record to NTuple
Definition: TupleObj.cpp:229
Tuples::TupleObj::tuple
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:1851
IOTest.end
def end
Definition: IOTest.py:112
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
Tuples::TupleObj::Error
virtual StatusCode Error(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
ROOT::Math::DisplacementVector3D
Definition: IMagneticFieldSvc.h:18
Gaudi::Time::month
int month(bool local) const
Get the month, numbered [0,11].
Definition: Time.cpp:169
Gaudi::Vector6
ROOT::Math::SVector< double, 6 > Vector6
6D Vector (double)
Definition: GenericVectorTypes.h:34
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:375
Tuples::Tuple::valid
bool valid() const
check the validity of the tuple object
Definition: Tuple.h:132
GaudiTuples::evtCol
Tuple evtCol(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an Event Tag Collection object (book on-demand) with unique identifier.
Definition: GaudiTuples.icpp:140
std::vector::size
T size(T... args)
Gaudi::Matrix1x5
ROOT::Math::SMatrix< double, 1, 5 > Matrix1x5
Generic 1x5 matrix (double)
Definition: GenericMatrixTypes.h:40
Gaudi::Matrix2x2
ROOT::Math::SMatrix< double, 2, 2 > Matrix2x2
Generic 2x2 matrix (double)
Definition: GenericMatrixTypes.h:30
Tuples::TupleObj::array
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1533
std::vector< double >
Gaudi::SymMatrix2x2
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SymMatrix2x2
Symmetrix 2x2 matrix (double)
Definition: SymmetricMatrixTypes.h:29
GaudiPython::TupleDecorator::column_ull
static StatusCode column_ull(const Tuples::Tuple &tuple, const std::string &name, const unsigned long long value)
more or less simple columns: unsigned long long
Definition: TupleDecorator.cpp:89
GaudiPython::TupleDecorator::write
static StatusCode write(const Tuples::Tuple &tuple)
commit the row
Definition: TupleDecorator.cpp:64
Gaudi::Vector4
ROOT::Math::SVector< double, 4 > Vector4
4D Vector (double)
Definition: GenericVectorTypes.h:32
std::vector::begin
T begin(T... args)
GaudiPython::TupleAlgDecorator::evtCol
static Tuples::Tuple evtCol(const GaudiTupleAlg &algo, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
Definition: TupleDecorator.cpp:473
CLHEP
Definition: TupleDecorator.h:31
Gaudi::Matrix1x3
ROOT::Math::SMatrix< double, 1, 3 > Matrix1x3
Generic 1x3 matrix (double)
Definition: GenericMatrixTypes.h:39
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Gaudi::LorentzVector
ROOT::Math::PxPyPzEVector LorentzVector
Cartesian 4 Vector.
Definition: Vector4DTypes.h:30
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
Gaudi::Matrix3x4
ROOT::Math::SMatrix< double, 3, 4 > Matrix3x4
Generic 3x4 matrix (double)
Definition: GenericMatrixTypes.h:43
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
Gaudi::Time::minute
int minute(bool local) const
Get the minute, numbered [0, 59].
Definition: Time.cpp:178
GaudiPython::TupleDecorator::array
static StatusCode array(const Tuples::Tuple &tuple, const std::string &name, const std::vector< double > &data)
Advanced columns: fixed size arrays.
Definition: TupleDecorator.cpp:149
CLHEP::begin
double * begin(CLHEP::HepVector &v)
Definition: TupleDecorator.cpp:22
Gaudi::Vector5
ROOT::Math::SVector< double, 5 > Vector5
5D Vector (double)
Definition: GenericVectorTypes.h:33
GaudiAlg::ID
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:43
Tuple.h
Header file for class : Tuple.
Gaudi::Vector1
ROOT::Math::SVector< double, 1 > Vector1
1D Vector (double)
Definition: GenericVectorTypes.h:29
GaudiPython.GaudiAlgs.column
column
Definition: GaudiAlgs.py:1191