00001
00002
00003 #ifndef GAUDIPYTHON_TUPLEDECORATOR_H
00004 #define GAUDIPYTHON_TUPLEDECORATOR_H 1
00005
00006
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
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
00027
00028 #include "GaudiPython/GaudiPython.h"
00029 #include "GaudiPython/Vector.h"
00030
00031
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:
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
00092 public:
00093
00095 static StatusCode column
00096 ( const Tuples::Tuple& tuple ,
00097 const std::string& name ,
00098 IOpaqueAddress* value ) ;
00099
00101 static StatusCode column
00102 ( const Tuples::Tuple& tuple ,
00103 IOpaqueAddress* value ) ;
00104
00105 public:
00106
00108 static StatusCode column
00109 ( const Tuples::Tuple& tuple ,
00110 const std::string& name ,
00111 const Gaudi::LorentzVector& value ) ;
00112
00113 public:
00114
00116 static StatusCode column
00117 ( const Tuples::Tuple& tuple ,
00118 const std::string& name ,
00119 const Gaudi::XYZVector& value ) ;
00120
00122 static StatusCode column
00123 ( const Tuples::Tuple& tuple ,
00124 const std::string& name ,
00125 const Gaudi::XYZPoint& value ) ;
00126
00127 public:
00128
00130 static StatusCode farray
00131 ( const Tuples::Tuple& tuple ,
00132 const std::string& name ,
00133 const std::vector<double>& data ,
00134 const std::string& length ,
00135 const size_t maxv ) ;
00136
00137 public:
00138
00140 static StatusCode fmatrix
00141 ( const Tuples::Tuple& tuple ,
00142 const std::string& name ,
00143 const GaudiPython::Matrix& data ,
00144 const Tuples::TupleObj::MIndex cols ,
00145 const std::string& length ,
00146 const size_t maxv ) ;
00147
00149 static StatusCode fmatrix
00150 ( const Tuples::Tuple& tuple ,
00151 const std::string& name ,
00152 const GaudiUtils::VectorMap<int,double>& info ,
00153 const std::string& length ,
00154 const size_t maxv ) ;
00155
00156 public:
00157
00159 static StatusCode array
00160 ( const Tuples::Tuple& tuple ,
00161 const std::string& name ,
00162 const std::vector<double>& data ) ;
00163
00165 static StatusCode array
00166 ( const Tuples::Tuple& tuple ,
00167 const std::string& name ,
00168 const Gaudi::Vector1& data ) ;
00169
00171 static StatusCode array
00172 ( const Tuples::Tuple& tuple ,
00173 const std::string& name ,
00174 const Gaudi::Vector2& data ) ;
00175
00177 static StatusCode array
00178 ( const Tuples::Tuple& tuple ,
00179 const std::string& name ,
00180 const Gaudi::Vector3& data ) ;
00181
00183 static StatusCode array
00184 ( const Tuples::Tuple& tuple ,
00185 const std::string& name ,
00186 const Gaudi::Vector4& data ) ;
00187
00189 static StatusCode array
00190 ( const Tuples::Tuple& tuple ,
00191 const std::string& name ,
00192 const Gaudi::Vector5& data ) ;
00193
00194 public:
00195
00197 static StatusCode array
00198 ( const Tuples::Tuple& tuple ,
00199 const std::string& name ,
00200 const Gaudi::Vector6& data ) ;
00201
00203 static StatusCode array
00204 ( const Tuples::Tuple& tuple ,
00205 const std::string& name ,
00206 const Gaudi::Vector7& data ) ;
00207
00209 static StatusCode array
00210 ( const Tuples::Tuple& tuple ,
00211 const std::string& name ,
00212 const Gaudi::Vector8& data ) ;
00213
00215 static StatusCode array
00216 ( const Tuples::Tuple& tuple ,
00217 const std::string& name ,
00218 const Gaudi::Vector9& data ) ;
00219
00221 static StatusCode matrix
00222 ( const Tuples::Tuple& tuple ,
00223 const std::string& name ,
00224 const GaudiPython::Matrix& data ,
00225 const Tuples::TupleObj::MIndex cols ) ;
00226
00228 static StatusCode matrix
00229 ( const Tuples::Tuple& tuple ,
00230 const std::string& name ,
00231 const Gaudi::Matrix2x2& value ) ;
00232
00234 static StatusCode matrix
00235 ( const Tuples::Tuple& tuple ,
00236 const std::string& name ,
00237 const Gaudi::Matrix3x3& value ) ;
00238
00240 static StatusCode matrix
00241 ( const Tuples::Tuple& tuple ,
00242 const std::string& name ,
00243 const Gaudi::Matrix4x4& value ) ;
00244
00246 static StatusCode matrix
00247 ( const Tuples::Tuple& tuple ,
00248 const std::string& name ,
00249 const Gaudi::Matrix5x5& value ) ;
00250
00252 static StatusCode matrix
00253 ( const Tuples::Tuple& tuple ,
00254 const std::string& name ,
00255 const Gaudi::Matrix6x6& value ) ;
00256
00258 static StatusCode matrix
00259 ( const Tuples::Tuple& tuple ,
00260 const std::string& name ,
00261 const Gaudi::Matrix7x7& value ) ;
00262
00264 static StatusCode matrix
00265 ( const Tuples::Tuple& tuple ,
00266 const std::string& name ,
00267 const Gaudi::Matrix8x8& value ) ;
00268
00270 static StatusCode matrix
00271 ( const Tuples::Tuple& tuple ,
00272 const std::string& name ,
00273 const Gaudi::Matrix9x9& value ) ;
00274
00276 static StatusCode matrix
00277 ( const Tuples::Tuple& tuple ,
00278 const std::string& name ,
00279 const Gaudi::Matrix1x1& value ) ;
00280
00282 static StatusCode matrix
00283 ( const Tuples::Tuple& tuple ,
00284 const std::string& name ,
00285 const Gaudi::Matrix1x3& value ) ;
00286
00288 static StatusCode matrix
00289 ( const Tuples::Tuple& tuple ,
00290 const std::string& name ,
00291 const Gaudi::Matrix1x5& value ) ;
00292
00294 static StatusCode matrix
00295 ( const Tuples::Tuple& tuple ,
00296 const std::string& name ,
00297 const Gaudi::Matrix1x6& value ) ;
00298
00300 static StatusCode matrix
00301 ( const Tuples::Tuple& tuple ,
00302 const std::string& name ,
00303 const Gaudi::Matrix4x3& value ) ;
00304
00306 static StatusCode matrix
00307 ( const Tuples::Tuple& tuple ,
00308 const std::string& name ,
00309 const Gaudi::Matrix3x4& value ) ;
00310
00312 static StatusCode matrix
00313 ( const Tuples::Tuple& tuple ,
00314 const std::string& name ,
00315 const Gaudi::Matrix3x5& value ) ;
00316
00318 static StatusCode matrix
00319 ( const Tuples::Tuple& tuple ,
00320 const std::string& name ,
00321 const Gaudi::Matrix3x6& value ) ;
00322
00324 static StatusCode matrix
00325 ( const Tuples::Tuple& tuple ,
00326 const std::string& name ,
00327 const Gaudi::Matrix2x3& value ) ;
00328
00330 static StatusCode matrix
00331 ( const Tuples::Tuple& tuple ,
00332 const std::string& name ,
00333 const Gaudi::Matrix3x2& value ) ;
00334
00336 static StatusCode matrix
00337 ( const Tuples::Tuple& tuple ,
00338 const std::string& name ,
00339 const Gaudi::SymMatrix1x1& value ) ;
00340
00342 static StatusCode matrix
00343 ( const Tuples::Tuple& tuple ,
00344 const std::string& name ,
00345 const Gaudi::SymMatrix2x2& value ) ;
00346
00348 static StatusCode matrix
00349 ( const Tuples::Tuple& tuple ,
00350 const std::string& name ,
00351 const Gaudi::SymMatrix3x3& value ) ;
00352
00354 static StatusCode matrix
00355 ( const Tuples::Tuple& tuple ,
00356 const std::string& name ,
00357 const Gaudi::SymMatrix4x4& value ) ;
00358
00360 static StatusCode matrix
00361 ( const Tuples::Tuple& tuple ,
00362 const std::string& name ,
00363 const Gaudi::SymMatrix5x5& value ) ;
00364
00366 static StatusCode matrix
00367 ( const Tuples::Tuple& tuple ,
00368 const std::string& name ,
00369 const Gaudi::SymMatrix6x6& value ) ;
00370
00372 static StatusCode matrix
00373 ( const Tuples::Tuple& tuple ,
00374 const std::string& name ,
00375 const Gaudi::SymMatrix7x7& value ) ;
00376
00378 static StatusCode matrix
00379 ( const Tuples::Tuple& tuple ,
00380 const std::string& name ,
00381 const Gaudi::SymMatrix8x8& value ) ;
00382
00384 static StatusCode matrix
00385 ( const Tuples::Tuple& tuple ,
00386 const std::string& name ,
00387 const Gaudi::SymMatrix9x9& value ) ;
00388
00389 public:
00390
00392 static StatusCode column
00393 ( const Tuples::Tuple& tuple ,
00394 const std::string& name ,
00395 const Gaudi::Time& value ) ;
00397 static StatusCode column
00398 ( const Tuples::Tuple& tuple ,
00399 const Gaudi::Time& value ) ;
00400
00401 public:
00402
00404 static StatusCode array
00405 ( const Tuples::Tuple& tuple ,
00406 const std::string& name ,
00407 const CLHEP::HepVector& data ) ;
00409 static StatusCode farray
00410 ( const Tuples::Tuple& tuple ,
00411 const std::string& name ,
00412 const CLHEP::HepVector& data ,
00413 const std::string& length ,
00414 const size_t maxv ) ;
00416 static StatusCode matrix
00417 ( const Tuples::Tuple& tuple ,
00418 const std::string& name ,
00419 const CLHEP::HepGenMatrix& data ) ;
00421 static StatusCode fmatrix
00422 ( const Tuples::Tuple& tuple ,
00423 const std::string& name ,
00424 const CLHEP::HepGenMatrix& data ,
00425 const Tuples::TupleObj::MIndex cols ,
00426 const std::string& length ,
00427 const size_t maxv ) ;
00428
00429 } ;
00430
00436 class GAUDI_API TupleAlgDecorator
00437 {
00438 public:
00439
00441 static Tuples::Tuple nTuple
00442 ( const GaudiTupleAlg& algo ,
00443 const std::string& title ,
00444 const CLID& clid = CLID_ColumnWiseTuple ) ;
00445
00447 static Tuples::Tuple nTuple
00448 ( const GaudiTupleAlg& algo ,
00449 const GaudiAlg::TupleID& ID ,
00450 const std::string& title ,
00451 const CLID& clid = CLID_ColumnWiseTuple ) ;
00452
00454 static Tuples::Tuple nTuple
00455 ( const GaudiTupleAlg& algo ,
00456 const int ID ,
00457 const std::string& title ,
00458 const CLID& clid = CLID_ColumnWiseTuple ) ;
00459
00461 static Tuples::Tuple nTuple
00462 ( const GaudiTupleAlg& algo ,
00463 const std::string& ID ,
00464 const std::string& title ,
00465 const CLID& clid = CLID_ColumnWiseTuple ) ;
00466
00468 static Tuples::Tuple evtCol
00469 ( const GaudiTupleAlg& algo ,
00470 const std::string& title ,
00471 const CLID& clid = CLID_ColumnWiseTuple ) ;
00472
00474 static Tuples::Tuple evtCol
00475 ( const GaudiTupleAlg& algo ,
00476 const GaudiAlg::TupleID& ID ,
00477 const std::string& title ,
00478 const CLID& clid = CLID_ColumnWiseTuple ) ;
00479
00481 static Tuples::Tuple evtCol
00482 ( const GaudiTupleAlg& algo ,
00483 const int ID ,
00484 const std::string& title ,
00485 const CLID& clid = CLID_ColumnWiseTuple ) ;
00486
00488 static Tuples::Tuple evtCol
00489 ( const GaudiTupleAlg& algo ,
00490 const std::string& ID ,
00491 const std::string& title ,
00492 const CLID& clid = CLID_ColumnWiseTuple ) ;
00493
00494 } ;
00495
00501 class GAUDI_API TupleToolDecorator
00502 {
00503 public:
00504
00506 static Tuples::Tuple nTuple
00507 ( const ITupleTool& tool ,
00508 const std::string& title ,
00509 const CLID& clid = CLID_ColumnWiseTuple )
00510 { return tool.nTuple ( title , clid ) ; }
00511
00513 static Tuples::Tuple nTuple
00514 ( const ITupleTool& tool ,
00515 const GaudiAlg::TupleID& ID ,
00516 const std::string& title ,
00517 const CLID& clid = CLID_ColumnWiseTuple )
00518 { return tool.nTuple ( ID , title , clid ) ; }
00519
00521 static Tuples::Tuple nTuple
00522 ( const ITupleTool& tool ,
00523 const int ID ,
00524 const std::string& title ,
00525 const CLID& clid = CLID_ColumnWiseTuple )
00526 { return tool.nTuple ( ID , title , clid ) ; }
00527
00529 static Tuples::Tuple nTuple
00530 ( const ITupleTool& tool ,
00531 const std::string& ID ,
00532 const std::string& title ,
00533 const CLID& clid = CLID_ColumnWiseTuple )
00534 { return tool.nTuple ( ID , title , clid ) ; }
00535
00537 static Tuples::Tuple evtCol
00538 ( const ITupleTool& tool ,
00539 const std::string& title ,
00540 const CLID& clid = CLID_ColumnWiseTuple )
00541 { return tool.evtCol ( title , clid ) ; }
00542
00544 static Tuples::Tuple evtCol
00545 ( const ITupleTool& tool ,
00546 const GaudiAlg::TupleID& ID ,
00547 const std::string& title ,
00548 const CLID& clid = CLID_ColumnWiseTuple )
00549 { return tool.nTuple ( ID , title , clid ) ; }
00550
00552 static Tuples::Tuple evtCol
00553 ( const ITupleTool& tool ,
00554 const int ID ,
00555 const std::string& title ,
00556 const CLID& clid = CLID_ColumnWiseTuple )
00557 { return tool.nTuple ( ID , title , clid ) ; }
00558
00560 static Tuples::Tuple evtCol
00561 ( const ITupleTool& tool ,
00562 const std::string& ID ,
00563 const std::string& title ,
00564 const CLID& clid = CLID_ColumnWiseTuple )
00565 { return tool.nTuple ( ID , title , clid ) ; }
00566
00567 } ;
00568
00569 }
00570
00571
00572
00573 #endif // GAUDIPYTHON_TUPLEDECORATOR_H
00574