| The Gaudi Framework v28r2-patches (bc4ad17a)

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