| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
17 }
18 using namespace CLHEP;
19 // CLHEP is just #()$)*#)*@#)$@ Not even the git master (as of Aug 2015) has HepVector::begin and HepVector::end
20 // defined!!!
21 // fortunately, ADL comes to the rescue...
22 namespace CLHEP
23 {
24 class HepVector;
25 double* begin( CLHEP::HepVector& v ) { return &v[0]; }
26 const double* begin( const CLHEP::HepVector& v ) { return &v[0]; }
27 }
28
29 // ============================================================================/
30 // GaudiAlg
31 // ============================================================================
32 #include "GaudiAlg/Tuple.h"
33 #include "GaudiAlg/TupleObj.h"
34 // ============================================================================
35 // GaudiPython
36 // ============================================================================
37 #include "GaudiPython/TupleDecorator.h"
38 #include "GaudiPython/Vector.h"
39 // ===========================================================================
45 // ============================================================================
46 namespace
47 {
48 // ==========================================================================
49 template <class TYPE>
50 inline StatusCode _fill( const Tuples::Tuple& tuple, const std::string& name, const TYPE& value )
51 {
52 return tuple.valid() ? tuple->column( name, value ) : StatusCode::FAILURE;
53 }
54 // ==========================================================================
55 }
56 // ============================================================================
57 INTuple* GaudiPython::TupleDecorator::nTuple( const Tuples::Tuple& tuple )
58 {
59 if ( !tuple.valid() ) {
60 return 0;
61 }
62 return tuple->tuple();
63 }
64 // ============================================================================
65 NTuple::Tuple* GaudiPython::TupleDecorator::ntuple( const Tuples::Tuple& tuple )
66 {
67 if ( !tuple.valid() ) {
68 return 0;
69 }
70 return tuple->tuple();
71 }
72 // ============================================================================
73 bool GaudiPython::TupleDecorator::valid( const Tuples::Tuple& tuple ) { return tuple.valid(); }
74 // ============================================================================
75 StatusCode GaudiPython::TupleDecorator::write( const Tuples::Tuple& tuple )
76 {
77 if ( !tuple.valid() ) {
78 return StatusCode::FAILURE;
79 }
80 return tuple->write();
81 }
82 // ============================================================================
83 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name, const int value )
84 {
85 return _fill( tuple, name, value );
86 }
87 // ============================================================================
88 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name, const int value,
89 const int minv, const int maxv )
90 {
91 if ( !tuple.valid() ) {
92 return StatusCode::FAILURE;
93 }
94 return tuple->column( name, value, minv, maxv );
95 }
96 // ============================================================================
97 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
98 const double value )
99 {
100 return _fill( tuple, name, value );
101 }
102 // ============================================================================
103 StatusCode GaudiPython::TupleDecorator::column_ll( const Tuples::Tuple& tuple, const std::string& name,
104 const long long value )
105 {
106 return _fill( tuple, name, value );
107 }
108 // ============================================================================
109 StatusCode GaudiPython::TupleDecorator::column_ull( const Tuples::Tuple& tuple, const std::string& name,
110 const unsigned long long value )
111 {
112 return _fill( tuple, name, value );
113 }
114 // ============================================================================
115 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name, const bool value )
116 {
117 return _fill( tuple, name, value );
118 }
119 // ============================================================================
120 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
121 IOpaqueAddress* value )
122 {
123 if ( !tuple.valid() ) {
124 return StatusCode::FAILURE;
125 }
126 return tuple->column( name, value );
127 }
128 // ============================================================================
129 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, IOpaqueAddress* value )
130 {
131 return column( tuple, "Address", value );
132 }
133 // ============================================================================
134 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
135 const Gaudi::LorentzVector& value )
136 {
137 return _fill( tuple, name, value );
138 }
139 // ============================================================================
140 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
141 const Gaudi::XYZVector& value )
142 {
143 return _fill( tuple, name, value );
144 }
145 // ============================================================================
146 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
147 const Gaudi::XYZPoint& value )
148 {
149 return _fill( tuple, name, value );
150 }
151 // ============================================================================
152 StatusCode GaudiPython::TupleDecorator::farray( const Tuples::Tuple& tuple, const std::string& name,
153 const std::vector<double>& data, const std::string& length,
154 const size_t maxv )
155 {
156 if ( !tuple.valid() ) {
157 return StatusCode::FAILURE;
158 }
159 return tuple->farray( name, data.begin(), data.end(), length, maxv );
160 }
161 // ============================================================================
162 StatusCode GaudiPython::TupleDecorator::fmatrix( const Tuples::Tuple& tuple, const std::string& name,
163 const GaudiPython::Matrix& data,
164 const Tuples::TupleObj::MIndex cols, // fixed !!!
165 const std::string& length, const size_t maxv )
166 {
167 if ( !tuple.valid() ) {
168 return StatusCode::FAILURE;
169 }
170 if ( !data.empty() && cols != data.front().size() ) {
171 return tuple->Error( "GP:fmatrix(1): mismatch in matrix dimensions!" );
172 }
173 return tuple->fmatrix( name, data, data.size(), cols, length, maxv );
174 }
175 // ============================================================================
176 StatusCode GaudiPython::TupleDecorator::fmatrix( const Tuples::Tuple& tuple, const std::string& name,
177 const GaudiUtils::VectorMap<int, double>& info,
178 const std::string& length, const size_t maxv )
179 {
180 if ( !tuple.valid() ) {
181 return StatusCode::FAILURE;
182 }
183 return tuple->fmatrix( name, info, length, maxv );
184 }
185 // ============================================================================
186 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
187 const std::vector<double>& data )
188 {
189 if ( !tuple.valid() ) {
190 return StatusCode::FAILURE;
191 }
192 return tuple->array( name, data.begin(), data.end() );
193 }
194 // ============================================================================
195 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
196 const Gaudi::Vector1& data )
197 {
198 if ( !tuple.valid() ) {
199 return StatusCode::FAILURE;
200 }
201 return tuple->array( name, data );
202 }
203 // ============================================================================
204 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
205 const Gaudi::Vector2& data )
206 {
207 if ( !tuple.valid() ) {
208 return StatusCode::FAILURE;
209 }
210 return tuple->array( name, data );
211 }
212 // ============================================================================
213 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
214 const Gaudi::Vector3& data )
215 {
216 if ( !tuple.valid() ) {
217 return StatusCode::FAILURE;
218 }
219 return tuple->array( name, data.begin(), data.begin() + 3 );
220 }
221 // ============================================================================
222 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
223 const Gaudi::Vector4& data )
224 {
225 if ( !tuple.valid() ) {
226 return StatusCode::FAILURE;
227 }
228 // return tuple->array( name , data ) ;
229 return tuple->array( name, data.begin(), data.begin() + 4 );
230 }
231 // ============================================================================
232 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
233 const Gaudi::Vector5& data )
234 {
235 if ( !tuple.valid() ) {
236 return StatusCode::FAILURE;
237 }
238 return tuple->array( name, data );
239 }
240 // ============================================================================
241 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
242 const Gaudi::Vector6& data )
243 {
244 if ( !tuple.valid() ) {
245 return StatusCode::FAILURE;
246 }
247 return tuple->array( name, data );
248 }
249 // ============================================================================
250 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
251 const Gaudi::Vector7& data )
252 {
253 if ( !tuple.valid() ) {
254 return StatusCode::FAILURE;
255 }
256 return tuple->array( name, data );
257 }
258 // ============================================================================
259 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
260 const Gaudi::Vector8& data )
261 {
262 if ( !tuple.valid() ) {
263 return StatusCode::FAILURE;
264 }
265 return tuple->array( name, data );
266 }
267 // ============================================================================
268 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
269 const Gaudi::Vector9& data )
270 {
271 if ( !tuple.valid() ) {
272 return StatusCode::FAILURE;
273 }
274 return tuple->array( name, data );
275 }
276 // ============================================================================
277 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
278 const GaudiPython::Matrix& data,
279 const Tuples::TupleObj::MIndex cols ) // fixed !!!
280 {
281 if ( !tuple.valid() ) {
282 return StatusCode::FAILURE;
283 }
284 if ( data.empty() ) {
285 return tuple->Warning( "GP:matrix(1): empty fixed matrix, skip matrix " );
286 }
287 if ( cols != data.front().size() ) {
288 return tuple->Error( "GP:matrix(1): mismatch in fixed matrix dimensions!" );
289 }
290 return tuple->matrix( name, data, data.size(), cols );
291 }
292 // ============================================================================
293 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
294 const Gaudi::Matrix1x1& data )
295 {
296 if ( !tuple.valid() ) {
297 return StatusCode::FAILURE;
298 }
299 return tuple->matrix( name, data );
300 }
301 // ============================================================================
302 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
303 const Gaudi::Matrix2x2& data )
304 {
305 if ( !tuple.valid() ) {
306 return StatusCode::FAILURE;
307 }
308 return tuple->matrix( name, data );
309 }
310 // ============================================================================
311 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
312 const Gaudi::Matrix3x3& data )
313 {
314 if ( !tuple.valid() ) {
315 return StatusCode::FAILURE;
316 }
317 return tuple->matrix( name, data );
318 }
319 // ============================================================================
320 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
321 const Gaudi::Matrix4x4& data )
322 {
323 if ( !tuple.valid() ) {
324 return StatusCode::FAILURE;
325 }
326 return tuple->matrix( name, data );
327 }
328 // ============================================================================
329 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
330 const Gaudi::Matrix5x5& data )
331 {
332 if ( !tuple.valid() ) {
333 return StatusCode::FAILURE;
334 }
335 return tuple->matrix( name, data );
336 }
337 // ============================================================================
338 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
339 const Gaudi::Matrix6x6& data )
340 {
341 if ( !tuple.valid() ) {
342 return StatusCode::FAILURE;
343 }
344 return tuple->matrix( name, data );
345 }
346 // ============================================================================
347 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
348 const Gaudi::Matrix7x7& data )
349 {
350 if ( !tuple.valid() ) {
351 return StatusCode::FAILURE;
352 }
353 return tuple->matrix( name, data );
354 }
355 // ============================================================================
356 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
357 const Gaudi::Matrix8x8& data )
358 {
359 if ( !tuple.valid() ) {
360 return StatusCode::FAILURE;
361 }
362 return tuple->matrix( name, data );
363 }
364 // ============================================================================
365 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
366 const Gaudi::Matrix9x9& data )
367 {
368 if ( !tuple.valid() ) {
369 return StatusCode::FAILURE;
370 }
371 return tuple->matrix( name, data );
372 }
373 // ============================================================================
374 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
375 const Gaudi::Matrix1x3& data )
376 {
377 if ( !tuple.valid() ) {
378 return StatusCode::FAILURE;
379 }
380 return tuple->matrix( name, data );
381 }
382 // ============================================================================
383 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
384 const Gaudi::Matrix1x5& data )
385 {
386 if ( !tuple.valid() ) {
387 return StatusCode::FAILURE;
388 }
389 return tuple->matrix( name, data );
390 }
391 // ============================================================================
392 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
393 const Gaudi::Matrix1x6& data )
394 {
395 if ( !tuple.valid() ) {
396 return StatusCode::FAILURE;
397 }
398 return tuple->matrix( name, data );
399 }
400 // ============================================================================
401 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
402 const Gaudi::Matrix4x3& data )
403 {
404 if ( !tuple.valid() ) {
405 return StatusCode::FAILURE;
406 }
407 return tuple->matrix( name, data );
408 }
409 // ============================================================================
410 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
411 const Gaudi::Matrix3x4& data )
412 {
413 if ( !tuple.valid() ) {
414 return StatusCode::FAILURE;
415 }
416 return tuple->matrix( name, data );
417 }
418 // ============================================================================
419 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
420 const Gaudi::Matrix3x5& data )
421 {
422 if ( !tuple.valid() ) {
423 return StatusCode::FAILURE;
424 }
425 return tuple->matrix( name, data );
426 }
427 // ============================================================================
428 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
429 const Gaudi::Matrix3x6& data )
430 {
431 if ( !tuple.valid() ) {
432 return StatusCode::FAILURE;
433 }
434 return tuple->matrix( name, data );
435 }
436 // ============================================================================
437 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
438 const Gaudi::Matrix2x3& data )
439 {
440 if ( !tuple.valid() ) {
441 return StatusCode::FAILURE;
442 }
443 return tuple->matrix( name, data );
444 }
445 // ============================================================================
446 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
447 const Gaudi::Matrix3x2& data )
448 {
449 if ( !tuple.valid() ) {
450 return StatusCode::FAILURE;
451 }
452 return tuple->matrix( name, data );
453 }
454 // ============================================================================
455 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
456 const Gaudi::SymMatrix1x1& data )
457 {
458 if ( !tuple.valid() ) {
459 return StatusCode::FAILURE;
460 }
461 return tuple->matrix( name, data );
462 }
463 // ============================================================================
464 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
465 const Gaudi::SymMatrix2x2& data )
466 {
467 if ( !tuple.valid() ) {
468 return StatusCode::FAILURE;
469 }
470 return tuple->matrix( name, data );
471 }
472 // ============================================================================
473 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
474 const Gaudi::SymMatrix3x3& data )
475 {
476 if ( !tuple.valid() ) {
477 return StatusCode::FAILURE;
478 }
479 return tuple->matrix( name, data );
480 }
481 // ============================================================================
482 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
483 const Gaudi::SymMatrix4x4& data )
484 {
485 if ( !tuple.valid() ) {
486 return StatusCode::FAILURE;
487 }
488 return tuple->matrix( name, data );
489 }
490 // ============================================================================
491 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
492 const Gaudi::SymMatrix5x5& data )
493 {
494 if ( !tuple.valid() ) {
495 return StatusCode::FAILURE;
496 }
497 return tuple->matrix( name, data );
498 }
499 // ============================================================================
500 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
501 const Gaudi::SymMatrix6x6& data )
502 {
503 if ( !tuple.valid() ) {
504 return StatusCode::FAILURE;
505 }
506 return tuple->matrix( name, data );
507 }
508 // ============================================================================
509 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
510 const Gaudi::SymMatrix7x7& data )
511 {
512 if ( !tuple.valid() ) {
513 return StatusCode::FAILURE;
514 }
515 return tuple->matrix( name, data );
516 }
517 // ============================================================================
518 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
519 const Gaudi::SymMatrix8x8& data )
520 {
521 if ( !tuple.valid() ) {
522 return StatusCode::FAILURE;
523 }
524 return tuple->matrix( name, data );
525 }
526 // ============================================================================
527 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
528 const Gaudi::SymMatrix9x9& data )
529 {
530 if ( !tuple.valid() ) {
531 return StatusCode::FAILURE;
532 }
533 return tuple->matrix( name, data );
534 }
535 // ============================================================================
536 // advanced column: time
537 // ============================================================================
538 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const Gaudi::Time& value )
539 {
540 return column( tuple, "", value );
541 }
542 // ============================================================================
543 // advanced column: time
544 // ============================================================================
545 StatusCode GaudiPython::TupleDecorator::column( const Tuples::Tuple& tuple, const std::string& name,
546 const Gaudi::Time& value )
547 {
548 if ( !tuple.valid() ) {
549 return StatusCode::FAILURE;
550 }
551 StatusCode sc = StatusCode::SUCCESS;
552 //
553 sc = tuple->column( name + "year", value.year( true ), 1970, 2070 );
554 if ( sc.isFailure() ) {
555 return sc;
556 }
557 sc = tuple->column( name + "month", value.month( true ) + 1, 1, 16 );
558 if ( sc.isFailure() ) {
559 return sc;
560 }
561 sc = tuple->column( name + "day", value.day( true ), 0, 32 );
562 if ( sc.isFailure() ) {
563 return sc;
564 }
565 sc = tuple->column( name + "hour", value.hour( true ), 0, 25 );
566 if ( sc.isFailure() ) {
567 return sc;
568 }
569 sc = tuple->column( name + "minute", value.minute( true ), 0, 61 );
570 if ( sc.isFailure() ) {
571 return sc;
572 }
573 sc = tuple->column( name + "second", value.second( true ), 0, 61 );
574 if ( sc.isFailure() ) {
575 return sc;
576 }
577 sc = tuple->column( name + "nsecond", value.nsecond() );
578 //
579 return sc;
580 }
581 // ============================================================================
582
583 // ============================================================================
584 // Legacy:
585 // ============================================================================
586 StatusCode GaudiPython::TupleDecorator::array( const Tuples::Tuple& tuple, const std::string& name,
587 const CLHEP::HepVector& data )
588 {
589 if ( !tuple.valid() ) {
590 return StatusCode::FAILURE;
591 }
592 return tuple->array( name, data, data.num_row() );
593 }
594 // ============================================================================
595 StatusCode GaudiPython::TupleDecorator::farray( const Tuples::Tuple& tuple, const std::string& name,
596 const CLHEP::HepVector& data, const std::string& length,
597 const size_t maxv )
598 {
599 if ( !tuple.valid() ) {
600 return StatusCode::FAILURE;
601 }
602 // use the trick!
603 const double* begin = &( data[0] );
604 const double* end = begin + data.num_row();
605 return tuple->farray( name, begin, end, length, maxv );
606 }
607 // ============================================================================
608 StatusCode GaudiPython::TupleDecorator::matrix( const Tuples::Tuple& tuple, const std::string& name,
609 const CLHEP::HepGenMatrix& data )
610 {
611 if ( !tuple.valid() ) {
612 return StatusCode::FAILURE;
613 }
614 if ( 1 > data.num_col() ) {
615 return tuple->Error( "GP:matrix(2): illegal fixed matrix num_col" );
616 }
617 if ( 1 > data.num_row() ) {
618 return tuple->Error( "GP:matrix(2): illegal fixed matrix num_row" );
619 }
620 return tuple->matrix( name, data, data.num_row(), data.num_col() );
621 }
622 // ============================================================================
623 StatusCode GaudiPython::TupleDecorator::fmatrix( const Tuples::Tuple& tuple, const std::string& name,
624 const CLHEP::HepGenMatrix& data,
625 const Tuples::TupleObj::MIndex cols, // fixed !!!
626 const std::string& length, const size_t maxv )
627 {
628 if ( !tuple.valid() ) {
629 return StatusCode::FAILURE;
630 }
631 if ( cols != data.num_col() ) {
632 return tuple->Error( "GP:fmatrix(2): mismatch in matrix dimensions!" );
633 }
634 return tuple->fmatrix( name, data, data.num_row(), cols, length, maxv );
635 }
636 // ============================================================================
637
638 // ============================================================================
639 // Tuple-Alg-decorator
640 // ============================================================================
641 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const std::string& title,
642 const CLID& clid )
643 {
644 return algo.nTuple( title, clid );
645 }
646 // ============================================================================
647 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID,
648 const std::string& title, const CLID& clid )
649 {
650 return algo.nTuple( ID, title, clid );
651 }
652 // ============================================================================
653 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const int ID, const std::string& title,
654 const CLID& clid )
655 {
656 return algo.nTuple( ID, title, clid );
657 }
658 // ============================================================================
659 Tuples::Tuple GaudiPython::TupleAlgDecorator::nTuple( const GaudiTupleAlg& algo, const std::string& ID,
660 const std::string& title, const CLID& clid )
661 {
662 return algo.nTuple( ID, title, clid );
663 }
664 // ============================================================================
665 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const std::string& title,
666 const CLID& clid )
667 {
668 return algo.evtCol( title, clid );
669 }
670 // ============================================================================
671 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID,
672 const std::string& title, const CLID& clid )
673 {
674 return algo.evtCol( ID, title, clid );
675 }
676 // ============================================================================
677 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const int ID, const std::string& title,
678 const CLID& clid )
679 {
680 return algo.evtCol( ID, title, clid );
681 }
682 // ============================================================================
683 Tuples::Tuple GaudiPython::TupleAlgDecorator::evtCol( const GaudiTupleAlg& algo, const std::string& ID,
684 const std::string& title, const CLID& clid )
685 {
686 return algo.evtCol( ID, title, clid );
687 }
688 // ============================================================================
689 // The END
690 // ============================================================================
Gaudi::Matrix8x8
ROOT::Math::SMatrix< double, 8, 8 > Matrix8x8
Generic 8x8 matrix (double)
Definition: GenericMatrixTypes.h:37
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:162
Gaudi::Time::hour
int hour(bool local) const
Get the hour, numbered [0, 23].
Definition: Time.cpp:181
Gaudi::Matrix4x4
ROOT::Math::SMatrix< double, 4, 4 > Matrix4x4
Generic 4x4 matrix (double)
Definition: GenericMatrixTypes.h:33
GaudiUtils::VectorMap
A bit modified version of &#39;Loki::AssocVector&#39; associative vector from Loki library by Andrei Alexandr...
Definition: VectorMap.h:103
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::vector::empty
T empty(T...args)
Tuples::TupleObj::tuple
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:1949
Gaudi::SymMatrix1x1
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > SymMatrix1x1
Symmetrix 1x1 matrix (double)
Definition: SymmetricMatrixTypes.h:28
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:1764
Gaudi::Matrix3x5
ROOT::Math::SMatrix< double, 3, 5 > Matrix3x5
Generic 3x5 matrix (double)
Definition: GenericMatrixTypes.h:45
Vector.h
GaudiPython::TupleDecorator::nTuple
static INTuple * nTuple(const Tuples::Tuple &tuple)
accessors to internal
Definition: TupleDecorator.cpp:57
Gaudi::SymMatrix5x5
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > SymMatrix5x5
Symmetrix 5x5 matrix (double)
Definition: SymmetricMatrixTypes.h:36
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::Time::day
int day(bool local) const
Get the day of month, numbered [1,31].
Definition: Time.cpp:178
Gaudi::Vector7
ROOT::Math::SVector< double, 7 > Vector7
7D Vector (double)
Definition: GenericVectorTypes.h:36
GaudiTupleAlg
Simple class to extend the functionality of class GaudiHistoAlg.
Definition: GaudiTupleAlg.h:41
TupleObj.h
Header file for class TupleObj.
Gaudi::Time::month
int month(bool local) const
Get the month, numbered [0,11].
Definition: Time.cpp:175
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:32
GaudiPython::TupleDecorator::valid
static bool valid(const Tuples::Tuple &tuple)
status of the tuple
Definition: TupleDecorator.cpp:73
Gaudi::SymMatrix9x9
ROOT::Math::SMatrix< double, 9, 9, ROOT::Math::MatRepSym< double, 9 > > SymMatrix9x9
Symmetrix 9x9 matrix (double)
Definition: SymmetricMatrixTypes.h:44
Tuples::TupleObj::column
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:315
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:103
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:152
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:277
Gaudi::Matrix9x9
ROOT::Math::SMatrix< double, 9, 9 > Matrix9x9
Generic 9x9 matrix (double)
Definition: GenericMatrixTypes.h:38
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:184
Gaudi::Vector3
ROOT::Math::SVector< double, 3 > Vector3
3D Vector (double)
Definition: GenericVectorTypes.h:32
std::vector::end
T end(T...args)
Gaudi::Matrix3x3
ROOT::Math::SMatrix< double, 3, 3 > Matrix3x3
Generic 3x3 matrix (double)
Definition: GenericMatrixTypes.h:32
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:1328
Tuples::TupleObj::MIndex
unsigned short MIndex
Definition: TupleObj.h:246
TupleDecorator.h
Gaudi::Matrix3x2
ROOT::Math::SMatrix< double, 3, 2 > Matrix3x2
Generic 3x2 matrix (double)
Definition: GenericMatrixTypes.h:48
ROOT::Math::PositionVector3D
Definition: IMagneticFieldSvc.h:17
Gaudi::Vector9
ROOT::Math::SVector< double, 9 > Vector9
9D Vector (double)
Definition: GenericVectorTypes.h:38
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:189
Gaudi::SymMatrix7x7
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > SymMatrix7x7
Symmetrix 7x7 matrix (double)
Definition: SymmetricMatrixTypes.h:40
Gaudi::Vector2
ROOT::Math::SVector< double, 2 > Vector2
2D Vector (double)
Definition: GenericVectorTypes.h:31
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
Gaudi::SymMatrix4x4
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SymMatrix4x4
Symmetrix 4x4 matrix (double)
Definition: SymmetricMatrixTypes.h:34
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:892
Gaudi::SymMatrix6x6
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > SymMatrix6x6
Symmetrix 6x6 matrix (double)
Definition: SymmetricMatrixTypes.h:38
Gaudi::Vector8
ROOT::Math::SVector< double, 8 > Vector8
8D Vector (double)
Definition: GenericVectorTypes.h:37
std::string
STL class.
Gaudi::Matrix1x1
ROOT::Math::SMatrix< double, 1, 1 > Matrix1x1
Generic 1x1 matrix (double)
Definition: GenericMatrixTypes.h:30
INTuple
NTuple interface class definition.
Definition: INTuple.h:82
Tuples::TupleObj::Warning
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
Tuples::Tuple
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: Tuple.h:117
Gaudi::Matrix3x6
ROOT::Math::SMatrix< double, 3, 6 > Matrix3x6
Generic 3x6 matrix (double)
Definition: GenericMatrixTypes.h:46
Gaudi::Matrix4x3
ROOT::Math::SMatrix< double, 4, 3 > Matrix4x3
Generic 4x3 matrix (double)
Definition: GenericMatrixTypes.h:43
Gaudi::Matrix2x3
ROOT::Math::SMatrix< double, 2, 3 > Matrix2x3
Generic 2x3 matrix (double)
Definition: GenericMatrixTypes.h:47
Gaudi::Matrix1x6
ROOT::Math::SMatrix< double, 1, 6 > Matrix1x6
Generic 1x6 matrix (double)
Definition: GenericMatrixTypes.h:42
Gaudi::Matrix6x6
ROOT::Math::SMatrix< double, 6, 6 > Matrix6x6
Generic 6x6 matrix (double)
Definition: GenericMatrixTypes.h:35
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:83
Gaudi::Time
Based on seal::Time.
Definition: Time.h:237
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:641
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
GaudiPython::TupleDecorator::ntuple
static NTuple::Tuple * ntuple(const Tuples::Tuple &tuple)
accessors to internal
Definition: TupleDecorator.cpp:65
Gaudi::Matrix5x5
ROOT::Math::SMatrix< double, 5, 5 > Matrix5x5
Generic 5x5 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:146
Tuples::Tuple::valid
bool valid() const
check the validity of the tuple object
Definition: Tuple.h:150
Gaudi::SymMatrix8x8
ROOT::Math::SMatrix< double, 8, 8, ROOT::Math::MatRepSym< double, 8 > > SymMatrix8x8
Symmetrix 8x8 matrix (double)
Definition: SymmetricMatrixTypes.h:42
Gaudi::Matrix7x7
ROOT::Math::SMatrix< double, 7, 7 > Matrix7x7
Generic 7x7 matrix (double)
Definition: GenericMatrixTypes.h:36
Tuples::TupleObj::write
StatusCode write()
write a record to NTuple
Definition: TupleObj.cpp:237
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
ROOT::Math::DisplacementVector3D
Definition: IMagneticFieldSvc.h:20
Gaudi::Vector6
ROOT::Math::SVector< double, 6 > Vector6
6D Vector (double)
Definition: GenericVectorTypes.h:35
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:412
std::vector::size
T size(T...args)
Gaudi::Matrix1x5
ROOT::Math::SMatrix< double, 1, 5 > Matrix1x5
Generic 1x5 matrix (double)
Definition: GenericMatrixTypes.h:41
Gaudi::Matrix2x2
ROOT::Math::SMatrix< double, 2, 2 > Matrix2x2
Generic 2x2 matrix (double)
Definition: GenericMatrixTypes.h:31
Tuples::TupleObj::array
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1601
std::vector< double >
Gaudi::SymMatrix2x2
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SymMatrix2x2
Symmetrix 2x2 matrix (double)
Definition: SymmetricMatrixTypes.h:30
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:109
GaudiPython::TupleDecorator::write
static StatusCode write(const Tuples::Tuple &tuple)
commit the row
Definition: TupleDecorator.cpp:75
Gaudi::Vector4
ROOT::Math::SVector< double, 4 > Vector4
4D Vector (double)
Definition: GenericVectorTypes.h:33
std::vector::begin
T begin(T...args)
Tuples::TupleObj::Error
virtual StatusCode Error(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
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:665
CLHEP
Definition: IFuncMinimum.h:16
Gaudi::Matrix1x3
ROOT::Math::SMatrix< double, 1, 3 > Matrix1x3
Generic 1x3 matrix (double)
Definition: GenericMatrixTypes.h:40
Gaudi::Time::nsecond
int nsecond() const
Get the nanoseconds.
Definition: Time.cpp:194
Gaudi::LorentzVector
ROOT::Math::PxPyPzEVector LorentzVector
Cartesian 4 Vector.
Definition: Vector4DTypes.h:31
Gaudi::Matrix3x4
ROOT::Math::SMatrix< double, 3, 4 > Matrix3x4
Generic 3x4 matrix (double)
Definition: GenericMatrixTypes.h:44
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
Gaudi::Time::year
int year(bool local) const
Get the year.
Definition: Time.cpp:172
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:186
CLHEP::begin
double * begin(CLHEP::HepVector &v)
Definition: TupleDecorator.cpp:25
Gaudi::Vector5
ROOT::Math::SVector< double, 5 > Vector5
5D Vector (double)
Definition: GenericVectorTypes.h:34
GaudiAlg::ID
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:44
Tuple.h
Header file for class : Tuple.
Gaudi::Vector1
ROOT::Math::SVector< double, 1 > Vector1
1D Vector (double)
Definition: GenericVectorTypes.h:30
Gaudi::Time::minute
int minute(bool local) const
Get the minute, numbered [0, 59].
Definition: Time.cpp:184
GaudiPython.GaudiAlgs.column
column
Definition: GaudiAlgs.py:1164