Gaudi Framework, version v23r4

Home   Generated: Mon Sep 17 2012

TupleDecorator.h

Go to the documentation of this file.
00001 // $Id: TupleDecorator.h,v 1.9 2007/08/07 14:05:33 marcocle Exp $
00002 // ============================================================================
00003 #ifndef GAUDIPYTHON_TUPLEDECORATOR_H
00004 #define GAUDIPYTHON_TUPLEDECORATOR_H 1
00005 // ============================================================================
00006 // Include files
00007 // ============================================================================
00008 #include "GaudiKernel/Point3DTypes.h"
00009 #include "GaudiKernel/Vector3DTypes.h"
00010 #include "GaudiKernel/Point4DTypes.h"
00011 #include "GaudiKernel/Vector4DTypes.h"
00012 #include "GaudiKernel/SymmetricMatrixTypes.h"
00013 #include "GaudiKernel/GenericMatrixTypes.h"
00014 #include "GaudiKernel/GenericVectorTypes.h"
00015 #include "GaudiKernel/Time.h"
00016 // ============================================================================
00017 // GaudiAlg
00018 // ============================================================================
00019 #include "GaudiAlg/TupleID.h"
00020 #include "GaudiAlg/TupleObj.h"
00021 #include "GaudiAlg/Tuple.h"
00022 #include "GaudiAlg/Tuples.h"
00023 #include "GaudiAlg/ITupleTool.h"
00024 #include "GaudiAlg/GaudiTupleAlg.h"
00025 // ============================================================================
00026 // GaudiPython
00027 // ============================================================================
00028 #include "GaudiPython/GaudiPython.h"
00029 #include "GaudiPython/Vector.h"
00030 // ============================================================================
00031 // Forward declarations
00032 // ============================================================================
00033 namespace CLHEP
00034 {
00035   class HepGenMatrix ;
00036   class HepVector    ;
00037 }
00038 // ============================================================================
00039 namespace GaudiPython
00040 {
00041   // ==========================================================================
00048   class GAUDI_API TupleDecorator
00049   {
00050   public:
00051     // ========================================================================
00053     static INTuple*         nTuple ( const Tuples::Tuple&  tuple ) ;
00054     // ========================================================================
00056     static NTuple::Tuple*   ntuple ( const Tuples::Tuple&  tuple ) ;
00057     // ========================================================================
00059     static bool             valid  ( const Tuples::Tuple&  tuple ) ;
00060     // ========================================================================
00062     static StatusCode       write  ( const Tuples::Tuple&  tuple ) ;
00063     // ========================================================================
00064   public: // primitives  
00065     // ========================================================================
00067     static StatusCode column
00068     ( const Tuples::Tuple& tuple ,
00069       const std::string&   name  ,
00070       const int            value ) ;
00071     // ========================================================================
00073     static StatusCode column
00074     ( const Tuples::Tuple& tuple ,
00075       const std::string&   name  ,
00076       const int            value ,
00077       const int            minv  ,
00078       const int            maxv  ) ;
00079     // ========================================================================
00081     static StatusCode column
00082     ( const Tuples::Tuple& tuple ,
00083       const std::string&   name  ,
00084       const double         value ) ;
00085     // ========================================================================
00087     static StatusCode column
00088     ( const Tuples::Tuple& tuple ,
00089       const std::string&   name  ,
00090       const bool           value ) ;
00091     // ========================================================================
00093     static StatusCode column_ll 
00094     ( const Tuples::Tuple&     tuple ,
00095       const std::string&       name  ,
00096       const long long          value ) ;
00097     // ========================================================================
00099     static StatusCode column_ull 
00100     ( const Tuples::Tuple&     tuple ,
00101       const std::string&       name  ,
00102       const unsigned long long value ) ;
00103     // ========================================================================
00104   public:  // event tag collections 
00105     // ========================================================================
00107     static StatusCode column
00108     ( const Tuples::Tuple&  tuple ,
00109       const std::string&    name  ,
00110       IOpaqueAddress*       value ) ;
00111     // ========================================================================
00113     static StatusCode column
00114     ( const Tuples::Tuple&  tuple ,
00115       IOpaqueAddress*       value ) ;
00116     // ========================================================================
00117   public: // 4D kinematics
00118     // ========================================================================
00120     static StatusCode column
00121     ( const Tuples::Tuple&             tuple ,
00122       const std::string&               name  ,
00123       const Gaudi::LorentzVector&      value ) ;
00124     // ========================================================================
00125   public: // 3D geometry 
00126     // ========================================================================
00128     static StatusCode column
00129     ( const Tuples::Tuple&             tuple ,
00130       const std::string&               name  ,
00131       const Gaudi::XYZVector&          value ) ;
00132     // ========================================================================
00134     static StatusCode column
00135     ( const Tuples::Tuple&            tuple ,
00136       const std::string&              name  ,
00137       const Gaudi::XYZPoint&          value ) ;
00138     // ========================================================================
00139   public:   // floating size arrays 
00140     // ========================================================================
00142     static StatusCode farray
00143     ( const Tuples::Tuple&            tuple  ,
00144       const std::string&              name   ,
00145       const std::vector<double>&      data   ,
00146       const std::string&              length ,
00147       const size_t                    maxv   ) ;
00148     // ========================================================================
00149   public:   // floating-size matrices 
00150     // ========================================================================
00152     static StatusCode fmatrix
00153     ( const Tuples::Tuple&            tuple  ,
00154       const std::string&              name   ,
00155       const GaudiPython::Matrix&      data   ,
00156       const Tuples::TupleObj::MIndex  cols   , // fixed !!!
00157       const std::string&              length ,
00158       const size_t                    maxv   ) ;
00159     // ========================================================================
00161     static StatusCode fmatrix
00162     ( const Tuples::Tuple&            tuple  ,
00163       const std::string&              name   ,
00164       const GaudiUtils::VectorMap<int,double>& info   ,
00165       const std::string&              length ,
00166       const size_t                    maxv   ) ;
00167     // ========================================================================
00168   public:   // fixed size arrays 
00169     // ========================================================================
00171     static StatusCode array
00172     ( const Tuples::Tuple&            tuple  ,
00173       const std::string&              name   ,
00174       const std::vector<double>&      data   ) ;
00175     // ========================================================================
00177     static StatusCode array
00178     ( const Tuples::Tuple&            tuple  ,
00179       const std::string&              name   ,
00180       const Gaudi::Vector1&           data   ) ;
00181     // ========================================================================
00183     static StatusCode array
00184     ( const Tuples::Tuple&            tuple  ,
00185       const std::string&              name   ,
00186       const Gaudi::Vector2&           data   ) ;
00187     // ========================================================================
00189     static StatusCode array
00190     ( const Tuples::Tuple&            tuple  ,
00191       const std::string&              name   ,
00192       const Gaudi::Vector3&           data   ) ;
00193     // ========================================================================
00195     static StatusCode array
00196     ( const Tuples::Tuple&            tuple  ,
00197       const std::string&              name   ,
00198       const Gaudi::Vector4&           data   ) ;
00199     // ========================================================================
00201     static StatusCode array
00202     ( const Tuples::Tuple&            tuple  ,
00203       const std::string&              name   ,
00204       const Gaudi::Vector5&           data   ) ;
00205     // ========================================================================
00206   public:   // fixed size matrices 
00207     // ========================================================================
00209     static StatusCode array
00210     ( const Tuples::Tuple&            tuple  ,
00211       const std::string&              name   ,
00212       const Gaudi::Vector6&           data   ) ;
00213     // ========================================================================
00215     static StatusCode array
00216     ( const Tuples::Tuple&            tuple  ,
00217       const std::string&              name   ,
00218       const Gaudi::Vector7&           data   ) ;
00219     // ========================================================================
00221     static StatusCode array
00222     ( const Tuples::Tuple&            tuple  ,
00223       const std::string&              name   ,
00224       const Gaudi::Vector8&           data   ) ;
00225     // ========================================================================
00227     static StatusCode array
00228     ( const Tuples::Tuple&            tuple  ,
00229       const std::string&              name   ,
00230       const Gaudi::Vector9&           data   ) ;
00231     // ========================================================================
00233     static StatusCode matrix
00234     ( const Tuples::Tuple&            tuple ,
00235       const std::string&              name  ,
00236       const GaudiPython::Matrix&      data  ,
00237       const Tuples::TupleObj::MIndex  cols  ) ; // fixed !!!
00238     // ========================================================================
00240     static StatusCode matrix
00241     ( const Tuples::Tuple&            tuple ,
00242       const std::string&              name  ,
00243       const Gaudi::Matrix2x2&         value ) ;
00244     // ========================================================================
00246     static StatusCode matrix
00247     ( const Tuples::Tuple&            tuple ,
00248       const std::string&              name  ,
00249       const Gaudi::Matrix3x3&         value ) ;
00250     // ========================================================================
00252     static StatusCode matrix
00253     ( const Tuples::Tuple&            tuple ,
00254       const std::string&              name  ,
00255       const Gaudi::Matrix4x4&         value ) ;
00256     // ========================================================================
00258     static StatusCode matrix
00259     ( const Tuples::Tuple&            tuple ,
00260       const std::string&              name  ,
00261       const Gaudi::Matrix5x5&         value ) ;
00262     // ========================================================================
00264     static StatusCode matrix
00265     ( const Tuples::Tuple&            tuple ,
00266       const std::string&              name  ,
00267       const Gaudi::Matrix6x6&         value ) ;
00268     // ========================================================================
00270     static StatusCode matrix
00271     ( const Tuples::Tuple&            tuple ,
00272       const std::string&              name  ,
00273       const Gaudi::Matrix7x7&         value ) ;
00274     // ========================================================================
00276     static StatusCode matrix
00277     ( const Tuples::Tuple&            tuple ,
00278       const std::string&              name  ,
00279       const Gaudi::Matrix8x8&         value ) ;
00280     // ========================================================================
00282     static StatusCode matrix
00283     ( const Tuples::Tuple&            tuple ,
00284       const std::string&              name  ,
00285       const Gaudi::Matrix9x9&         value ) ;
00286     // ========================================================================
00288     static StatusCode matrix
00289     ( const Tuples::Tuple&            tuple ,
00290       const std::string&              name  ,
00291       const Gaudi::Matrix1x1&         value ) ;
00292     // ========================================================================
00294     static StatusCode matrix
00295     ( const Tuples::Tuple&            tuple ,
00296       const std::string&              name  ,
00297       const Gaudi::Matrix1x3&         value ) ;
00298     // ========================================================================
00300     static StatusCode matrix
00301     ( const Tuples::Tuple&            tuple ,
00302       const std::string&              name  ,
00303       const Gaudi::Matrix1x5&         value ) ;
00304     // ========================================================================
00306     static StatusCode matrix
00307     ( const Tuples::Tuple&            tuple ,
00308       const std::string&              name  ,
00309       const Gaudi::Matrix1x6&         value ) ;
00310     // ========================================================================
00312     static StatusCode matrix
00313     ( const Tuples::Tuple&            tuple ,
00314       const std::string&              name  ,
00315       const Gaudi::Matrix4x3&         value ) ;
00316     // ========================================================================
00318     static StatusCode matrix
00319     ( const Tuples::Tuple&            tuple ,
00320       const std::string&              name  ,
00321       const Gaudi::Matrix3x4&         value ) ;
00322     // ========================================================================
00324     static StatusCode matrix
00325     ( const Tuples::Tuple&            tuple ,
00326       const std::string&              name  ,
00327       const Gaudi::Matrix3x5&         value ) ;
00328     // ========================================================================
00330     static StatusCode matrix
00331     ( const Tuples::Tuple&            tuple ,
00332       const std::string&              name  ,
00333       const Gaudi::Matrix3x6&         value ) ;
00334     // ========================================================================
00336     static StatusCode matrix
00337     ( const Tuples::Tuple&            tuple ,
00338       const std::string&              name  ,
00339       const Gaudi::Matrix2x3&         value ) ;
00340     // ========================================================================
00342     static StatusCode matrix
00343     ( const Tuples::Tuple&            tuple ,
00344       const std::string&              name  ,
00345       const Gaudi::Matrix3x2&         value ) ;
00346     // ========================================================================
00348     static StatusCode matrix
00349     ( const Tuples::Tuple&            tuple ,
00350       const std::string&              name  ,
00351       const Gaudi::SymMatrix1x1&      value ) ;
00352     // ========================================================================
00354     static StatusCode matrix
00355     ( const Tuples::Tuple&            tuple ,
00356       const std::string&              name  ,
00357       const Gaudi::SymMatrix2x2&      value ) ;
00358     // ========================================================================
00360     static StatusCode matrix
00361     ( const Tuples::Tuple&            tuple ,
00362       const std::string&              name  ,
00363       const Gaudi::SymMatrix3x3&      value ) ;
00364     // ========================================================================
00366     static StatusCode matrix
00367     ( const Tuples::Tuple&            tuple ,
00368       const std::string&              name  ,
00369       const Gaudi::SymMatrix4x4&      value ) ;
00370     // ========================================================================
00372     static StatusCode matrix
00373     ( const Tuples::Tuple&            tuple ,
00374       const std::string&              name  ,
00375       const Gaudi::SymMatrix5x5&      value ) ;
00376     // ========================================================================
00378     static StatusCode matrix
00379     ( const Tuples::Tuple&            tuple ,
00380       const std::string&              name  ,
00381       const Gaudi::SymMatrix6x6&      value ) ;
00382     // ========================================================================
00384     static StatusCode matrix
00385     ( const Tuples::Tuple&            tuple ,
00386       const std::string&              name  ,
00387       const Gaudi::SymMatrix7x7&      value ) ;
00388     // ========================================================================
00390     static StatusCode matrix
00391     ( const Tuples::Tuple&            tuple ,
00392       const std::string&              name  ,
00393       const Gaudi::SymMatrix8x8&      value ) ;
00394     // ========================================================================
00396     static StatusCode matrix
00397     ( const Tuples::Tuple&            tuple ,
00398       const std::string&              name  ,
00399       const Gaudi::SymMatrix9x9&      value ) ;
00400     // ========================================================================
00401   public:   // some auxillary  objects 
00402     // ========================================================================
00404     static StatusCode column
00405     ( const Tuples::Tuple&            tuple ,
00406       const std::string&              name  ,
00407       const Gaudi::Time&              value ) ;
00409     static StatusCode column 
00410     ( const Tuples::Tuple&            tuple ,
00411       const Gaudi::Time&              value ) ;
00412     // ========================================================================
00413   public:   // CLHEP: should we keep it ?
00414     // ========================================================================
00416     static StatusCode array
00417     ( const Tuples::Tuple&            tuple  ,
00418       const std::string&              name   ,
00419       const CLHEP::HepVector&         data   ) ;
00421     static StatusCode farray
00422     ( const Tuples::Tuple&            tuple  ,
00423       const std::string&              name   ,
00424       const CLHEP::HepVector&         data   ,
00425       const std::string&              length ,
00426       const size_t                    maxv   ) ;
00428     static StatusCode matrix
00429     ( const Tuples::Tuple&            tuple  ,
00430       const std::string&              name   ,
00431       const CLHEP::HepGenMatrix&      data   ) ;
00433     static StatusCode fmatrix
00434     ( const Tuples::Tuple&            tuple  ,
00435       const std::string&              name   ,
00436       const CLHEP::HepGenMatrix&      data   ,
00437       const Tuples::TupleObj::MIndex  cols   , // fixed !!!
00438       const std::string&              length ,
00439       const size_t                    maxv   ) ;
00440     // ========================================================================
00441   } ;
00442   // ==========================================================================
00448   class GAUDI_API TupleAlgDecorator
00449   {
00450   public:
00451     // ========================================================================
00453     static Tuples::Tuple       nTuple
00454     ( const GaudiTupleAlg&     algo                         ,
00455       const std::string&       title                        ,
00456       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00457     // ========================================================================
00459     static Tuples::Tuple       nTuple
00460     ( const GaudiTupleAlg&     algo                         ,
00461       const GaudiAlg::TupleID& ID                           ,
00462       const std::string&       title                        ,
00463       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00464     // ========================================================================
00466     static Tuples::Tuple       nTuple
00467     ( const GaudiTupleAlg&     algo                         ,
00468       const int                ID                           ,
00469       const std::string&       title                        ,
00470       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00471     // ========================================================================
00473     static Tuples::Tuple       nTuple
00474     ( const GaudiTupleAlg&     algo                         ,
00475       const std::string&       ID                           ,
00476       const std::string&       title                        ,
00477       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00478     // ========================================================================
00480     static Tuples::Tuple       evtCol
00481     ( const GaudiTupleAlg&     algo                         ,
00482       const std::string&       title                        ,
00483       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00484     // ========================================================================
00486     static Tuples::Tuple       evtCol
00487     ( const GaudiTupleAlg&     algo                         ,
00488       const GaudiAlg::TupleID& ID                           ,
00489       const std::string&       title                        ,
00490       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00491     // ========================================================================
00493     static Tuples::Tuple       evtCol
00494     ( const GaudiTupleAlg&     algo                         ,
00495       const int                ID                           ,
00496       const std::string&       title                        ,
00497       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00498     // ========================================================================
00500     static Tuples::Tuple       evtCol
00501     ( const GaudiTupleAlg&     algo                         ,
00502       const std::string&       ID                           ,
00503       const std::string&       title                        ,
00504       const CLID&              clid  = CLID_ColumnWiseTuple ) ;
00505     // ========================================================================
00506   } ;
00507   // ==========================================================================
00513   class GAUDI_API TupleToolDecorator
00514   {
00515   public:
00516     // ========================================================================
00518     static Tuples::Tuple       nTuple
00519     ( const ITupleTool&        tool                         ,
00520       const std::string&       title                        ,
00521       const CLID&              clid  = CLID_ColumnWiseTuple )
00522     { return tool.nTuple ( title , clid ) ; }
00523     // ========================================================================
00525     static Tuples::Tuple       nTuple
00526     ( const ITupleTool&        tool                         ,
00527       const GaudiAlg::TupleID& ID                           ,
00528       const std::string&       title                        ,
00529       const CLID&              clid  = CLID_ColumnWiseTuple )
00530     { return tool.nTuple ( ID , title , clid ) ; }
00531     // ========================================================================
00533     static Tuples::Tuple       nTuple
00534     ( const ITupleTool&        tool                         ,
00535       const int                ID                           ,
00536       const std::string&       title                        ,
00537       const CLID&              clid  = CLID_ColumnWiseTuple )
00538     { return tool.nTuple ( ID , title , clid ) ; }
00539     // ========================================================================
00541     static Tuples::Tuple       nTuple
00542     ( const ITupleTool&        tool                         ,
00543       const std::string&       ID                           ,
00544       const std::string&       title                        ,
00545       const CLID&              clid  = CLID_ColumnWiseTuple )
00546     { return tool.nTuple ( ID , title , clid ) ; }
00547     // ========================================================================
00549     static Tuples::Tuple       evtCol
00550     ( const ITupleTool&        tool                         ,
00551       const std::string&       title                        ,
00552       const CLID&              clid  = CLID_ColumnWiseTuple )
00553     { return tool.evtCol ( title , clid ) ; }
00554     // ========================================================================
00556     static Tuples::Tuple       evtCol
00557     ( const ITupleTool&        tool                         ,
00558       const GaudiAlg::TupleID& ID                           ,
00559       const std::string&       title                        ,
00560       const CLID&              clid  = CLID_ColumnWiseTuple )
00561     { return tool.nTuple ( ID , title , clid ) ; }
00562     // ========================================================================
00564     static Tuples::Tuple       evtCol
00565     ( const ITupleTool&        tool                         ,
00566       const int                ID                           ,
00567       const std::string&       title                        ,
00568       const CLID&              clid  = CLID_ColumnWiseTuple )
00569     { return tool.nTuple ( ID , title , clid ) ; }
00570     // ========================================================================
00572     static Tuples::Tuple       evtCol
00573     ( const ITupleTool&        tool                         ,
00574       const std::string&       ID                           ,
00575       const std::string&       title                        ,
00576       const CLID&              clid  = CLID_ColumnWiseTuple )
00577     { return tool.nTuple ( ID , title , clid ) ; }
00578     // ========================================================================
00579   } ;
00580   // ==========================================================================
00581 } // end of namespace GaudiPython
00582 // ============================================================================
00583 // The END
00584 // ============================================================================
00585 #endif // GAUDIPYTHON_TUPLEDECORATOR_H
00586 // ============================================================================
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Sep 17 2012 13:49:35 for Gaudi Framework, version v23r4 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004