Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
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 // ============================================================================
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  class HepGenMatrix;
33  class HepVector;
34 } // namespace CLHEP
35 // ============================================================================
36 namespace GaudiPython {
37  // ==========================================================================
45  public:
46  // ========================================================================
48  static INTuple* nTuple( const Tuples::Tuple& tuple );
49  // ========================================================================
51  static NTuple::Tuple* ntuple( const Tuples::Tuple& tuple );
52  // ========================================================================
54  static bool valid( const Tuples::Tuple& tuple );
55  // ========================================================================
57  static StatusCode write( const Tuples::Tuple& tuple );
58  // ========================================================================
59  public: // primitives
60  // ========================================================================
62  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const int value );
63  // ========================================================================
65  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const int value, const int minv,
66  const int maxv );
67  // ========================================================================
69  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const double value );
70  // ========================================================================
72  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const bool value );
73  // ========================================================================
75  static StatusCode column_ll( const Tuples::Tuple& tuple, const std::string& name, const long long value );
76  // ========================================================================
78  static StatusCode column_ull( const Tuples::Tuple& tuple, const std::string& name, const unsigned long long value );
79  // ========================================================================
80  public: // event tag collections
81  // ========================================================================
83  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, IOpaqueAddress* value );
84  // ========================================================================
86  static StatusCode column( const Tuples::Tuple& tuple, IOpaqueAddress* value );
87  // ========================================================================
88  public: // 4D kinematics
89  // ========================================================================
91  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::LorentzVector& value );
92  // ========================================================================
93  public: // 3D geometry
94  // ========================================================================
96  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::XYZVector& value );
97  // ========================================================================
99  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::XYZPoint& value );
100  // ========================================================================
101  public: // floating size arrays
102  // ========================================================================
104  static StatusCode farray( const Tuples::Tuple& tuple, const std::string& name, const std::vector<double>& data,
105  const std::string& length, const size_t maxv );
106  // ========================================================================
107  public: // floating-size matrices
108  // ========================================================================
110  static StatusCode fmatrix( const Tuples::Tuple& tuple, const std::string& name, const GaudiPython::Matrix& data,
111  const Tuples::TupleObj::MIndex cols, // fixed !!!
112  const std::string& length, const size_t maxv );
113  // ========================================================================
115  static StatusCode fmatrix( const Tuples::Tuple& tuple, const std::string& name,
116  const GaudiUtils::VectorMap<int, double>& info, const std::string& length,
117  const size_t maxv );
118  // ========================================================================
119  public: // fixed size arrays
120  // ========================================================================
122  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const std::vector<double>& data );
123  // ========================================================================
125  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector1& data );
126  // ========================================================================
128  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector2& data );
129  // ========================================================================
131  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector3& data );
132  // ========================================================================
134  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector4& data );
135  // ========================================================================
137  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector5& data );
138  // ========================================================================
139  public: // fixed size matrices
140  // ========================================================================
142  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector6& data );
143  // ========================================================================
145  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector7& data );
146  // ========================================================================
148  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector8& data );
149  // ========================================================================
151  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Vector9& data );
152  // ========================================================================
154  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const GaudiPython::Matrix& data,
155  const Tuples::TupleObj::MIndex cols ); // fixed !!!
156  // ========================================================================
158  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix2x2& value );
159  // ========================================================================
161  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x3& value );
162  // ========================================================================
164  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix4x4& value );
165  // ========================================================================
167  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix5x5& value );
168  // ========================================================================
170  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix6x6& value );
171  // ========================================================================
173  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix7x7& value );
174  // ========================================================================
176  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix8x8& value );
177  // ========================================================================
179  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix9x9& value );
180  // ========================================================================
182  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x1& value );
183  // ========================================================================
185  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x3& value );
186  // ========================================================================
188  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x5& value );
189  // ========================================================================
191  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix1x6& value );
192  // ========================================================================
194  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix4x3& value );
195  // ========================================================================
197  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x4& value );
198  // ========================================================================
200  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x5& value );
201  // ========================================================================
203  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x6& value );
204  // ========================================================================
206  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix2x3& value );
207  // ========================================================================
209  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Matrix3x2& value );
210  // ========================================================================
212  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix1x1& value );
213  // ========================================================================
215  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix2x2& value );
216  // ========================================================================
218  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix3x3& value );
219  // ========================================================================
221  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix4x4& value );
222  // ========================================================================
224  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix5x5& value );
225  // ========================================================================
227  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix6x6& value );
228  // ========================================================================
230  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix7x7& value );
231  // ========================================================================
233  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix8x8& value );
234  // ========================================================================
236  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::SymMatrix9x9& value );
237  // ========================================================================
238  public: // some auxillary objects
239  // ========================================================================
241  static StatusCode column( const Tuples::Tuple& tuple, const std::string& name, const Gaudi::Time& value );
243  static StatusCode column( const Tuples::Tuple& tuple, const Gaudi::Time& value );
244  // ========================================================================
245  public: // CLHEP: should we keep it ?
246  // ========================================================================
248  static StatusCode array( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepVector& data );
250  static StatusCode farray( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepVector& data,
251  const std::string& length, const size_t maxv );
253  static StatusCode matrix( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepGenMatrix& data );
255  static StatusCode fmatrix( const Tuples::Tuple& tuple, const std::string& name, const CLHEP::HepGenMatrix& data,
256  const Tuples::TupleObj::MIndex cols, // fixed !!!
257  const std::string& length, const size_t maxv );
258  // ========================================================================
259  };
260  // ==========================================================================
267  public:
268  // ========================================================================
270  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const std::string& title,
271  const CLID& clid = CLID_ColumnWiseTuple );
272  // ========================================================================
274  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID, const std::string& title,
275  const CLID& clid = CLID_ColumnWiseTuple );
276  // ========================================================================
278  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const int ID, const std::string& title,
279  const CLID& clid = CLID_ColumnWiseTuple );
280  // ========================================================================
282  static Tuples::Tuple nTuple( const GaudiTupleAlg& algo, const std::string& ID, const std::string& title,
283  const CLID& clid = CLID_ColumnWiseTuple );
284  // ========================================================================
286  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const std::string& title,
287  const CLID& clid = CLID_ColumnWiseTuple );
288  // ========================================================================
290  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const GaudiAlg::TupleID& ID, const std::string& title,
291  const CLID& clid = CLID_ColumnWiseTuple );
292  // ========================================================================
294  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const int ID, const std::string& title,
295  const CLID& clid = CLID_ColumnWiseTuple );
296  // ========================================================================
298  static Tuples::Tuple evtCol( const GaudiTupleAlg& algo, const std::string& ID, const std::string& title,
299  const CLID& clid = CLID_ColumnWiseTuple );
300  // ========================================================================
301  };
302  // ==========================================================================
309  public:
310  // ========================================================================
312  static Tuples::Tuple nTuple( const ITupleTool& tool, const std::string& title,
313  const CLID& clid = CLID_ColumnWiseTuple ) {
314  return tool.nTuple( title, clid );
315  }
316  // ========================================================================
318  static Tuples::Tuple nTuple( const ITupleTool& tool, const GaudiAlg::TupleID& ID, const std::string& title,
319  const CLID& clid = CLID_ColumnWiseTuple ) {
320  return tool.nTuple( ID, title, clid );
321  }
322  // ========================================================================
324  static Tuples::Tuple nTuple( const ITupleTool& tool, const int ID, const std::string& title,
325  const CLID& clid = CLID_ColumnWiseTuple ) {
326  return tool.nTuple( ID, title, clid );
327  }
328  // ========================================================================
330  static Tuples::Tuple nTuple( const ITupleTool& tool, const std::string& ID, const std::string& title,
331  const CLID& clid = CLID_ColumnWiseTuple ) {
332  return tool.nTuple( ID, title, clid );
333  }
334  // ========================================================================
336  static Tuples::Tuple evtCol( const ITupleTool& tool, const std::string& title,
337  const CLID& clid = CLID_ColumnWiseTuple ) {
338  return tool.evtCol( title, clid );
339  }
340  // ========================================================================
342  static Tuples::Tuple evtCol( const ITupleTool& tool, const GaudiAlg::TupleID& ID, const std::string& title,
343  const CLID& clid = CLID_ColumnWiseTuple ) {
344  return tool.nTuple( ID, title, clid );
345  }
346  // ========================================================================
348  static Tuples::Tuple evtCol( const ITupleTool& tool, const int ID, const std::string& title,
349  const CLID& clid = CLID_ColumnWiseTuple ) {
350  return tool.nTuple( ID, title, clid );
351  }
352  // ========================================================================
354  static Tuples::Tuple evtCol( const ITupleTool& tool, const std::string& ID, const std::string& title,
355  const CLID& clid = CLID_ColumnWiseTuple ) {
356  return tool.nTuple( ID, title, clid );
357  }
358  // ========================================================================
359  };
360  // ==========================================================================
361 } // end of namespace GaudiPython
362 // ============================================================================
363 // The END
364 // ============================================================================
365 #endif // GAUDIPYTHON_TUPLEDECORATOR_H
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:102
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:81
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, 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:231
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
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:375
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:30
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:71
def nTuple(dirpath, ID, ID2=None, topdir=None, LUN='FILE1')
Definition: TupleUtils.py:73
ROOT::Math::SVector< double, 5 > Vector5
5D Vector (double)
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:43
Header file for class : Tuple.
ROOT::Math::SVector< double, 1 > Vector1
1D Vector (double)