The Gaudi Framework  v29r0 (ff2e7097)
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 // ============================================================================
11 #include "GaudiKernel/Time.h"
14 // ============================================================================
15 // GaudiAlg
16 // ============================================================================
17 #include "GaudiAlg/GaudiTupleAlg.h"
18 #include "GaudiAlg/ITupleTool.h"
19 #include "GaudiAlg/Tuple.h"
20 #include "GaudiAlg/TupleID.h"
21 #include "GaudiAlg/TupleObj.h"
22 #include "GaudiAlg/Tuples.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( const Tuples::Tuple& tuple, const std::string& name, const int value );
66  // ========================================================================
68  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const int value, const int minv,
69  const int maxv );
70  // ========================================================================
72  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const double value );
73  // ========================================================================
75  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const bool value );
76  // ========================================================================
78  static StatusCode column_ll( const Tuples::Tuple& tuple, const std::string& name, const long long value );
79  // ========================================================================
81  static StatusCode column_ull( const Tuples::Tuple& tuple, const std::string& name, const unsigned long long value );
82  // ========================================================================
83  public: // event tag collections
84  // ========================================================================
86  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, IOpaqueAddress* value );
87  // ========================================================================
89  static StatusCode column( const Tuples::Tuple& tuple, IOpaqueAddress* value );
90  // ========================================================================
91  public: // 4D kinematics
92  // ========================================================================
94  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::LorentzVector& value );
95  // ========================================================================
96  public: // 3D geometry
97  // ========================================================================
99  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::XYZVector& value );
100  // ========================================================================
102  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::XYZPoint& value );
103  // ========================================================================
104  public: // floating size arrays
105  // ========================================================================
107  static StatusCode farray( const Tuples::Tuple& tuple, const std::string& name, const std::vector<double>& data,
108  const std::string& length, const size_t maxv );
109  // ========================================================================
110  public: // floating-size matrices
111  // ========================================================================
113  static StatusCode fmatrix( const Tuples::Tuple& tuple, const std::string& name, const GaudiPython::Matrix& data,
114  const Tuples::TupleObj::MIndex cols, // fixed !!!
115  const std::string& length, const size_t maxv );
116  // ========================================================================
118  static StatusCode fmatrix( const Tuples::Tuple& tuple, const std::string& name,
119  const GaudiUtils::VectorMap<int, double>& info, const std::string& length,
120  const size_t maxv );
121  // ========================================================================
122  public: // fixed size arrays
123  // ========================================================================
125  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const std::vector<double>& data );
126  // ========================================================================
128  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector1& data );
129  // ========================================================================
131  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector2& data );
132  // ========================================================================
134  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector3& data );
135  // ========================================================================
137  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector4& data );
138  // ========================================================================
140  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector5& data );
141  // ========================================================================
142  public: // fixed size matrices
143  // ========================================================================
145  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector6& data );
146  // ========================================================================
148  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector7& data );
149  // ========================================================================
151  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector8& data );
152  // ========================================================================
154  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector9& data );
155  // ========================================================================
157  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const GaudiPython::Matrix& data,
158  const Tuples::TupleObj::MIndex cols ); // fixed !!!
159  // ========================================================================
161  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix2x2& value );
162  // ========================================================================
164  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x3& value );
165  // ========================================================================
167  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix4x4& value );
168  // ========================================================================
170  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix5x5& value );
171  // ========================================================================
173  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix6x6& value );
174  // ========================================================================
176  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix7x7& value );
177  // ========================================================================
179  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix8x8& value );
180  // ========================================================================
182  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix9x9& value );
183  // ========================================================================
185  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x1& value );
186  // ========================================================================
188  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x3& value );
189  // ========================================================================
191  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x5& value );
192  // ========================================================================
194  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x6& value );
195  // ========================================================================
197  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix4x3& value );
198  // ========================================================================
200  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x4& value );
201  // ========================================================================
203  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x5& value );
204  // ========================================================================
206  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x6& value );
207  // ========================================================================
209  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix2x3& value );
210  // ========================================================================
212  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x2& value );
213  // ========================================================================
215  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix1x1& value );
216  // ========================================================================
218  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix2x2& value );
219  // ========================================================================
221  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix3x3& value );
222  // ========================================================================
224  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix4x4& value );
225  // ========================================================================
227  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix5x5& value );
228  // ========================================================================
230  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix6x6& value );
231  // ========================================================================
233  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix7x7& value );
234  // ========================================================================
236  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix8x8& value );
237  // ========================================================================
239  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix9x9& value );
240  // ========================================================================
241  public: // some auxillary objects
242  // ========================================================================
244  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Time& value );
246  static StatusCode column( const Tuples::Tuple& tuple, const Gaudi::Time& value );
247  // ========================================================================
248  public: // CLHEP: should we keep it ?
249  // ========================================================================
251  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepVector& data );
253  static StatusCode farray( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepVector& data,
254  const std::string& length, const size_t maxv );
256  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepGenMatrix& data );
258  static StatusCode fmatrix( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepGenMatrix& data,
259  const Tuples::TupleObj::MIndex cols, // fixed !!!
260  const std::string& length, const size_t maxv );
261  // ========================================================================
262  };
263  // ==========================================================================
270  {
271  public:
272  // ========================================================================
274  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const std::string& title,
275  const CLID& clid = CLID_ColumnWiseTuple );
276  // ========================================================================
278  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID, const std::string& title,
279  const CLID& clid = CLID_ColumnWiseTuple );
280  // ========================================================================
282  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const int ID, const std::string& title,
283  const CLID& clid = CLID_ColumnWiseTuple );
284  // ========================================================================
286  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const std::string& ID, const std::string& title,
287  const CLID& clid = CLID_ColumnWiseTuple );
288  // ========================================================================
290  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const std::string& title,
291  const CLID& clid = CLID_ColumnWiseTuple );
292  // ========================================================================
294  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID, const std::string& title,
295  const CLID& clid = CLID_ColumnWiseTuple );
296  // ========================================================================
298  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const int ID, const std::string& title,
299  const CLID& clid = CLID_ColumnWiseTuple );
300  // ========================================================================
302  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const std::string& ID, const std::string& title,
303  const CLID& clid = CLID_ColumnWiseTuple );
304  // ========================================================================
305  };
306  // ==========================================================================
313  {
314  public:
315  // ========================================================================
317  static Tuples::Tuple nTuple( const ITupleTool& tool, const std::string& title,
318  const CLID& clid = CLID_ColumnWiseTuple )
319  {
320  return tool.nTuple( title, clid );
321  }
322  // ========================================================================
324  static Tuples::Tuple nTuple( const ITupleTool& tool, const GaudiAlg::TupleID& ID, const std::string& title,
325  const CLID& clid = CLID_ColumnWiseTuple )
326  {
327  return tool.nTuple( ID, title, clid );
328  }
329  // ========================================================================
331  static Tuples::Tuple nTuple( const ITupleTool& tool, const int ID, const std::string& title,
332  const CLID& clid = CLID_ColumnWiseTuple )
333  {
334  return tool.nTuple( ID, title, clid );
335  }
336  // ========================================================================
338  static Tuples::Tuple nTuple( const ITupleTool& tool, const std::string& ID, const std::string& title,
339  const CLID& clid = CLID_ColumnWiseTuple )
340  {
341  return tool.nTuple( ID, title, clid );
342  }
343  // ========================================================================
345  static Tuples::Tuple evtCol( const ITupleTool& tool, const std::string& title,
346  const CLID& clid = CLID_ColumnWiseTuple )
347  {
348  return tool.evtCol( title, clid );
349  }
350  // ========================================================================
352  static Tuples::Tuple evtCol( const ITupleTool& tool, const GaudiAlg::TupleID& ID, const std::string& title,
353  const CLID& clid = CLID_ColumnWiseTuple )
354  {
355  return tool.nTuple( ID, title, clid );
356  }
357  // ========================================================================
359  static Tuples::Tuple evtCol( const ITupleTool& tool, const int ID, const std::string& title,
360  const CLID& clid = CLID_ColumnWiseTuple )
361  {
362  return tool.nTuple( ID, title, clid );
363  }
364  // ========================================================================
366  static Tuples::Tuple evtCol( const ITupleTool& tool, const std::string& ID, const std::string& title,
367  const CLID& clid = CLID_ColumnWiseTuple )
368  {
369  return tool.nTuple( ID, title, clid );
370  }
371  // ========================================================================
372  };
373  // ==========================================================================
374 } // end of namespace GaudiPython
375 // ============================================================================
376 // The END
377 // ============================================================================
378 #endif // GAUDIPYTHON_TUPLEDECORATOR_H
379 // ============================================================================
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:103
Simple class which performs the decoration of the standard N-Tuple.
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > SymMatrix1x1
Symmetrix 1x1 matrix (double)
ROOT::Math::SMatrix< double, 3, 5 > Matrix3x5
Generic 3x5 matrix (double)
Generic matrix typedefs.
Simple class to perform the "decoration" of Tuples in Python/ROOT.
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > SymMatrix5x5
Symmetrix 5x5 matrix (double)
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)
static Tuples::Tuple nTuple(const ITupleTool &tool, const std::string &ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
ROOT::Math::SMatrix< double, 9, 9, ROOT::Math::MatRepSym< double, 9 > > SymMatrix9x9
Symmetrix 9x9 matrix (double)
General vectors.
static Tuples::Tuple evtCol(const ITupleTool &tool, const std::string &ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
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:246
ROOT::Math::SMatrix< double, 3, 2 > Matrix3x2
Generic 3x2 matrix (double)
static Tuples::Tuple evtCol(const ITupleTool &tool, const int ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
ROOT::Math::SVector< double, 9 > Vector9
9D Vector (double)
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > SymMatrix7x7
Symmetrix 7x7 matrix (double)
ROOT::Math::SVector< double, 2 > Vector2
2D Vector (double)
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SymMatrix4x4
Symmetrix 4x4 matrix (double)
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > SymMatrix6x6
Symmetrix 6x6 matrix (double)
ROOT::Math::SVector< double, 8 > Vector8
8D Vector (double)
STL class.
ROOT::Math::SMatrix< double, 1, 1 > Matrix1x1
Generic 1x1 matrix (double)
NTuple interface class definition.
Definition: INTuple.h:82
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: Tuple.h:117
Symmetric Matrix typedefs.
ROOT::Math::SMatrix< double, 3, 6 > Matrix3x6
Generic 3x6 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:237
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
ROOT::Math::SMatrix< double, 5, 5 > Matrix5x5
Generic 5x5 matrix (double)
ROOT::Math::SMatrix< double, 8, 8, ROOT::Math::MatRepSym< double, 8 > > SymMatrix8x8
Symmetrix 8x8 matrix (double)
ROOT::Math::SMatrix< double, 7, 7 > Matrix7x7
Generic 7x7 matrix (double)
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
static Tuples::Tuple nTuple(const ITupleTool &tool, const GaudiAlg::TupleID &ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
static Tuples::Tuple evtCol(const ITupleTool &tool, const GaudiAlg::TupleID &ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
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:412
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)
static Tuples::Tuple nTuple(const ITupleTool &tool, const int ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
ROOT::Math::SMatrix< double, 2, 2 > Matrix2x2
Generic 2x2 matrix (double)
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SymMatrix2x2
Symmetrix 2x2 matrix (double)
3D vector typedefs
ROOT::Math::SVector< double, 4 > Vector4
4D Vector (double)
ROOT::Math::SMatrix< double, 1, 3 > Matrix1x3
Generic 1x3 matrix (double)
static Tuples::Tuple nTuple(const ITupleTool &tool, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
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.
static Tuples::Tuple evtCol(const ITupleTool &tool, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
#define GAUDI_API
Definition: Kernel.h:110
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)