4 #pragma warning( disable : 1572 ) 11 #include "CLHEP/Matrix/GenMatrix.h" 12 #include "CLHEP/Matrix/Matrix.h" 13 #include "CLHEP/Matrix/Vector.h" 18 using namespace CLHEP;
25 double*
begin( CLHEP::HepVector& v ) {
return &v[0]; }
26 const double*
begin(
const CLHEP::HepVector& v ) {
return &v[0]; }
59 if ( !tuple.
valid() ) {
62 return tuple->
tuple();
67 if ( !tuple.
valid() ) {
70 return tuple->
tuple();
77 if ( !tuple.
valid() ) {
80 return tuple->
write();
85 return _fill( tuple, name, value );
89 const int minv,
const int maxv )
91 if ( !tuple.
valid() ) {
94 return tuple->
column( name, value, minv, maxv );
100 return _fill( tuple, name, value );
104 const long long value )
106 return _fill( tuple, name, value );
110 const unsigned long long value )
112 return _fill( tuple, name, value );
117 return _fill( tuple, name, value );
123 if ( !tuple.
valid() ) {
126 return tuple->
column( name, value );
131 return column( tuple,
"Address", value );
137 return _fill( tuple, name, value );
143 return _fill( tuple, name, value );
149 return _fill( tuple, name, value );
156 if ( !tuple.
valid() ) {
159 return tuple->
farray( name, data.
begin(), data.
end(), length, maxv );
167 if ( !tuple.
valid() ) {
170 if ( !data.
empty() && cols != data.
front().size() ) {
171 return tuple->
Error(
"GP:fmatrix(1): mismatch in matrix dimensions!" );
173 return tuple->
fmatrix( name, data, data.
size(), cols, length, maxv );
180 if ( !tuple.
valid() ) {
183 return tuple->
fmatrix( name, info, length, maxv );
189 if ( !tuple.
valid() ) {
198 if ( !tuple.
valid() ) {
201 return tuple->
array( name, data );
207 if ( !tuple.
valid() ) {
210 return tuple->
array( name, data );
216 if ( !tuple.
valid() ) {
219 return tuple->
array( name, data.
begin(), data.begin() + 3 );
225 if ( !tuple.
valid() ) {
229 return tuple->
array( name, data.
begin(), data.begin() + 4 );
235 if ( !tuple.
valid() ) {
238 return tuple->
array( name, data );
244 if ( !tuple.
valid() ) {
247 return tuple->
array( name, data );
253 if ( !tuple.
valid() ) {
256 return tuple->
array( name, data );
262 if ( !tuple.
valid() ) {
265 return tuple->
array( name, data );
271 if ( !tuple.
valid() ) {
274 return tuple->
array( name, data );
281 if ( !tuple.
valid() ) {
284 if ( data.
empty() ) {
285 return tuple->
Warning(
"GP:matrix(1): empty fixed matrix, skip matrix " );
287 if ( cols != data.
front().size() ) {
288 return tuple->
Error(
"GP:matrix(1): mismatch in fixed matrix dimensions!" );
290 return tuple->
matrix( name, data, data.
size(), cols );
296 if ( !tuple.
valid() ) {
299 return tuple->
matrix( name, data );
305 if ( !tuple.
valid() ) {
308 return tuple->
matrix( name, data );
314 if ( !tuple.
valid() ) {
317 return tuple->
matrix( name, data );
323 if ( !tuple.
valid() ) {
326 return tuple->
matrix( name, data );
332 if ( !tuple.
valid() ) {
335 return tuple->
matrix( name, data );
341 if ( !tuple.
valid() ) {
344 return tuple->
matrix( name, data );
350 if ( !tuple.
valid() ) {
353 return tuple->
matrix( name, data );
359 if ( !tuple.
valid() ) {
362 return tuple->
matrix( name, data );
368 if ( !tuple.
valid() ) {
371 return tuple->
matrix( name, data );
377 if ( !tuple.
valid() ) {
380 return tuple->
matrix( name, data );
386 if ( !tuple.
valid() ) {
389 return tuple->
matrix( name, data );
395 if ( !tuple.
valid() ) {
398 return tuple->
matrix( name, data );
404 if ( !tuple.
valid() ) {
407 return tuple->
matrix( name, data );
413 if ( !tuple.
valid() ) {
416 return tuple->
matrix( name, data );
422 if ( !tuple.
valid() ) {
425 return tuple->
matrix( name, data );
431 if ( !tuple.
valid() ) {
434 return tuple->
matrix( name, data );
440 if ( !tuple.
valid() ) {
443 return tuple->
matrix( name, data );
449 if ( !tuple.
valid() ) {
452 return tuple->
matrix( name, data );
458 if ( !tuple.
valid() ) {
461 return tuple->
matrix( name, data );
467 if ( !tuple.
valid() ) {
470 return tuple->
matrix( name, data );
476 if ( !tuple.
valid() ) {
479 return tuple->
matrix( name, data );
485 if ( !tuple.
valid() ) {
488 return tuple->
matrix( name, data );
494 if ( !tuple.
valid() ) {
497 return tuple->
matrix( name, data );
503 if ( !tuple.
valid() ) {
506 return tuple->
matrix( name, data );
512 if ( !tuple.
valid() ) {
515 return tuple->
matrix( name, data );
521 if ( !tuple.
valid() ) {
524 return tuple->
matrix( name, data );
530 if ( !tuple.
valid() ) {
533 return tuple->
matrix( name, data );
540 return column( tuple,
"", value );
548 if ( !tuple.
valid() ) {
553 sc = tuple->
column( name +
"year", value.
year(
true ), 1970, 2070 );
557 sc = tuple->
column( name +
"month", value.
month(
true ) + 1, 1, 16 );
561 sc = tuple->
column( name +
"day", value.
day(
true ), 0, 32 );
565 sc = tuple->
column( name +
"hour", value.
hour(
true ), 0, 25 );
569 sc = tuple->
column( name +
"minute", value.
minute(
true ), 0, 61 );
573 sc = tuple->
column( name +
"second", value.
second(
true ), 0, 61 );
587 const CLHEP::HepVector& data )
589 if ( !tuple.
valid() ) {
592 return tuple->
array( name, data, data.num_row() );
596 const CLHEP::HepVector& data,
const std::string& length,
599 if ( !tuple.
valid() ) {
603 const double*
begin = &( data[0] );
604 const double*
end = begin + data.num_row();
605 return tuple->
farray( name, begin, end, length, maxv );
609 const CLHEP::HepGenMatrix& data )
611 if ( !tuple.
valid() ) {
614 if ( 1 > data.num_col() ) {
615 return tuple->
Error(
"GP:matrix(2): illegal fixed matrix num_col" );
617 if ( 1 > data.num_row() ) {
618 return tuple->
Error(
"GP:matrix(2): illegal fixed matrix num_row" );
620 return tuple->
matrix( name, data, data.num_row(), data.num_col() );
624 const CLHEP::HepGenMatrix& data,
628 if ( !tuple.
valid() ) {
631 if ( cols != data.num_col() ) {
632 return tuple->
Error(
"GP:fmatrix(2): mismatch in matrix dimensions!" );
634 return tuple->
fmatrix( name, data, data.num_row(), cols, length, maxv );
644 return algo.
nTuple( title, clid );
650 return algo.
nTuple( ID, title, clid );
656 return algo.
nTuple( ID, title, clid );
662 return algo.
nTuple( ID, title, clid );
668 return algo.
evtCol( title, clid );
674 return algo.
evtCol( ID, title, clid );
680 return algo.
evtCol( ID, title, clid );
686 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)
constexpr static const auto FAILURE
A bit modified version of 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandr...
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > SymMatrix1x1
Symmetrix 1x1 matrix (double)
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)
static INTuple * nTuple(const Tuples::Tuple &tuple)
accessors to internal
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > SymMatrix5x5
Symmetrix 5x5 matrix (double)
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
ROOT::Math::SMatrix< double, 9, 9, ROOT::Math::MatRepSym< double, 9 > > SymMatrix9x9
Symmetrix 9x9 matrix (double)
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
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::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > SymMatrix7x7
Symmetrix 7x7 matrix (double)
ROOT::Math::SVector< double, 2 > Vector2
2D Vector (double)
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SymMatrix4x4
Symmetrix 4x4 matrix (double)
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::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > SymMatrix6x6
Symmetrix 6x6 matrix (double)
ROOT::Math::SVector< double, 8 > Vector8
8D Vector (double)
ROOT::Math::SMatrix< double, 1, 1 > Matrix1x1
Generic 1x1 matrix (double)
NTuple interface class definition.
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
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, 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, 8, 8, ROOT::Math::MatRepSym< double, 8 > > SymMatrix8x8
Symmetrix 8x8 matrix (double)
ROOT::Math::SMatrix< double, 7, 7 > Matrix7x7
Generic 7x7 matrix (double)
StatusCode write()
write a record to NTuple
unsigned int CLID
Class ID definition.
constexpr static const auto SUCCESS
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
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SymMatrix2x2
Symmetrix 2x2 matrix (double)
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)
virtual StatusCode Error(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
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)
int nsecond() const
Get the nanoseconds.
ROOT::Math::PxPyPzEVector LorentzVector
Cartesian 4 Vector.
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].