![]() |
|
|
Generated: 8 Jan 2009 |
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 // ============================================================================ 00016 // GaudiAlg 00017 // ============================================================================ 00018 #include "GaudiAlg/TupleID.h" 00019 #include "GaudiAlg/TupleObj.h" 00020 #include "GaudiAlg/Tuple.h" 00021 #include "GaudiAlg/Tuples.h" 00022 #include "GaudiAlg/ITupleTool.h" 00023 #include "GaudiAlg/GaudiTupleAlg.h" 00024 // ============================================================================ 00025 // GaudiPython 00026 // ============================================================================ 00027 #include "GaudiPython/GaudiPython.h" 00028 #include "GaudiPython/Vector.h" 00029 // ============================================================================ 00030 // Forward declarations 00031 // ============================================================================ 00032 namespace CLHEP 00033 { 00034 class HepGenMatrix ; 00035 class HepVector ; 00036 } 00037 // ============================================================================ 00038 namespace GaudiPython 00039 { 00040 // ========================================================================== 00047 class TupleDecorator 00048 { 00049 public: 00050 // ======================================================================== 00052 static INTuple* nTuple ( const Tuples::Tuple& tuple ) ; 00053 // ======================================================================== 00055 static NTuple::Tuple* ntuple ( const Tuples::Tuple& tuple ) ; 00056 // ======================================================================== 00058 static bool valid ( const Tuples::Tuple& tuple ) ; 00059 // ======================================================================== 00061 static StatusCode write ( const Tuples::Tuple& tuple ) ; 00062 // ======================================================================== 00064 static StatusCode column 00065 ( const Tuples::Tuple& tuple , 00066 const std::string& name , 00067 const int value ) ; 00068 // ======================================================================== 00070 static StatusCode column 00071 ( const Tuples::Tuple& tuple , 00072 const std::string& name , 00073 const int value , 00074 const int minv , 00075 const int maxv ) ; 00076 // ======================================================================== 00078 static StatusCode column 00079 ( const Tuples::Tuple& tuple , 00080 const std::string& name , 00081 const double value ) ; 00082 // ======================================================================== 00084 static StatusCode column 00085 ( const Tuples::Tuple& tuple , 00086 const std::string& name , 00087 const bool value ) ; 00088 // ======================================================================== 00090 static StatusCode column 00091 ( const Tuples::Tuple& tuple , 00092 const std::string& name , 00093 IOpaqueAddress* value ) ; 00094 // ======================================================================== 00096 static StatusCode column 00097 ( const Tuples::Tuple& tuple , 00098 IOpaqueAddress* value ) 00099 { return column ( tuple , "Address" , value ) ; } 00100 // ======================================================================== 00102 static StatusCode column 00103 ( const Tuples::Tuple& tuple , 00104 const std::string& name , 00105 const Gaudi::LorentzVector& value ) ; 00106 // ======================================================================== 00108 static StatusCode column 00109 ( const Tuples::Tuple& tuple , 00110 const std::string& name , 00111 const Gaudi::PtEtaPhiEVector& value ) ; 00112 // ======================================================================== 00114 static StatusCode column 00115 ( const Tuples::Tuple& tuple , 00116 const std::string& name , 00117 const Gaudi::XYZVector& value ) ; 00118 // ======================================================================== 00120 static StatusCode column 00121 ( const Tuples::Tuple& tuple , 00122 const std::string& name , 00123 const Gaudi::Polar3DVector& value ) ; 00124 // ======================================================================== 00126 static StatusCode column 00127 ( const Tuples::Tuple& tuple , 00128 const std::string& name , 00129 const Gaudi::RhoEtaPhiVector& value ) ; 00130 // ======================================================================== 00132 static StatusCode column 00133 ( const Tuples::Tuple& tuple , 00134 const std::string& name , 00135 const Gaudi::RhoZPhiVector& value ) ; 00136 // ======================================================================== 00138 static StatusCode column 00139 ( const Tuples::Tuple& tuple , 00140 const std::string& name , 00141 const Gaudi::XYZPoint& value ) ; 00142 // ======================================================================== 00144 static StatusCode column 00145 ( const Tuples::Tuple& tuple , 00146 const std::string& name , 00147 const Gaudi::Polar3DPoint& value ) ; 00148 // ======================================================================== 00150 static StatusCode column 00151 ( const Tuples::Tuple& tuple , 00152 const std::string& name , 00153 const Gaudi::RhoEtaPhiPoint& value ) ; 00154 // ======================================================================== 00156 static StatusCode column 00157 ( const Tuples::Tuple& tuple , 00158 const std::string& name , 00159 const Gaudi::RhoZPhiPoint& value ) ; 00160 // ======================================================================== 00162 static StatusCode farray 00163 ( const Tuples::Tuple& tuple , 00164 const std::string& name , 00165 const std::vector<double>& data , 00166 const std::string& length , 00167 const size_t maxv ) ; 00168 // ======================================================================== 00170 static StatusCode farray 00171 ( const Tuples::Tuple& tuple , 00172 const std::string& name , 00173 const CLHEP::HepVector& data , 00174 const std::string& length , 00175 const size_t maxv ) ; 00176 // ======================================================================== 00178 static StatusCode fmatrix 00179 ( const Tuples::Tuple& tuple , 00180 const std::string& name , 00181 const GaudiPython::Matrix& data , 00182 const Tuples::TupleObj::MIndex cols , // fixed !!! 00183 const std::string& length , 00184 const size_t maxv ) ; 00185 // ======================================================================== 00187 static StatusCode fmatrix 00188 ( const Tuples::Tuple& tuple , 00189 const std::string& name , 00190 const CLHEP::HepGenMatrix& data , 00191 const Tuples::TupleObj::MIndex cols , // fixed !!! 00192 const std::string& length , 00193 const size_t maxv ) ; 00194 // ======================================================================== 00196 static StatusCode fmatrix 00197 ( const Tuples::Tuple& tuple , 00198 const std::string& name , 00199 const GaudiUtils::VectorMap<int,double>& info , 00200 const std::string& length , 00201 const size_t maxv ) ; 00202 // ======================================================================== 00204 static StatusCode array 00205 ( const Tuples::Tuple& tuple , 00206 const std::string& name , 00207 const std::vector<double>& data ) ; 00208 // ======================================================================== 00210 static StatusCode array 00211 ( const Tuples::Tuple& tuple , 00212 const std::string& name , 00213 const CLHEP::HepVector& data ) ; 00214 // ======================================================================== 00216 static StatusCode array 00217 ( const Tuples::Tuple& tuple , 00218 const std::string& name , 00219 const Gaudi::Vector2& data ) ; 00220 // ======================================================================== 00222 static StatusCode array 00223 ( const Tuples::Tuple& tuple , 00224 const std::string& name , 00225 const Gaudi::Vector3& data ) ; 00226 // ======================================================================== 00228 static StatusCode array 00229 ( const Tuples::Tuple& tuple , 00230 const std::string& name , 00231 const Gaudi::Vector4& data ) ; 00232 // ======================================================================== 00234 static StatusCode array 00235 ( const Tuples::Tuple& tuple , 00236 const std::string& name , 00237 const Gaudi::Vector5& data ) ; 00238 // ======================================================================== 00240 static StatusCode array 00241 ( const Tuples::Tuple& tuple , 00242 const std::string& name , 00243 const Gaudi::Vector6& data ) ; 00244 // ======================================================================== 00246 static StatusCode array 00247 ( const Tuples::Tuple& tuple , 00248 const std::string& name , 00249 const Gaudi::Vector7& data ) ; 00250 // ======================================================================== 00252 static StatusCode array 00253 ( const Tuples::Tuple& tuple , 00254 const std::string& name , 00255 const Gaudi::Vector8& data ) ; 00256 // ======================================================================== 00258 static StatusCode array 00259 ( const Tuples::Tuple& tuple , 00260 const std::string& name , 00261 const Gaudi::Vector9& data ) ; 00262 // ======================================================================== 00264 static StatusCode array 00265 ( const Tuples::Tuple& tuple , 00266 const std::string& name , 00267 const Gaudi::Vector1& data ) ; 00268 // ======================================================================== 00270 static StatusCode matrix 00271 ( const Tuples::Tuple& tuple , 00272 const std::string& name , 00273 const GaudiPython::Matrix& data , 00274 const Tuples::TupleObj::MIndex cols ) ; // fixed !!! 00275 // ======================================================================== 00277 static StatusCode matrix 00278 ( const Tuples::Tuple& tuple , 00279 const std::string& name , 00280 const CLHEP::HepGenMatrix& data ) ; 00281 // ======================================================================== 00283 static StatusCode matrix 00284 ( const Tuples::Tuple& tuple , 00285 const std::string& name , 00286 const Gaudi::Matrix2x2& value ) ; 00287 // ======================================================================== 00289 static StatusCode matrix 00290 ( const Tuples::Tuple& tuple , 00291 const std::string& name , 00292 const Gaudi::Matrix3x3& value ) ; 00293 // ======================================================================== 00295 static StatusCode matrix 00296 ( const Tuples::Tuple& tuple , 00297 const std::string& name , 00298 const Gaudi::Matrix4x4& value ) ; 00299 // ======================================================================== 00301 static StatusCode matrix 00302 ( const Tuples::Tuple& tuple , 00303 const std::string& name , 00304 const Gaudi::Matrix5x5& value ) ; 00305 // ======================================================================== 00307 static StatusCode matrix 00308 ( const Tuples::Tuple& tuple , 00309 const std::string& name , 00310 const Gaudi::Matrix6x6& value ) ; 00311 // ======================================================================== 00313 static StatusCode matrix 00314 ( const Tuples::Tuple& tuple , 00315 const std::string& name , 00316 const Gaudi::Matrix7x7& value ) ; 00317 // ======================================================================== 00319 static StatusCode matrix 00320 ( const Tuples::Tuple& tuple , 00321 const std::string& name , 00322 const Gaudi::Matrix8x8& value ) ; 00323 // ======================================================================== 00325 static StatusCode matrix 00326 ( const Tuples::Tuple& tuple , 00327 const std::string& name , 00328 const Gaudi::Matrix9x9& value ) ; 00329 // ======================================================================== 00331 static StatusCode matrix 00332 ( const Tuples::Tuple& tuple , 00333 const std::string& name , 00334 const Gaudi::Matrix1x1& value ) ; 00335 // ======================================================================== 00337 static StatusCode matrix 00338 ( const Tuples::Tuple& tuple , 00339 const std::string& name , 00340 const Gaudi::Matrix1x3& value ) ; 00341 // ======================================================================== 00343 static StatusCode matrix 00344 ( const Tuples::Tuple& tuple , 00345 const std::string& name , 00346 const Gaudi::Matrix1x5& value ) ; 00347 // ======================================================================== 00349 static StatusCode matrix 00350 ( const Tuples::Tuple& tuple , 00351 const std::string& name , 00352 const Gaudi::Matrix1x6& value ) ; 00353 // ======================================================================== 00355 static StatusCode matrix 00356 ( const Tuples::Tuple& tuple , 00357 const std::string& name , 00358 const Gaudi::Matrix4x3& value ) ; 00359 // ======================================================================== 00361 static StatusCode matrix 00362 ( const Tuples::Tuple& tuple , 00363 const std::string& name , 00364 const Gaudi::Matrix3x4& value ) ; 00365 // ======================================================================== 00367 static StatusCode matrix 00368 ( const Tuples::Tuple& tuple , 00369 const std::string& name , 00370 const Gaudi::Matrix3x5& value ) ; 00371 // ======================================================================== 00373 static StatusCode matrix 00374 ( const Tuples::Tuple& tuple , 00375 const std::string& name , 00376 const Gaudi::Matrix3x6& value ) ; 00377 // ======================================================================== 00379 static StatusCode matrix 00380 ( const Tuples::Tuple& tuple , 00381 const std::string& name , 00382 const Gaudi::Matrix2x3& value ) ; 00383 // ======================================================================== 00385 static StatusCode matrix 00386 ( const Tuples::Tuple& tuple , 00387 const std::string& name , 00388 const Gaudi::Matrix3x2& value ) ; 00389 // ======================================================================== 00391 static StatusCode matrix 00392 ( const Tuples::Tuple& tuple , 00393 const std::string& name , 00394 const Gaudi::SymMatrix1x1& value ) ; 00395 // ======================================================================== 00397 static StatusCode matrix 00398 ( const Tuples::Tuple& tuple , 00399 const std::string& name , 00400 const Gaudi::SymMatrix3x3& value ) ; 00401 // ======================================================================== 00403 static StatusCode matrix 00404 ( const Tuples::Tuple& tuple , 00405 const std::string& name , 00406 const Gaudi::SymMatrix4x4& value ) ; 00407 // ======================================================================== 00409 static StatusCode matrix 00410 ( const Tuples::Tuple& tuple , 00411 const std::string& name , 00412 const Gaudi::SymMatrix5x5& value ) ; 00413 // ======================================================================== 00415 static StatusCode matrix 00416 ( const Tuples::Tuple& tuple , 00417 const std::string& name , 00418 const Gaudi::SymMatrix6x6& value ) ; 00419 // ======================================================================== 00421 static StatusCode matrix 00422 ( const Tuples::Tuple& tuple , 00423 const std::string& name , 00424 const Gaudi::SymMatrix7x7& value ) ; 00425 // ======================================================================== 00427 static StatusCode matrix 00428 ( const Tuples::Tuple& tuple , 00429 const std::string& name , 00430 const Gaudi::SymMatrix8x8& value ) ; 00431 // ======================================================================== 00433 static StatusCode matrix 00434 ( const Tuples::Tuple& tuple , 00435 const std::string& name , 00436 const Gaudi::SymMatrix9x9& value ) ; 00437 // ======================================================================== 00439 static StatusCode matrix 00440 ( const Tuples::Tuple& tuple , 00441 const std::string& name , 00442 const Gaudi::SymMatrix2x2& value ) ; 00443 } ; 00444 // ========================================================================== 00450 class TupleAlgDecorator 00451 { 00452 public: 00453 // ======================================================================== 00455 static Tuples::Tuple nTuple 00456 ( const GaudiTupleAlg& algo , 00457 const std::string& title , 00458 const CLID& clid = CLID_ColumnWiseTuple ) ; 00459 // ======================================================================== 00461 static Tuples::Tuple nTuple 00462 ( const GaudiTupleAlg& algo , 00463 const GaudiAlg::TupleID& ID , 00464 const std::string& title , 00465 const CLID& clid = CLID_ColumnWiseTuple ) ; 00466 // ======================================================================== 00468 static Tuples::Tuple nTuple 00469 ( const GaudiTupleAlg& algo , 00470 const int ID , 00471 const std::string& title , 00472 const CLID& clid = CLID_ColumnWiseTuple ) ; 00473 // ======================================================================== 00475 static Tuples::Tuple nTuple 00476 ( const GaudiTupleAlg& algo , 00477 const std::string& ID , 00478 const std::string& title , 00479 const CLID& clid = CLID_ColumnWiseTuple ) ; 00480 // ======================================================================== 00482 static Tuples::Tuple evtCol 00483 ( const GaudiTupleAlg& algo , 00484 const std::string& title , 00485 const CLID& clid = CLID_ColumnWiseTuple ) ; 00486 // ======================================================================== 00488 static Tuples::Tuple evtCol 00489 ( const GaudiTupleAlg& algo , 00490 const GaudiAlg::TupleID& ID , 00491 const std::string& title , 00492 const CLID& clid = CLID_ColumnWiseTuple ) ; 00493 // ======================================================================== 00495 static Tuples::Tuple evtCol 00496 ( const GaudiTupleAlg& algo , 00497 const int ID , 00498 const std::string& title , 00499 const CLID& clid = CLID_ColumnWiseTuple ) ; 00500 // ======================================================================== 00502 static Tuples::Tuple evtCol 00503 ( const GaudiTupleAlg& algo , 00504 const std::string& ID , 00505 const std::string& title , 00506 const CLID& clid = CLID_ColumnWiseTuple ) ; 00507 // ======================================================================== 00508 } ; 00509 // ========================================================================== 00515 class TupleToolDecorator 00516 { 00517 public: 00518 // ======================================================================== 00520 static Tuples::Tuple nTuple 00521 ( const ITupleTool& tool , 00522 const std::string& title , 00523 const CLID& clid = CLID_ColumnWiseTuple ) 00524 { return tool.nTuple ( title , clid ) ; } 00525 // ======================================================================== 00527 static Tuples::Tuple nTuple 00528 ( const ITupleTool& tool , 00529 const GaudiAlg::TupleID& ID , 00530 const std::string& title , 00531 const CLID& clid = CLID_ColumnWiseTuple ) 00532 { return tool.nTuple ( ID , title , clid ) ; } 00533 // ======================================================================== 00535 static Tuples::Tuple nTuple 00536 ( const ITupleTool& tool , 00537 const int ID , 00538 const std::string& title , 00539 const CLID& clid = CLID_ColumnWiseTuple ) 00540 { return tool.nTuple ( ID , title , clid ) ; } 00541 // ======================================================================== 00543 static Tuples::Tuple nTuple 00544 ( const ITupleTool& tool , 00545 const std::string& ID , 00546 const std::string& title , 00547 const CLID& clid = CLID_ColumnWiseTuple ) 00548 { return tool.nTuple ( ID , title , clid ) ; } 00549 // ======================================================================== 00551 static Tuples::Tuple evtCol 00552 ( const ITupleTool& tool , 00553 const std::string& title , 00554 const CLID& clid = CLID_ColumnWiseTuple ) 00555 { return tool.evtCol ( title , clid ) ; } 00556 // ======================================================================== 00558 static Tuples::Tuple evtCol 00559 ( const ITupleTool& tool , 00560 const GaudiAlg::TupleID& ID , 00561 const std::string& title , 00562 const CLID& clid = CLID_ColumnWiseTuple ) 00563 { return tool.nTuple ( ID , title , clid ) ; } 00564 // ======================================================================== 00566 static Tuples::Tuple evtCol 00567 ( const ITupleTool& tool , 00568 const int ID , 00569 const std::string& title , 00570 const CLID& clid = CLID_ColumnWiseTuple ) 00571 { return tool.nTuple ( ID , title , clid ) ; } 00572 // ======================================================================== 00574 static Tuples::Tuple evtCol 00575 ( const ITupleTool& tool , 00576 const std::string& ID , 00577 const std::string& title , 00578 const CLID& clid = CLID_ColumnWiseTuple ) 00579 { return tool.nTuple ( ID , title , clid ) ; } 00580 // ======================================================================== 00581 } ; 00582 // ========================================================================== 00583 } // end of namespace GaudiPython 00584 // ============================================================================ 00585 // The END 00586 // ============================================================================ 00587 #endif // GAUDIPYTHON_TUPLEDECORATOR_H 00588 // ============================================================================