// ============================================================================ StatusCode GaudiPython::TupleDecorator::array ( const Tuples::Tuple& tuple , const std::string& name , const Gaudi::Vector9& data ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple->array( name , data ) ; }
// ============================================================================ // Legacy: // ============================================================================ StatusCode GaudiPython::TupleDecorator::array ( const Tuples::Tuple& tuple , const std::string& name , const CLHEP::HepVector& data ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple->array( name , data , data.num_row() ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::matrix ( const Tuples::Tuple& tuple , const std::string& name , const Gaudi::SymMatrix9x9& data ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple->matrix ( name , data ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::array ( const Tuples::Tuple& tuple , const std::string& name , const std::vector<double>& data ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple->array ( name , data.begin() , data.end() ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::column ( const Tuples::Tuple& tuple , const std::string& name , IOpaqueAddress* value ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple->column( name , value ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::column ( const Tuples::Tuple& tuple , const std::string& name , const int value , const int minv , const int maxv ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple -> column ( name , value , minv , maxv ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::fmatrix ( const Tuples::Tuple& tuple , const std::string& name , const GaudiUtils::VectorMap<int,double>& info , const std::string& length , const size_t maxv ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple->fmatrix ( name , info , length , maxv ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::farray ( const Tuples::Tuple& tuple , const std::string& name , const CLHEP::HepVector& data , const std::string& length , const size_t maxv ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } // use the trick! const double* begin = &(data[0]); const double* end = begin + data.num_row() ; return tuple->farray ( name , begin , end , length , maxv ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::fmatrix ( const Tuples::Tuple& tuple , const std::string& name , const CLHEP::HepGenMatrix& data , const Tuples::TupleObj::MIndex cols , // fixed !!! const std::string& length , const size_t maxv ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } if ( cols != data.num_col() ) { return tuple -> Error ("GP:fmatrix(2): mismatch in matrix dimensions!" ) ; } return tuple->fmatrix( name , data , data.num_row() , cols , length , maxv ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::matrix ( const Tuples::Tuple& tuple , const std::string& name , const CLHEP::HepGenMatrix& data ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } if ( 1 > data.num_col() ) { return tuple -> Error ("GP:matrix(2): illegal fixed matrix num_col" ) ; } if ( 1 > data.num_row() ) { return tuple -> Error ("GP:matrix(2): illegal fixed matrix num_row" ) ; } return tuple->matrix( name , data , data.num_row() , data.num_col() ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::fmatrix ( const Tuples::Tuple& tuple , const std::string& name , const GaudiPython::Matrix& data , const Tuples::TupleObj::MIndex cols , // fixed !!! const std::string& length , const size_t maxv ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } if ( !data.empty() && cols != data.front().size() ) { return tuple -> Error ("GP:fmatrix(1): mismatch in matrix dimensions!" ) ; } return tuple->fmatrix( name , data , data.size() , cols , length , maxv ) ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::matrix ( const Tuples::Tuple& tuple , const std::string& name , const GaudiPython::Matrix& data , const Tuples::TupleObj::MIndex cols ) // fixed !!! { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } if ( data.empty() ) { return tuple -> Warning ("GP:matrix(1): empty fixed matrix, skip matrix " ) ; } if ( cols != data.front().size() ) { return tuple -> Error ("GP:matrix(1): mismatch in fixed matrix dimensions!" ) ; } return tuple -> matrix ( name , data , data.size() , cols ) ; }
// ============================================================================ // advanced column: time // ============================================================================ StatusCode GaudiPython::TupleDecorator::column ( const Tuples::Tuple& tuple , const std::string& name , const Gaudi::Time& value ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } StatusCode sc = StatusCode::SUCCESS ; // sc = tuple->column ( name + "year" , value.year ( true ) , 1970 , 2070 ) ; if ( sc.isFailure() ) { return sc ; } sc = tuple->column ( name + "month" , value.month ( true ) + 1 , 1 , 16 ) ; if ( sc.isFailure() ) { return sc ; } sc = tuple->column ( name + "day" , value.day ( true ) , 0 , 32 ) ; if ( sc.isFailure() ) { return sc ; } sc = tuple->column ( name + "hour" , value.hour ( true ) , 0 , 25 ) ; if ( sc.isFailure() ) { return sc ; } sc = tuple->column ( name + "minute" , value.minute ( true ) , 0 , 61 ) ; if ( sc.isFailure() ) { return sc ; } sc = tuple->column ( name + "second" , value.second ( true ) , 0 , 61 ) ; if ( sc.isFailure() ) { return sc ; } sc = tuple->column ( name + "nsecond" , value.nsecond () ) ; // return sc ; }
// ============================================================================ StatusCode GaudiPython::TupleDecorator::write ( const Tuples::Tuple& tuple ) { if ( !tuple.valid() ) { return StatusCode::FAILURE ; } return tuple->write(); }
// ============================================================================ bool GaudiPython::TupleDecorator::valid ( const Tuples::Tuple& tuple ) { return tuple.valid() ; }