All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TupleDecorator.h
Go to the documentation of this file.
1 // $Id: TupleDecorator.h,v 1.9 2007/08/07 14:05:33 marcocle Exp $
2 // ============================================================================
3 #ifndef GAUDIPYTHON_TUPLEDECORATOR_H
4 #define GAUDIPYTHON_TUPLEDECORATOR_H 1
5 // ============================================================================
6 // Include files
7 // ============================================================================
15 #include "GaudiKernel/Time.h"
16 // ============================================================================
17 // GaudiAlg
18 // ============================================================================
19 #include "GaudiAlg/TupleID.h"
20 #include "GaudiAlg/TupleObj.h"
21 #include "GaudiAlg/Tuple.h"
22 #include "GaudiAlg/Tuples.h"
23 #include "GaudiAlg/ITupleTool.h"
24 #include "GaudiAlg/GaudiTupleAlg.h"
25 // ============================================================================
26 // GaudiPython
27 // ============================================================================
29 #include "GaudiPython/Vector.h"
30 // ============================================================================
31 // Forward declarations
32 // ============================================================================
33 namespace CLHEP
34 {
35  class HepGenMatrix ;
36  class HepVector ;
37 }
38 // ============================================================================
39 namespace GaudiPython
40 {
41  // ==========================================================================
49  {
50  public:
51  // ========================================================================
53  static INTuple* nTuple ( const Tuples::Tuple& tuple ) ;
54  // ========================================================================
56  static NTuple::Tuple* ntuple ( const Tuples::Tuple& tuple ) ;
57  // ========================================================================
59  static bool valid ( const Tuples::Tuple& tuple ) ;
60  // ========================================================================
62  static StatusCode write ( const Tuples::Tuple& tuple ) ;
63  // ========================================================================
64  public: // primitives
65  // ========================================================================
67  static StatusCode column
68  ( const Tuples::Tuple& tuple ,
69  const std::string& name ,
70  const int value ) ;
71  // ========================================================================
73  static StatusCode column
74  ( const Tuples::Tuple& tuple ,
75  const std::string& name ,
76  const int value ,
77  const int minv ,
78  const int maxv ) ;
79  // ========================================================================
81  static StatusCode column
82  ( const Tuples::Tuple& tuple ,
83  const std::string& name ,
84  const double value ) ;
85  // ========================================================================
87  static StatusCode column
88  ( const Tuples::Tuple& tuple ,
89  const std::string& name ,
90  const bool value ) ;
91  // ========================================================================
93  static StatusCode column_ll
94  ( const Tuples::Tuple& tuple ,
95  const std::string& name ,
96  const long long value ) ;
97  // ========================================================================
99  static StatusCode column_ull
100  ( const Tuples::Tuple& tuple ,
101  const std::string& name ,
102  const unsigned long long value ) ;
103  // ========================================================================
104  public: // event tag collections
105  // ========================================================================
107  static StatusCode column
108  ( const Tuples::Tuple& tuple ,
109  const std::string& name ,
110  IOpaqueAddress* value ) ;
111  // ========================================================================
113  static StatusCode column
114  ( const Tuples::Tuple& tuple ,
115  IOpaqueAddress* value ) ;
116  // ========================================================================
117  public: // 4D kinematics
118  // ========================================================================
120  static StatusCode column
121  ( const Tuples::Tuple& tuple ,
122  const std::string& name ,
123  const Gaudi::LorentzVector& value ) ;
124  // ========================================================================
125  public: // 3D geometry
126  // ========================================================================
128  static StatusCode column
129  ( const Tuples::Tuple& tuple ,
130  const std::string& name ,
131  const Gaudi::XYZVector& value ) ;
132  // ========================================================================
134  static StatusCode column
135  ( const Tuples::Tuple& tuple ,
136  const std::string& name ,
137  const Gaudi::XYZPoint& value ) ;
138  // ========================================================================
139  public: // floating size arrays
140  // ========================================================================
142  static StatusCode farray
143  ( const Tuples::Tuple& tuple ,
144  const std::string& name ,
145  const std::vector<double>& data ,
146  const std::string& length ,
147  const size_t maxv ) ;
148  // ========================================================================
149  public: // floating-size matrices
150  // ========================================================================
152  static StatusCode fmatrix
153  ( const Tuples::Tuple& tuple ,
154  const std::string& name ,
155  const GaudiPython::Matrix& data ,
156  const Tuples::TupleObj::MIndex cols , // fixed !!!
157  const std::string& length ,
158  const size_t maxv ) ;
159  // ========================================================================
161  static StatusCode fmatrix
162  ( const Tuples::Tuple& tuple ,
163  const std::string& name ,
165  const std::string& length ,
166  const size_t maxv ) ;
167  // ========================================================================
168  public: // fixed size arrays
169  // ========================================================================
171  static StatusCode array
172  ( const Tuples::Tuple& tuple ,
173  const std::string& name ,
174  const std::vector<double>& data ) ;
175  // ========================================================================
177  static StatusCode array
178  ( const Tuples::Tuple& tuple ,
179  const std::string& name ,
180  const Gaudi::Vector1& data ) ;
181  // ========================================================================
183  static StatusCode array
184  ( const Tuples::Tuple& tuple ,
185  const std::string& name ,
186  const Gaudi::Vector2& data ) ;
187  // ========================================================================
189  static StatusCode array
190  ( const Tuples::Tuple& tuple ,
191  const std::string& name ,
192  const Gaudi::Vector3& data ) ;
193  // ========================================================================
195  static StatusCode array
196  ( const Tuples::Tuple& tuple ,
197  const std::string& name ,
198  const Gaudi::Vector4& data ) ;
199  // ========================================================================
201  static StatusCode array
202  ( const Tuples::Tuple& tuple ,
203  const std::string& name ,
204  const Gaudi::Vector5& data ) ;
205  // ========================================================================
206  public: // fixed size matrices
207  // ========================================================================
209  static StatusCode array
210  ( const Tuples::Tuple& tuple ,
211  const std::string& name ,
212  const Gaudi::Vector6& data ) ;
213  // ========================================================================
215  static StatusCode array
216  ( const Tuples::Tuple& tuple ,
217  const std::string& name ,
218  const Gaudi::Vector7& data ) ;
219  // ========================================================================
221  static StatusCode array
222  ( const Tuples::Tuple& tuple ,
223  const std::string& name ,
224  const Gaudi::Vector8& data ) ;
225  // ========================================================================
227  static StatusCode array
228  ( const Tuples::Tuple& tuple ,
229  const std::string& name ,
230  const Gaudi::Vector9& data ) ;
231  // ========================================================================
233  static StatusCode matrix
234  ( const Tuples::Tuple& tuple ,
235  const std::string& name ,
236  const GaudiPython::Matrix& data ,
237  const Tuples::TupleObj::MIndex cols ) ; // fixed !!!
238  // ========================================================================
240  static StatusCode matrix
241  ( const Tuples::Tuple& tuple ,
242  const std::string& name ,
243  const Gaudi::Matrix2x2& value ) ;
244  // ========================================================================
246  static StatusCode matrix
247  ( const Tuples::Tuple& tuple ,
248  const std::string& name ,
249  const Gaudi::Matrix3x3& value ) ;
250  // ========================================================================
252  static StatusCode matrix
253  ( const Tuples::Tuple& tuple ,
254  const std::string& name ,
255  const Gaudi::Matrix4x4& value ) ;
256  // ========================================================================
258  static StatusCode matrix
259  ( const Tuples::Tuple& tuple ,
260  const std::string& name ,
261  const Gaudi::Matrix5x5& value ) ;
262  // ========================================================================
264  static StatusCode matrix
265  ( const Tuples::Tuple& tuple ,
266  const std::string& name ,
267  const Gaudi::Matrix6x6& value ) ;
268  // ========================================================================
270  static StatusCode matrix
271  ( const Tuples::Tuple& tuple ,
272  const std::string& name ,
273  const Gaudi::Matrix7x7& value ) ;
274  // ========================================================================
276  static StatusCode matrix
277  ( const Tuples::Tuple& tuple ,
278  const std::string& name ,
279  const Gaudi::Matrix8x8& value ) ;
280  // ========================================================================
282  static StatusCode matrix
283  ( const Tuples::Tuple& tuple ,
284  const std::string& name ,
285  const Gaudi::Matrix9x9& value ) ;
286  // ========================================================================
288  static StatusCode matrix
289  ( const Tuples::Tuple& tuple ,
290  const std::string& name ,
291  const Gaudi::Matrix1x1& value ) ;
292  // ========================================================================
294  static StatusCode matrix
295  ( const Tuples::Tuple& tuple ,
296  const std::string& name ,
297  const Gaudi::Matrix1x3& value ) ;
298  // ========================================================================
300  static StatusCode matrix
301  ( const Tuples::Tuple& tuple ,
302  const std::string& name ,
303  const Gaudi::Matrix1x5& value ) ;
304  // ========================================================================
306  static StatusCode matrix
307  ( const Tuples::Tuple& tuple ,
308  const std::string& name ,
309  const Gaudi::Matrix1x6& value ) ;
310  // ========================================================================
312  static StatusCode matrix
313  ( const Tuples::Tuple& tuple ,
314  const std::string& name ,
315  const Gaudi::Matrix4x3& value ) ;
316  // ========================================================================
318  static StatusCode matrix
319  ( const Tuples::Tuple& tuple ,
320  const std::string& name ,
321  const Gaudi::Matrix3x4& value ) ;
322  // ========================================================================
324  static StatusCode matrix
325  ( const Tuples::Tuple& tuple ,
326  const std::string& name ,
327  const Gaudi::Matrix3x5& value ) ;
328  // ========================================================================
330  static StatusCode matrix
331  ( const Tuples::Tuple& tuple ,
332  const std::string& name ,
333  const Gaudi::Matrix3x6& value ) ;
334  // ========================================================================
336  static StatusCode matrix
337  ( const Tuples::Tuple& tuple ,
338  const std::string& name ,
339  const Gaudi::Matrix2x3& value ) ;
340  // ========================================================================
342  static StatusCode matrix
343  ( const Tuples::Tuple& tuple ,
344  const std::string& name ,
345  const Gaudi::Matrix3x2& value ) ;
346  // ========================================================================
348  static StatusCode matrix
349  ( const Tuples::Tuple& tuple ,
350  const std::string& name ,
351  const Gaudi::SymMatrix1x1& value ) ;
352  // ========================================================================
354  static StatusCode matrix
355  ( const Tuples::Tuple& tuple ,
356  const std::string& name ,
357  const Gaudi::SymMatrix2x2& value ) ;
358  // ========================================================================
360  static StatusCode matrix
361  ( const Tuples::Tuple& tuple ,
362  const std::string& name ,
363  const Gaudi::SymMatrix3x3& value ) ;
364  // ========================================================================
366  static StatusCode matrix
367  ( const Tuples::Tuple& tuple ,
368  const std::string& name ,
369  const Gaudi::SymMatrix4x4& value ) ;
370  // ========================================================================
372  static StatusCode matrix
373  ( const Tuples::Tuple& tuple ,
374  const std::string& name ,
375  const Gaudi::SymMatrix5x5& value ) ;
376  // ========================================================================
378  static StatusCode matrix
379  ( const Tuples::Tuple& tuple ,
380  const std::string& name ,
381  const Gaudi::SymMatrix6x6& value ) ;
382  // ========================================================================
384  static StatusCode matrix
385  ( const Tuples::Tuple& tuple ,
386  const std::string& name ,
387  const Gaudi::SymMatrix7x7& value ) ;
388  // ========================================================================
390  static StatusCode matrix
391  ( const Tuples::Tuple& tuple ,
392  const std::string& name ,
393  const Gaudi::SymMatrix8x8& value ) ;
394  // ========================================================================
396  static StatusCode matrix
397  ( const Tuples::Tuple& tuple ,
398  const std::string& name ,
399  const Gaudi::SymMatrix9x9& value ) ;
400  // ========================================================================
401  public: // some auxillary objects
402  // ========================================================================
404  static StatusCode column
405  ( const Tuples::Tuple& tuple ,
406  const std::string& name ,
407  const Gaudi::Time& value ) ;
409  static StatusCode column
410  ( const Tuples::Tuple& tuple ,
411  const Gaudi::Time& value ) ;
412  // ========================================================================
413  public: // CLHEP: should we keep it ?
414  // ========================================================================
416  static StatusCode array
417  ( const Tuples::Tuple& tuple ,
418  const std::string& name ,
419  const CLHEP::HepVector& data ) ;
421  static StatusCode farray
422  ( const Tuples::Tuple& tuple ,
423  const std::string& name ,
424  const CLHEP::HepVector& data ,
425  const std::string& length ,
426  const size_t maxv ) ;
428  static StatusCode matrix
429  ( const Tuples::Tuple& tuple ,
430  const std::string& name ,
431  const CLHEP::HepGenMatrix& data ) ;
433  static StatusCode fmatrix
434  ( const Tuples::Tuple& tuple ,
435  const std::string& name ,
436  const CLHEP::HepGenMatrix& data ,
437  const Tuples::TupleObj::MIndex cols , // fixed !!!
438  const std::string& length ,
439  const size_t maxv ) ;
440  // ========================================================================
441  } ;
442  // ==========================================================================
449  {
450  public:
451  // ========================================================================
453  static Tuples::Tuple nTuple
454  ( const GaudiTupleAlg& algo ,
455  const std::string& title ,
456  const CLID& clid = CLID_ColumnWiseTuple ) ;
457  // ========================================================================
459  static Tuples::Tuple nTuple
460  ( const GaudiTupleAlg& algo ,
461  const GaudiAlg::TupleID& ID ,
462  const std::string& title ,
463  const CLID& clid = CLID_ColumnWiseTuple ) ;
464  // ========================================================================
466  static Tuples::Tuple nTuple
467  ( const GaudiTupleAlg& algo ,
468  const int ID ,
469  const std::string& title ,
470  const CLID& clid = CLID_ColumnWiseTuple ) ;
471  // ========================================================================
473  static Tuples::Tuple nTuple
474  ( const GaudiTupleAlg& algo ,
475  const std::string& ID ,
476  const std::string& title ,
477  const CLID& clid = CLID_ColumnWiseTuple ) ;
478  // ========================================================================
480  static Tuples::Tuple evtCol
481  ( const GaudiTupleAlg& algo ,
482  const std::string& title ,
483  const CLID& clid = CLID_ColumnWiseTuple ) ;
484  // ========================================================================
486  static Tuples::Tuple evtCol
487  ( const GaudiTupleAlg& algo ,
488  const GaudiAlg::TupleID& ID ,
489  const std::string& title ,
490  const CLID& clid = CLID_ColumnWiseTuple ) ;
491  // ========================================================================
493  static Tuples::Tuple evtCol
494  ( const GaudiTupleAlg& algo ,
495  const int ID ,
496  const std::string& title ,
497  const CLID& clid = CLID_ColumnWiseTuple ) ;
498  // ========================================================================
500  static Tuples::Tuple evtCol
501  ( const GaudiTupleAlg& algo ,
502  const std::string& ID ,
503  const std::string& title ,
504  const CLID& clid = CLID_ColumnWiseTuple ) ;
505  // ========================================================================
506  } ;
507  // ==========================================================================
514  {
515  public:
516  // ========================================================================
518  static Tuples::Tuple nTuple
519  ( const ITupleTool& tool ,
520  const std::string& title ,
521  const CLID& clid = CLID_ColumnWiseTuple )
522  { return tool.nTuple ( title , clid ) ; }
523  // ========================================================================
525  static Tuples::Tuple nTuple
526  ( const ITupleTool& tool ,
527  const GaudiAlg::TupleID& ID ,
528  const std::string& title ,
529  const CLID& clid = CLID_ColumnWiseTuple )
530  { return tool.nTuple ( ID , title , clid ) ; }
531  // ========================================================================
533  static Tuples::Tuple nTuple
534  ( const ITupleTool& tool ,
535  const int ID ,
536  const std::string& title ,
537  const CLID& clid = CLID_ColumnWiseTuple )
538  { return tool.nTuple ( ID , title , clid ) ; }
539  // ========================================================================
541  static Tuples::Tuple nTuple
542  ( const ITupleTool& tool ,
543  const std::string& ID ,
544  const std::string& title ,
545  const CLID& clid = CLID_ColumnWiseTuple )
546  { return tool.nTuple ( ID , title , clid ) ; }
547  // ========================================================================
549  static Tuples::Tuple evtCol
550  ( const ITupleTool& tool ,
551  const std::string& title ,
552  const CLID& clid = CLID_ColumnWiseTuple )
553  { return tool.evtCol ( title , clid ) ; }
554  // ========================================================================
556  static Tuples::Tuple evtCol
557  ( const ITupleTool& tool ,
558  const GaudiAlg::TupleID& ID ,
559  const std::string& title ,
560  const CLID& clid = CLID_ColumnWiseTuple )
561  { return tool.nTuple ( ID , title , clid ) ; }
562  // ========================================================================
564  static Tuples::Tuple evtCol
565  ( const ITupleTool& tool ,
566  const int ID ,
567  const std::string& title ,
568  const CLID& clid = CLID_ColumnWiseTuple )
569  { return tool.nTuple ( ID , title , clid ) ; }
570  // ========================================================================
572  static Tuples::Tuple evtCol
573  ( const ITupleTool& tool ,
574  const std::string& ID ,
575  const std::string& title ,
576  const CLID& clid = CLID_ColumnWiseTuple )
577  { return tool.nTuple ( ID , title , clid ) ; }
578  // ========================================================================
579  } ;
580  // ==========================================================================
581 } // end of namespace GaudiPython
582 // ============================================================================
583 // The END
584 // ============================================================================
585 #endif // GAUDIPYTHON_TUPLEDECORATOR_H
586 // ============================================================================
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 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandr...
Definition: VectorMap.h:110
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)
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)
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:227
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)
ROOT::Math::SMatrix< double, 1, 1 > Matrix1x1
Generic 1x1 matrix (double)
NTuple interface class definition.
Definition: INTuple.h:80
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: Tuple.h:115
Symmetric Matrix typedefs.
ROOT::Math::SMatrix< double, 3, 6 > Matrix3x6
Generic 3x6 matrix (double)
def nTuple
Retrieve (book-on-demand) 'Smart'-N-tuple object.
Definition: TupleUtils.py:66
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:214
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
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:9
virtual Tuple evtCol(const std::string &title, const CLID &clid=CLID_RowWiseTuple) const =0
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)
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
std::vector< Row > Matrix
Definition: Vector.h:23
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:34
ROOT::Math::SMatrix< double, 3, 4 > Matrix3x4
Generic 3x4 matrix (double)
4D point typedefs
Opaque address interface definition.
Simple class to extend the functionality of class GaudiHistoAlg.
Definition: GaudiTupleAlg.h:42
virtual Tuple nTuple(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const =0
get N-tuple object ( book on-demand ) with unique identifier
#define GAUDI_API
Definition: Kernel.h:108
ROOT::Math::SVector< double, 5 > Vector5
5D Vector (double)
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:46
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)