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]; }
28 #include "GaudiAlg/TupleObj.h"
29 #include "GaudiAlg/Tuple.h"
33 #include "GaudiPython/Vector.h"
34 #include "GaudiPython/TupleDecorator.h"
47 const std::string&
name ,
58 if ( !tuple.
valid() ) {
return 0 ; }
59 return tuple->
tuple() ;
65 if ( !tuple.
valid() ) {
return 0 ; }
66 return tuple->
tuple() ;
76 return tuple->
write();
81 const std::string& name ,
83 {
return _fill ( tuple , name , value ) ; }
87 const std::string& name ,
93 return tuple -> column ( name , value , minv , maxv ) ;
98 const std::string& name ,
100 {
return _fill ( tuple , name , value ) ; }
104 const std::string& name ,
105 const long long value )
106 {
return _fill ( tuple , name , value ) ; }
110 const std::string& name ,
111 const unsigned long long value )
112 {
return _fill ( tuple , name , value ) ; }
116 const std::string& name ,
118 {
return _fill ( tuple , name , value ) ; }
122 const std::string& name ,
126 return tuple->
column( name , value ) ;
132 {
return column ( tuple ,
"Address" , value ) ; }
136 const std::string& name ,
138 {
return _fill ( tuple , name , value ) ; }
142 const std::string& name ,
144 {
return _fill ( tuple , name , value ) ; }
148 const std::string& name ,
150 {
return _fill ( tuple , name , value ) ; }
154 const std::string& name ,
155 const std::vector<double>& data ,
156 const std::string& length ,
160 return tuple->
farray( name , data.begin() , data.end() , length , maxv ) ;
165 const std::string& name ,
168 const std::string& length ,
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 ) ;
180 const std::string& name ,
182 const std::string& length ,
186 return tuple->
fmatrix ( name , info , length , maxv ) ;
191 const std::string& name ,
192 const std::vector<double>& data )
195 return tuple->
array ( name , data.begin() , data.end() ) ;
200 const std::string& name ,
204 return tuple->
array( name , data ) ;
209 const std::string& name ,
213 return tuple->
array( name , data ) ;
218 const std::string& name ,
222 return tuple->
array( name , data.begin() , data.begin() + 3 ) ;
227 const std::string& name ,
232 return tuple->
array( name , data.begin() , data.begin()+4 ) ;
237 const std::string& name ,
241 return tuple->
array( name , data ) ;
246 const std::string& name ,
250 return tuple->
array( name , data ) ;
255 const std::string& name ,
259 return tuple->
array( name , data ) ;
264 const std::string& name ,
268 return tuple->
array( name , data ) ;
273 const std::string& name ,
277 return tuple->
array( name , data ) ;
282 const std::string& name ,
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 ) ;
298 const std::string& name ,
302 return tuple->
matrix ( name , data ) ;
307 const std::string& name ,
311 return tuple->
matrix ( name , data ) ;
316 const std::string& name ,
320 return tuple->
matrix ( name , data ) ;
325 const std::string& name ,
329 return tuple->
matrix ( name , data ) ;
334 const std::string& name ,
338 return tuple->
matrix ( name , data ) ;
343 const std::string& name ,
347 return tuple->
matrix ( name , data ) ;
352 const std::string& name ,
356 return tuple->
matrix ( name , data ) ;
361 const std::string& name ,
365 return tuple->
matrix ( name , data ) ;
370 const std::string& name ,
374 return tuple->
matrix ( name , data ) ;
379 const std::string& name ,
383 return tuple->
matrix ( name , data ) ;
388 const std::string& name ,
392 return tuple->
matrix ( name , data ) ;
397 const std::string& name ,
401 return tuple->
matrix ( name , data ) ;
406 const std::string& name ,
410 return tuple->
matrix ( name , data ) ;
415 const std::string& name ,
419 return tuple->
matrix ( name , data ) ;
424 const std::string& name ,
428 return tuple->
matrix ( name , data ) ;
433 const std::string& name ,
437 return tuple->
matrix ( name , data ) ;
442 const std::string& name ,
446 return tuple->
matrix ( name , data ) ;
451 const std::string& name ,
455 return tuple->
matrix ( name , data ) ;
460 const std::string& name ,
464 return tuple->
matrix ( name , data ) ;
469 const std::string& name ,
473 return tuple->
matrix ( name , data ) ;
478 const std::string& name ,
482 return tuple->
matrix ( name , data ) ;
487 const std::string& name ,
491 return tuple->
matrix ( name , data ) ;
496 const std::string& name ,
500 return tuple->
matrix ( name , data ) ;
505 const std::string& name ,
509 return tuple->
matrix ( name , data ) ;
514 const std::string& name ,
518 return tuple->
matrix ( name , data ) ;
523 const std::string& name ,
527 return tuple->
matrix ( name , data ) ;
532 const std::string& name ,
536 return tuple->
matrix ( name , data ) ;
544 {
return column ( tuple ,
"" , value ) ; }
550 const std::string& name ,
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 ) ;
580 const std::string& name ,
581 const CLHEP::HepVector& data )
584 return tuple->
array( name , data , data.num_row() ) ;
589 const std::string& name ,
590 const CLHEP::HepVector& data ,
591 const std::string& length ,
596 const double*
begin = &(data[0]);
597 const double*
end = begin + data.num_row() ;
598 return tuple->
farray ( name , begin , end , length , maxv ) ;
603 const std::string& name ,
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() ) ;
618 const std::string& name ,
619 const CLHEP::HepGenMatrix& data ,
621 const std::string& length ,
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 ) ;
640 const std::string& title ,
643 return algo.
nTuple ( title , clid ) ;
649 const std::string& title ,
652 return algo.
nTuple ( ID , title , clid ) ;
658 const std::string& title ,
661 return algo.
nTuple ( ID , title , clid ) ;
666 const std::string& ID ,
667 const std::string& title ,
670 return algo.
nTuple ( ID , title , clid ) ;
675 const std::string& title ,
678 return algo.
evtCol ( title , clid ) ;
684 const std::string& title ,
687 return algo.
evtCol ( ID , title , clid ) ;
693 const std::string& title ,
696 return algo.
evtCol ( ID , title , clid ) ;
701 const std::string& ID ,
702 const std::string& title ,
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)
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)
std::vector< Row > Matrix
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)
auto end(reverse_wrapper< T > &w)
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
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.
unsigned int CLID
Class ID definition.
Simple class to extend the functionality of class GaudiHistoAlg.
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.
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)