示例#1
0
// ============================================================================
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 ) ;
}
示例#2
0
// ============================================================================
// 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() ) ;
}
示例#3
0
// ============================================================================
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 ) ;
}
示例#4
0
// ============================================================================
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() ) ;
}
示例#5
0
// ============================================================================
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 ) ;
}
示例#6
0
// ============================================================================
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 ) ;
}
示例#7
0
// ============================================================================
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 ) ;
}
示例#8
0
// ============================================================================
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 ) ;
}
示例#9
0
// ============================================================================
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 ) ;
}
示例#10
0
// ============================================================================
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() ) ;
}
示例#11
0
// ============================================================================
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 ) ;
}
示例#12
0
// ============================================================================
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  ) ;
}
示例#13
0
// ============================================================================
// 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 ;
}
示例#14
0
// ============================================================================
StatusCode  GaudiPython::TupleDecorator::write
( const Tuples::Tuple& tuple )
{
  if ( !tuple.valid() ) { return StatusCode::FAILURE ; }
  return tuple->write();
}
示例#15
0
// ============================================================================
bool        GaudiPython::TupleDecorator::valid
( const Tuples::Tuple& tuple ) { return tuple.valid() ; }