All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TupleDecorator.h
Go to the documentation of this file.
1 #ifndef GAUDIPYTHON_TUPLEDECORATOR_H
2 #define GAUDIPYTHON_TUPLEDECORATOR_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
13 #include "GaudiKernel/Time.h"
14 // ============================================================================
15 // GaudiAlg
16 // ============================================================================
17 #include "GaudiAlg/TupleID.h"
18 #include "GaudiAlg/TupleObj.h"
19 #include "GaudiAlg/Tuple.h"
20 #include "GaudiAlg/Tuples.h"
21 #include "GaudiAlg/ITupleTool.h"
22 #include "GaudiAlg/GaudiTupleAlg.h"
23 // ============================================================================
24 // GaudiPython
25 // ============================================================================
27 #include "GaudiPython/Vector.h"
28 // ============================================================================
29 // Forward declarations
30 // ============================================================================
31 namespace CLHEP
32 {
33  class HepGenMatrix ;
34  class HepVector ;
35 }
36 // ============================================================================
37 namespace GaudiPython
38 {
39  // ==========================================================================
47  {
48  public:
49  // ========================================================================
51  static INTuple* nTuple ( const Tuples::Tuple& tuple ) ;
52  // ========================================================================
54  static NTuple::Tuple* ntuple ( const Tuples::Tuple& tuple ) ;
55  // ========================================================================
57  static bool valid ( const Tuples::Tuple& tuple ) ;
58  // ========================================================================
60  static StatusCode write ( const Tuples::Tuple& tuple ) ;
61  // ========================================================================
62  public: // primitives
63  // ========================================================================
65  static StatusCode column
66  ( const Tuples::Tuple& tuple ,
67  const std::string& name ,
68  const int value ) ;
69  // ========================================================================
71  static StatusCode column
72  ( const Tuples::Tuple& tuple ,
73  const std::string& name ,
74  const int value ,
75  const int minv ,
76  const int maxv ) ;
77  // ========================================================================
79  static StatusCode column
80  ( const Tuples::Tuple& tuple ,
81  const std::string& name ,
82  const double value ) ;
83  // ========================================================================
85  static StatusCode column
86  ( const Tuples::Tuple& tuple ,
87  const std::string& name ,
88  const bool value ) ;
89  // ========================================================================
91  static StatusCode column_ll
92  ( const Tuples::Tuple& tuple ,
93  const std::string& name ,
94  const long long value ) ;
95  // ========================================================================
97  static StatusCode column_ull
98  ( const Tuples::Tuple& tuple ,
99  const std::string& name ,
100  const unsigned long long value ) ;
101  // ========================================================================
102  public: // event tag collections
103  // ========================================================================
105  static StatusCode column
106  ( const Tuples::Tuple& tuple ,
107  const std::string& name ,
108  IOpaqueAddress* value ) ;
109  // ========================================================================
111  static StatusCode column
112  ( const Tuples::Tuple& tuple ,
113  IOpaqueAddress* value ) ;
114  // ========================================================================
115  public: // 4D kinematics
116  // ========================================================================
118  static StatusCode column
119  ( const Tuples::Tuple& tuple ,
120  const std::string& name ,
121  const Gaudi::LorentzVector& value ) ;
122  // ========================================================================
123  public: // 3D geometry
124  // ========================================================================
126  static StatusCode column
127  ( const Tuples::Tuple& tuple ,
128  const std::string& name ,
129  const Gaudi::XYZVector& value ) ;
130  // ========================================================================
132  static StatusCode column
133  ( const Tuples::Tuple& tuple ,
134  const std::string& name ,
135  const Gaudi::XYZPoint& value ) ;
136  // ========================================================================
137  public: // floating size arrays
138  // ========================================================================
140  static StatusCode farray
141  ( const Tuples::Tuple& tuple ,
142  const std::string& name ,
143  const std::vector<double>& data ,
144  const std::string& length ,
145  const size_t maxv ) ;
146  // ========================================================================
147  public: // floating-size matrices
148  // ========================================================================
150  static StatusCode fmatrix
151  ( const Tuples::Tuple& tuple ,
152  const std::string& name ,
153  const GaudiPython::Matrix& data ,
154  const Tuples::TupleObj::MIndex cols , // fixed !!!
155  const std::string& length ,
156  const size_t maxv ) ;
157  // ========================================================================
159  static StatusCode fmatrix
160  ( const Tuples::Tuple& tuple ,
161  const std::string& name ,
163  const std::string& length ,
164  const size_t maxv ) ;
165  // ========================================================================
166  public: // fixed size arrays
167  // ========================================================================
169  static StatusCode array
170  ( const Tuples::Tuple& tuple ,
171  const std::string& name ,
172  const std::vector<double>& data ) ;
173  // ========================================================================
175  static StatusCode array
176  ( const Tuples::Tuple& tuple ,
177  const std::string& name ,
178  const Gaudi::Vector1& data ) ;
179  // ========================================================================
181  static StatusCode array
182  ( const Tuples::Tuple& tuple ,
183  const std::string& name ,
184  const Gaudi::Vector2& data ) ;
185  // ========================================================================
187  static StatusCode array
188  ( const Tuples::Tuple& tuple ,
189  const std::string& name ,
190  const Gaudi::Vector3& data ) ;
191  // ========================================================================
193  static StatusCode array
194  ( const Tuples::Tuple& tuple ,
195  const std::string& name ,
196  const Gaudi::Vector4& data ) ;
197  // ========================================================================
199  static StatusCode array
200  ( const Tuples::Tuple& tuple ,
201  const std::string& name ,
202  const Gaudi::Vector5& data ) ;
203  // ========================================================================
204  public: // fixed size matrices
205  // ========================================================================
207  static StatusCode array
208  ( const Tuples::Tuple& tuple ,
209  const std::string& name ,
210  const Gaudi::Vector6& data ) ;
211  // ========================================================================
213  static StatusCode array
214  ( const Tuples::Tuple& tuple ,
215  const std::string& name ,
216  const Gaudi::Vector7& data ) ;
217  // ========================================================================
219  static StatusCode array
220  ( const Tuples::Tuple& tuple ,
221  const std::string& name ,
222  const Gaudi::Vector8& data ) ;
223  // ========================================================================
225  static StatusCode array
226  ( const Tuples::Tuple& tuple ,
227  const std::string& name ,
228  const Gaudi::Vector9& data ) ;
229  // ========================================================================
231  static StatusCode matrix
232  ( const Tuples::Tuple& tuple ,
233  const std::string& name ,
234  const GaudiPython::Matrix& data ,
235  const Tuples::TupleObj::MIndex cols ) ; // fixed !!!
236  // ========================================================================
238  static StatusCode matrix
239  ( const Tuples::Tuple& tuple ,
240  const std::string& name ,
241  const Gaudi::Matrix2x2& value ) ;
242  // ========================================================================
244  static StatusCode matrix
245  ( const Tuples::Tuple& tuple ,
246  const std::string& name ,
247  const Gaudi::Matrix3x3& value ) ;
248  // ========================================================================
250  static StatusCode matrix
251  ( const Tuples::Tuple& tuple ,
252  const std::string& name ,
253  const Gaudi::Matrix4x4& value ) ;
254  // ========================================================================
256  static StatusCode matrix
257  ( const Tuples::Tuple& tuple ,
258  const std::string& name ,
259  const Gaudi::Matrix5x5& value ) ;
260  // ========================================================================
262  static StatusCode matrix
263  ( const Tuples::Tuple& tuple ,
264  const std::string& name ,
265  const Gaudi::Matrix6x6& value ) ;
266  // ========================================================================
268  static StatusCode matrix
269  ( const Tuples::Tuple& tuple ,
270  const std::string& name ,
271  const Gaudi::Matrix7x7& value ) ;
272  // ========================================================================
274  static StatusCode matrix
275  ( const Tuples::Tuple& tuple ,
276  const std::string& name ,
277  const Gaudi::Matrix8x8& value ) ;
278  // ========================================================================
280  static StatusCode matrix
281  ( const Tuples::Tuple& tuple ,
282  const std::string& name ,
283  const Gaudi::Matrix9x9& value ) ;
284  // ========================================================================
286  static StatusCode matrix
287  ( const Tuples::Tuple& tuple ,
288  const std::string& name ,
289  const Gaudi::Matrix1x1& value ) ;
290  // ========================================================================
292  static StatusCode matrix
293  ( const Tuples::Tuple& tuple ,
294  const std::string& name ,
295  const Gaudi::Matrix1x3& value ) ;
296  // ========================================================================
298  static StatusCode matrix
299  ( const Tuples::Tuple& tuple ,
300  const std::string& name ,
301  const Gaudi::Matrix1x5& value ) ;
302  // ========================================================================
304  static StatusCode matrix
305  ( const Tuples::Tuple& tuple ,
306  const std::string& name ,
307  const Gaudi::Matrix1x6& value ) ;
308  // ========================================================================
310  static StatusCode matrix
311  ( const Tuples::Tuple& tuple ,
312  const std::string& name ,
313  const Gaudi::Matrix4x3& value ) ;
314  // ========================================================================
316  static StatusCode matrix
317  ( const Tuples::Tuple& tuple ,
318  const std::string& name ,
319  const Gaudi::Matrix3x4& value ) ;
320  // ========================================================================
322  static StatusCode matrix
323  ( const Tuples::Tuple& tuple ,
324  const std::string& name ,
325  const Gaudi::Matrix3x5& value ) ;
326  // ========================================================================
328  static StatusCode matrix
329  ( const Tuples::Tuple& tuple ,
330  const std::string& name ,
331  const Gaudi::Matrix3x6& value ) ;
332  // ========================================================================
334  static StatusCode matrix
335  ( const Tuples::Tuple& tuple ,
336  const std::string& name ,
337  const Gaudi::Matrix2x3& value ) ;
338  // ========================================================================
340  static StatusCode matrix
341  ( const Tuples::Tuple& tuple ,
342  const std::string& name ,
343  const Gaudi::Matrix3x2& value ) ;
344  // ========================================================================
346  static StatusCode matrix
347  ( const Tuples::Tuple& tuple ,
348  const std::string& name ,
349  const Gaudi::SymMatrix1x1& value ) ;
350  // ========================================================================
352  static StatusCode matrix
353  ( const Tuples::Tuple& tuple ,
354  const std::string& name ,
355  const Gaudi::SymMatrix2x2& value ) ;
356  // ========================================================================
358  static StatusCode matrix
359  ( const Tuples::Tuple& tuple ,
360  const std::string& name ,
361  const Gaudi::SymMatrix3x3& value ) ;
362  // ========================================================================
364  static StatusCode matrix
365  ( const Tuples::Tuple& tuple ,
366  const std::string& name ,
367  const Gaudi::SymMatrix4x4& value ) ;
368  // ========================================================================
370  static StatusCode matrix
371  ( const Tuples::Tuple& tuple ,
372  const std::string& name ,
373  const Gaudi::SymMatrix5x5& value ) ;
374  // ========================================================================
376  static StatusCode matrix
377  ( const Tuples::Tuple& tuple ,
378  const std::string& name ,
379  const Gaudi::SymMatrix6x6& value ) ;
380  // ========================================================================
382  static StatusCode matrix
383  ( const Tuples::Tuple& tuple ,
384  const std::string& name ,
385  const Gaudi::SymMatrix7x7& value ) ;
386  // ========================================================================
388  static StatusCode matrix
389  ( const Tuples::Tuple& tuple ,
390  const std::string& name ,
391  const Gaudi::SymMatrix8x8& value ) ;
392  // ========================================================================
394  static StatusCode matrix
395  ( const Tuples::Tuple& tuple ,
396  const std::string& name ,
397  const Gaudi::SymMatrix9x9& value ) ;
398  // ========================================================================
399  public: // some auxillary objects
400  // ========================================================================
402  static StatusCode column
403  ( const Tuples::Tuple& tuple ,
404  const std::string& name ,
405  const Gaudi::Time& value ) ;
407  static StatusCode column
408  ( const Tuples::Tuple& tuple ,
409  const Gaudi::Time& value ) ;
410  // ========================================================================
411  public: // CLHEP: should we keep it ?
412  // ========================================================================
414  static StatusCode array
415  ( const Tuples::Tuple& tuple ,
416  const std::string& name ,
417  const CLHEP::HepVector& data ) ;
419  static StatusCode farray
420  ( const Tuples::Tuple& tuple ,
421  const std::string& name ,
422  const CLHEP::HepVector& data ,
423  const std::string& length ,
424  const size_t maxv ) ;
426  static StatusCode matrix
427  ( const Tuples::Tuple& tuple ,
428  const std::string& name ,
429  const CLHEP::HepGenMatrix& data ) ;
431  static StatusCode fmatrix
432  ( const Tuples::Tuple& tuple ,
433  const std::string& name ,
434  const CLHEP::HepGenMatrix& data ,
435  const Tuples::TupleObj::MIndex cols , // fixed !!!
436  const std::string& length ,
437  const size_t maxv ) ;
438  // ========================================================================
439  } ;
440  // ==========================================================================
447  {
448  public:
449  // ========================================================================
451  static Tuples::Tuple nTuple
452  ( const GaudiTupleAlg& algo ,
453  const std::string& title ,
454  const CLID& clid = CLID_ColumnWiseTuple ) ;
455  // ========================================================================
457  static Tuples::Tuple nTuple
458  ( const GaudiTupleAlg& algo ,
459  const GaudiAlg::TupleID& ID ,
460  const std::string& title ,
461  const CLID& clid = CLID_ColumnWiseTuple ) ;
462  // ========================================================================
464  static Tuples::Tuple nTuple
465  ( const GaudiTupleAlg& algo ,
466  const int ID ,
467  const std::string& title ,
468  const CLID& clid = CLID_ColumnWiseTuple ) ;
469  // ========================================================================
471  static Tuples::Tuple nTuple
472  ( const GaudiTupleAlg& algo ,
473  const std::string& ID ,
474  const std::string& title ,
475  const CLID& clid = CLID_ColumnWiseTuple ) ;
476  // ========================================================================
478  static Tuples::Tuple evtCol
479  ( const GaudiTupleAlg& algo ,
480  const std::string& title ,
481  const CLID& clid = CLID_ColumnWiseTuple ) ;
482  // ========================================================================
484  static Tuples::Tuple evtCol
485  ( const GaudiTupleAlg& algo ,
486  const GaudiAlg::TupleID& ID ,
487  const std::string& title ,
488  const CLID& clid = CLID_ColumnWiseTuple ) ;
489  // ========================================================================
491  static Tuples::Tuple evtCol
492  ( const GaudiTupleAlg& algo ,
493  const int ID ,
494  const std::string& title ,
495  const CLID& clid = CLID_ColumnWiseTuple ) ;
496  // ========================================================================
498  static Tuples::Tuple evtCol
499  ( const GaudiTupleAlg& algo ,
500  const std::string& ID ,
501  const std::string& title ,
502  const CLID& clid = CLID_ColumnWiseTuple ) ;
503  // ========================================================================
504  } ;
505  // ==========================================================================
512  {
513  public:
514  // ========================================================================
516  static Tuples::Tuple nTuple
517  ( const ITupleTool& tool ,
518  const std::string& title ,
519  const CLID& clid = CLID_ColumnWiseTuple )
520  { return tool.nTuple ( title , clid ) ; }
521  // ========================================================================
523  static Tuples::Tuple nTuple
524  ( const ITupleTool& tool ,
525  const GaudiAlg::TupleID& ID ,
526  const std::string& title ,
527  const CLID& clid = CLID_ColumnWiseTuple )
528  { return tool.nTuple ( ID , title , clid ) ; }
529  // ========================================================================
531  static Tuples::Tuple nTuple
532  ( const ITupleTool& tool ,
533  const int ID ,
534  const std::string& title ,
535  const CLID& clid = CLID_ColumnWiseTuple )
536  { return tool.nTuple ( ID , title , clid ) ; }
537  // ========================================================================
539  static Tuples::Tuple nTuple
540  ( const ITupleTool& tool ,
541  const std::string& ID ,
542  const std::string& title ,
543  const CLID& clid = CLID_ColumnWiseTuple )
544  { return tool.nTuple ( ID , title , clid ) ; }
545  // ========================================================================
547  static Tuples::Tuple evtCol
548  ( const ITupleTool& tool ,
549  const std::string& title ,
550  const CLID& clid = CLID_ColumnWiseTuple )
551  { return tool.evtCol ( title , clid ) ; }
552  // ========================================================================
554  static Tuples::Tuple evtCol
555  ( const ITupleTool& tool ,
556  const GaudiAlg::TupleID& ID ,
557  const std::string& title ,
558  const CLID& clid = CLID_ColumnWiseTuple )
559  { return tool.nTuple ( ID , title , clid ) ; }
560  // ========================================================================
562  static Tuples::Tuple evtCol
563  ( const ITupleTool& tool ,
564  const int ID ,
565  const std::string& title ,
566  const CLID& clid = CLID_ColumnWiseTuple )
567  { return tool.nTuple ( ID , title , clid ) ; }
568  // ========================================================================
570  static Tuples::Tuple evtCol
571  ( const ITupleTool& tool ,
572  const std::string& ID ,
573  const std::string& title ,
574  const CLID& clid = CLID_ColumnWiseTuple )
575  { return tool.nTuple ( ID , title , clid ) ; }
576  // ========================================================================
577  } ;
578  // ==========================================================================
579 } // end of namespace GaudiPython
580 // ============================================================================
581 // The END
582 // ============================================================================
583 #endif // GAUDIPYTHON_TUPLEDECORATOR_H
584 // ============================================================================
ROOT::Math::SMatrix< double, 8, 8 > Matrix8x8
Generic 8x8 matrix (double)
ROOT::Math::SMatrix< double, 4, 4 > Matrix4x4
Generic 4x4 matrix (double)
A bit modified version of &#39;Loki::AssocVector&#39; associative vector from Loki library by Andrei Alexandr...
Definition: VectorMap.h:108
Simple class which performs the decoration of the standard N-Tuple.
ROOT::Math::SMatrix< double, 8, 8, ROOT::Math::MatRepSym< double, 8 > > SymMatrix8x8
Symmetrix 8x8 matrix (double)
ROOT::Math::SMatrix< double, 3, 5 > Matrix3x5
Generic 3x5 matrix (double)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > SymMatrix5x5
Symmetrix 5x5 matrix (double)
Generic matrix typedefs.
Simple class to perform the "decoration" of Tuples in Python/ROOT.
ROOT::Math::SVector< double, 7 > Vector7
7D Vector (double)
Simple class to extend the functionality of class GaudiHistoAlg.
Definition: GaudiTupleAlg.h:41
Header file for class TupleObj.
4 vector typedefs
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > SymMatrix3x3
Symmetrix 3x3 matrix (double)
General vectors.
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SymMatrix2x2
Symmetrix 2x2 matrix (double)
virtual Tuple nTuple(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const =0
get N-tuple object ( book on-demand ) with unique identifier
ROOT::Math::SMatrix< double, 9, 9 > Matrix9x9
Generic 9x9 matrix (double)
ROOT::Math::SVector< double, 3 > Vector3
3D Vector (double)
Simple class to perform the "decoration" of Tuples in Python/ROOT.
ROOT::Math::SMatrix< double, 3, 3 > Matrix3x3
Generic 3x3 matrix (double)
unsigned short MIndex
Definition: TupleObj.h:243
ROOT::Math::SMatrix< double, 3, 2 > Matrix3x2
Generic 3x2 matrix (double)
ROOT::Math::SVector< double, 9 > Vector9
9D Vector (double)
ROOT::Math::SVector< double, 2 > Vector2
2D Vector (double)
ROOT::Math::SVector< double, 8 > Vector8
8D Vector (double)
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > SymMatrix7x7
Symmetrix 7x7 matrix (double)
STL class.
ROOT::Math::SMatrix< double, 1, 1 > Matrix1x1
Generic 1x1 matrix (double)
NTuple interface class definition.
Definition: INTuple.h:79
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: Tuple.h:116
Symmetric Matrix typedefs.
ROOT::Math::SMatrix< double, 3, 6 > Matrix3x6
Generic 3x6 matrix (double)
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > SymMatrix1x1
Symmetrix 1x1 matrix (double)
ROOT::Math::SMatrix< double, 4, 3 > Matrix4x3
Generic 4x3 matrix (double)
3D point typedefs
ROOT::Math::SMatrix< double, 2, 3 > Matrix2x3
Generic 2x3 matrix (double)
ROOT::Math::SMatrix< double, 1, 6 > Matrix1x6
Generic 1x6 matrix (double)
ROOT::Math::SMatrix< double, 6, 6 > Matrix6x6
Generic 6x6 matrix (double)
Based on seal::Time.
Definition: Time.h:213
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ROOT::Math::SMatrix< double, 5, 5 > Matrix5x5
Generic 5x5 matrix (double)
ROOT::Math::SMatrix< double, 7, 7 > Matrix7x7
Generic 7x7 matrix (double)
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > SymMatrix6x6
Symmetrix 6x6 matrix (double)
ROOT::Math::SVector< double, 6 > Vector6
6D Vector (double)
GaudiPython.h GaudiPython/GaudiPython.h.
Definition: AlgDecorators.h:37
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
virtual Tuple evtCol(const std::string &title, const CLID &clid=CLID_RowWiseTuple) const =0
ROOT::Math::SMatrix< double, 1, 5 > Matrix1x5
Generic 1x5 matrix (double)
ROOT::Math::SMatrix< double, 2, 2 > Matrix2x2
Generic 2x2 matrix (double)
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
3D vector typedefs
ROOT::Math::SVector< double, 4 > Vector4
4D Vector (double)
ROOT::Math::SMatrix< double, 1, 3 > Matrix1x3
Generic 1x3 matrix (double)
ROOT::Math::SMatrix< double, 9, 9, ROOT::Math::MatRepSym< double, 9 > > SymMatrix9x9
Symmetrix 9x9 matrix (double)
ROOT::Math::PxPyPzEVector LorentzVector
Cartesian 4 Vector.
Definition: Vector4DTypes.h:31
ROOT::Math::SMatrix< double, 3, 4 > Matrix3x4
Generic 3x4 matrix (double)
4D point typedefs
Opaque address interface definition.
#define GAUDI_API
Definition: Kernel.h:107
ROOT::Math::SVector< double, 5 > Vector5
5D Vector (double)
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:44
Header file for class : Tuple.
ROOT::Math::SVector< double, 1 > Vector1
1D Vector (double)
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SymMatrix4x4
Symmetrix 4x4 matrix (double)