4 #pragma warning(disable:1572) 11 #include "CLHEP/Matrix/GenMatrix.h" 12 #include "CLHEP/Matrix/Matrix.h" 13 #include "CLHEP/Matrix/Vector.h" 16 using namespace CLHEP;
21 double*
begin(CLHEP::HepVector& v) {
return &v[0]; }
22 const double*
begin(
const CLHEP::HepVector& v) {
return &v[0]; }
58 if ( !tuple.
valid() ) {
return 0 ; }
59 return tuple->
tuple() ;
65 if ( !tuple.
valid() ) {
return 0 ; }
66 return tuple->
tuple() ;
76 return tuple->
write();
83 {
return _fill ( tuple , name , value ) ; }
93 return tuple ->
column ( name , value , minv , maxv ) ;
100 {
return _fill ( tuple , name , value ) ; }
105 const long long value )
106 {
return _fill ( tuple , name , value ) ; }
111 const unsigned long long value )
112 {
return _fill ( tuple , name , value ) ; }
118 {
return _fill ( tuple , name , value ) ; }
126 return tuple->
column( name , value ) ;
132 {
return column ( tuple ,
"Address" , value ) ; }
138 {
return _fill ( tuple , name , value ) ; }
144 {
return _fill ( tuple , name , value ) ; }
150 {
return _fill ( tuple , name , value ) ; }
160 return tuple->
farray( name , data.
begin() , data.
end() , length , maxv ) ;
172 if ( !data.
empty() && cols != data.
front().size() )
174 Error (
"GP:fmatrix(1): mismatch in matrix dimensions!" ) ; }
175 return tuple->
fmatrix( name , data , data.
size() , cols , length , maxv ) ;
186 return tuple->
fmatrix ( name , info , length , maxv ) ;
204 return tuple->
array( name , data ) ;
213 return tuple->
array( name , data ) ;
222 return tuple->
array( name , data.
begin() , data.begin() + 3 ) ;
232 return tuple->
array( name , data.
begin() , data.begin()+4 ) ;
241 return tuple->
array( name , data ) ;
250 return tuple->
array( name , data ) ;
259 return tuple->
array( name , data ) ;
268 return tuple->
array( name , data ) ;
277 return tuple->
array( name , data ) ;
289 Warning (
"GP:matrix(1): empty fixed matrix, skip matrix " ) ; }
290 if ( cols != data.
front().size() )
292 Error (
"GP:matrix(1): mismatch in fixed matrix dimensions!" ) ; }
293 return tuple ->
matrix ( name , data , data.
size() , cols ) ;
302 return tuple->
matrix ( name , data ) ;
311 return tuple->
matrix ( name , data ) ;
320 return tuple->
matrix ( name , data ) ;
329 return tuple->
matrix ( name , data ) ;
338 return tuple->
matrix ( name , data ) ;
347 return tuple->
matrix ( name , data ) ;
356 return tuple->
matrix ( name , data ) ;
365 return tuple->
matrix ( name , data ) ;
374 return tuple->
matrix ( name , data ) ;
383 return tuple->
matrix ( name , data ) ;
392 return tuple->
matrix ( name , data ) ;
401 return tuple->
matrix ( name , data ) ;
410 return tuple->
matrix ( name , data ) ;
419 return tuple->
matrix ( name , data ) ;
428 return tuple->
matrix ( name , data ) ;
437 return tuple->
matrix ( name , data ) ;
446 return tuple->
matrix ( name , data ) ;
455 return tuple->
matrix ( name , data ) ;
464 return tuple->
matrix ( name , data ) ;
473 return tuple->
matrix ( name , data ) ;
482 return tuple->
matrix ( name , data ) ;
491 return tuple->
matrix ( name , data ) ;
500 return tuple->
matrix ( name , data ) ;
509 return tuple->
matrix ( name , data ) ;
518 return tuple->
matrix ( name , data ) ;
527 return tuple->
matrix ( name , data ) ;
536 return tuple->
matrix ( name , data ) ;
544 {
return column ( tuple ,
"" , value ) ; }
556 sc = tuple->
column ( name +
"year" , value.
year (
true ) , 1970 , 2070 ) ;
558 sc = tuple->
column ( name +
"month" , value.
month (
true ) + 1 , 1 , 16 ) ;
560 sc = tuple->
column ( name +
"day" , value.
day (
true ) , 0 , 32 ) ;
562 sc = tuple->
column ( name +
"hour" , value.
hour (
true ) , 0 , 25 ) ;
564 sc = tuple->
column ( name +
"minute" , value.
minute (
true ) , 0 , 61 ) ;
566 sc = tuple->
column ( name +
"second" , value.
second (
true ) , 0 , 61 ) ;
581 const CLHEP::HepVector& data )
584 return tuple->
array( name , data , data.num_row() ) ;
590 const CLHEP::HepVector& data ,
596 const double*
begin = &(data[0]);
597 const double*
end = begin + data.num_row() ;
598 return tuple->
farray ( name , begin , end , length , maxv ) ;
604 const CLHEP::HepGenMatrix& data )
607 if ( 1 > data.num_col() )
609 Error (
"GP:matrix(2): illegal fixed matrix num_col" ) ; }
610 if ( 1 > data.num_row() )
612 Error (
"GP:matrix(2): illegal fixed matrix num_row" ) ; }
613 return tuple->
matrix( name , data , data.num_row() , data.num_col() ) ;
619 const CLHEP::HepGenMatrix& data ,
625 if ( cols != data.num_col() )
627 Error (
"GP:fmatrix(2): mismatch in matrix dimensions!" ) ; }
628 return tuple->
fmatrix( name , data , data.num_row() , cols , length , maxv ) ;
643 return algo.
nTuple ( title , clid ) ;
652 return algo.
nTuple ( ID , title , clid ) ;
661 return algo.
nTuple ( ID , title , clid ) ;
670 return algo.
nTuple ( ID , title , clid ) ;
678 return algo.
evtCol ( title , clid ) ;
687 return algo.
evtCol ( ID , title , clid ) ;
696 return algo.
evtCol ( ID , title , clid ) ;
705 return algo.
evtCol ( ID , title , clid ) ;
ROOT::Math::SMatrix< double, 8, 8 > Matrix8x8
Generic 8x8 matrix (double)
static StatusCode fmatrix(const Tuples::Tuple &tuple, const std::string &name, const GaudiPython::Matrix &data, const Tuples::TupleObj::MIndex cols, const std::string &length, const size_t maxv)
Advanced columns: floating-size matrices.
int hour(bool local) const
Get the hour, numbered [0, 23].
ROOT::Math::SMatrix< double, 4, 4 > Matrix4x4
Generic 4x4 matrix (double)
A bit modified version of 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandr...
ROOT::Math::SMatrix< double, 8, 8, ROOT::Math::MatRepSym< double, 8 > > SymMatrix8x8
Symmetrix 8x8 matrix (double)
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
StatusCode matrix(const std::string &name, const MATRIX &data, const MIndex &rows, const MIndex &cols)
fill N-Tuple with fixed-size matrix
ROOT::Math::SMatrix< double, 3, 5 > Matrix3x5
Generic 3x5 matrix (double)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > SymMatrix5x5
Symmetrix 5x5 matrix (double)
static INTuple * nTuple(const Tuples::Tuple &tuple)
accessors to internal
int day(bool local) const
Get the day of month, numbered [1,31].
ROOT::Math::SVector< double, 7 > Vector7
7D Vector (double)
Simple class to extend the functionality of class GaudiHistoAlg.
Header file for class TupleObj.
int month(bool local) const
Get the month, numbered [0,11].
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > SymMatrix3x3
Symmetrix 3x3 matrix (double)
static bool valid(const Tuples::Tuple &tuple)
status of the tuple
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
static StatusCode column_ll(const Tuples::Tuple &tuple, const std::string &name, const long long value)
more or less simple columns: long long
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SymMatrix2x2
Symmetrix 2x2 matrix (double)
static StatusCode farray(const Tuples::Tuple &tuple, const std::string &name, const std::vector< double > &data, const std::string &length, const size_t maxv)
Advanced columns: floating-size arrays.
static StatusCode matrix(const Tuples::Tuple &tuple, const std::string &name, const GaudiPython::Matrix &data, const Tuples::TupleObj::MIndex cols)
Advanced columns: fixed size matrices.
ROOT::Math::SMatrix< double, 9, 9 > Matrix9x9
Generic 9x9 matrix (double)
Tuple evtCol(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an Event Tag Collection object (book on-demand) with unique identifier.
ROOT::Math::SVector< double, 3 > Vector3
3D Vector (double)
ROOT::Math::SMatrix< double, 3, 3 > Matrix3x3
Generic 3x3 matrix (double)
StatusCode fmatrix(const std::string &name, const MATRIX &data, size_t rows, const MIndex &cols, const std::string &length, size_t maxv)
Fill N-Tuple with data from variable-size matrix.
ROOT::Math::SMatrix< double, 3, 2 > Matrix3x2
Generic 3x2 matrix (double)
ROOT::Math::SVector< double, 9 > Vector9
9D Vector (double)
int second(bool local) const
Get the seconds, numbered [0,61] (allowing one or two leap seconds, years with leap seconds can have ...
ROOT::Math::SVector< double, 2 > Vector2
2D Vector (double)
bool isFailure() const
Test for a status code of FAILURE.
StatusCode farray(const std::string &name, ITERATOR1 &&first, ITERATOR2 &&last, const std::string &length, size_t maxv)
Add an indexed array (of type float) to N-tuple.
ROOT::Math::SVector< double, 8 > Vector8
8D Vector (double)
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > SymMatrix7x7
Symmetrix 7x7 matrix (double)
ROOT::Math::SMatrix< double, 1, 1 > Matrix1x1
Generic 1x1 matrix (double)
NTuple interface class definition.
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
ROOT::Math::SMatrix< double, 3, 6 > Matrix3x6
Generic 3x6 matrix (double)
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > SymMatrix1x1
Symmetrix 1x1 matrix (double)
ROOT::Math::SMatrix< double, 4, 3 > Matrix4x3
Generic 4x3 matrix (double)
ROOT::Math::SMatrix< double, 2, 3 > Matrix2x3
Generic 2x3 matrix (double)
ROOT::Math::SMatrix< double, 1, 6 > Matrix1x6
Generic 1x6 matrix (double)
ROOT::Math::SMatrix< double, 6, 6 > Matrix6x6
Generic 6x6 matrix (double)
static StatusCode column(const Tuples::Tuple &tuple, const std::string &name, const int value)
more or less simple columns: long
static Tuples::Tuple nTuple(const GaudiTupleAlg &algo, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
This class is used for returning status codes from appropriate routines.
static NTuple::Tuple * ntuple(const Tuples::Tuple &tuple)
accessors to internal
ROOT::Math::SMatrix< double, 5, 5 > Matrix5x5
Generic 5x5 matrix (double)
Tuple nTuple(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an N-Tuple object (book on-demand) with unique identifier.
bool valid() const
check the validity of the tuple object
ROOT::Math::SMatrix< double, 7, 7 > Matrix7x7
Generic 7x7 matrix (double)
StatusCode write()
write a record to NTuple
auto end(reverse_wrapper< T > &w)
unsigned int CLID
Class ID definition.
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > SymMatrix6x6
Symmetrix 6x6 matrix (double)
ROOT::Math::SVector< double, 6 > Vector6
6D Vector (double)
Abstract base class which allows the user to interact with the actual N tuple implementation.
ROOT::Math::SMatrix< double, 1, 5 > Matrix1x5
Generic 1x5 matrix (double)
ROOT::Math::SMatrix< double, 2, 2 > Matrix2x2
Generic 2x2 matrix (double)
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
static StatusCode column_ull(const Tuples::Tuple &tuple, const std::string &name, const unsigned long long value)
more or less simple columns: unsigned long long
static StatusCode write(const Tuples::Tuple &tuple)
commit the row
ROOT::Math::SVector< double, 4 > Vector4
4D Vector (double)
static Tuples::Tuple evtCol(const GaudiTupleAlg &algo, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple)
get n-tuple (book-on-demand)
ROOT::Math::SMatrix< double, 1, 3 > Matrix1x3
Generic 1x3 matrix (double)
ROOT::Math::SMatrix< double, 9, 9, ROOT::Math::MatRepSym< double, 9 > > SymMatrix9x9
Symmetrix 9x9 matrix (double)
ROOT::Math::PxPyPzEVector LorentzVector
Cartesian 4 Vector.
int nsecond(void) const
Get the nanoseconds.
ROOT::Math::SMatrix< double, 3, 4 > Matrix3x4
Generic 3x4 matrix (double)
Opaque address interface definition.
int year(bool local) const
Get the year.
static StatusCode array(const Tuples::Tuple &tuple, const std::string &name, const std::vector< double > &data)
Advanced columns: fixed size arrays.
double * begin(CLHEP::HepVector &v)
ROOT::Math::SVector< double, 5 > Vector5
5D Vector (double)
ID class for Histogram and Ntuples.
Header file for class : Tuple.
ROOT::Math::SVector< double, 1 > Vector1
1D Vector (double)
int minute(bool local) const
Get the minute, numbered [0, 59].
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SymMatrix4x4
Symmetrix 4x4 matrix (double)