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;
22 double*
begin( CLHEP::HepVector& v ) {
return &v[0]; }
23 const double*
begin(
const CLHEP::HepVector& v ) {
return &v[0]; }
53 if ( !tuple.
valid() ) {
return 0; }
54 return tuple->
tuple();
58 if ( !tuple.
valid() ) {
return 0; }
59 return tuple->
tuple();
66 return tuple->
write();
70 return _fill( tuple, name, value );
74 const int minv,
const int maxv ) {
76 return tuple->
column( name, value, minv, maxv );
80 const double value ) {
81 return _fill( tuple, name, value );
85 const long long value ) {
86 return _fill( tuple, name, value );
90 const unsigned long long value ) {
91 return _fill( tuple, name, value );
96 return _fill( tuple, name, value );
102 return tuple->
column( name, value );
106 return column( tuple,
"Address", value );
111 return _fill( tuple, name, value );
116 return _fill( tuple, name, value );
121 return _fill( tuple, name, value );
126 const size_t maxv ) {
128 return tuple->
farray( name, data.
begin(), data.
end(), length, maxv );
136 if ( !data.
empty() && cols != data.
front().size() ) {
137 return tuple->
Error(
"GP:fmatrix(1): mismatch in matrix dimensions!" );
139 return tuple->
fmatrix( name, data, data.
size(), cols, length, maxv );
146 return tuple->
fmatrix( name, info, length, maxv );
158 return tuple->
array( name, data );
164 return tuple->
array( name, data );
170 return tuple->
array( name, data.
begin(), data.begin() + 3 );
177 return tuple->
array( name, data.
begin(), data.begin() + 4 );
183 return tuple->
array( name, data );
189 return tuple->
array( name, data );
195 return tuple->
array( name, data );
201 return tuple->
array( name, data );
207 return tuple->
array( name, data );
215 if ( data.
empty() ) {
return tuple->
Warning(
"GP:matrix(1): empty fixed matrix, skip matrix " ); }
216 if ( cols != data.
front().size() ) {
return tuple->
Error(
"GP:matrix(1): mismatch in fixed matrix dimensions!" ); }
217 return tuple->
matrix( name, data, data.
size(), cols );
223 return tuple->
matrix( name, data );
229 return tuple->
matrix( name, data );
235 return tuple->
matrix( name, data );
241 return tuple->
matrix( name, data );
247 return tuple->
matrix( name, data );
253 return tuple->
matrix( name, data );
259 return tuple->
matrix( name, data );
265 return tuple->
matrix( name, data );
271 return tuple->
matrix( name, data );
277 return tuple->
matrix( name, data );
283 return tuple->
matrix( name, data );
289 return tuple->
matrix( name, data );
295 return tuple->
matrix( name, data );
301 return tuple->
matrix( name, data );
307 return tuple->
matrix( name, data );
313 return tuple->
matrix( name, data );
319 return tuple->
matrix( name, data );
325 return tuple->
matrix( name, data );
331 return tuple->
matrix( name, data );
337 return tuple->
matrix( name, data );
343 return tuple->
matrix( name, data );
349 return tuple->
matrix( name, data );
355 return tuple->
matrix( name, data );
361 return tuple->
matrix( name, data );
367 return tuple->
matrix( name, data );
373 return tuple->
matrix( name, data );
379 return tuple->
matrix( name, data );
385 return column( tuple,
"", value );
395 sc = tuple->
column( name +
"year", value.
year(
true ), 1970, 2070 );
397 sc = tuple->
column( name +
"month", value.
month(
true ) + 1, 1, 16 );
399 sc = tuple->
column( name +
"day", value.
day(
true ), 0, 32 );
401 sc = tuple->
column( name +
"hour", value.
hour(
true ), 0, 25 );
403 sc = tuple->
column( name +
"minute", value.
minute(
true ), 0, 61 );
405 sc = tuple->
column( name +
"second", value.
second(
true ), 0, 61 );
417 const CLHEP::HepVector& data ) {
419 return tuple->
array( name, data, data.num_row() );
423 const CLHEP::HepVector& data,
const std::string& length,
424 const size_t maxv ) {
427 const double*
begin = &( data[0] );
428 const double*
end = begin + data.num_row();
429 return tuple->
farray( name, begin, end, length, maxv );
433 const CLHEP::HepGenMatrix& data ) {
435 if ( 1 > data.num_col() ) {
return tuple->
Error(
"GP:matrix(2): illegal fixed matrix num_col" ); }
436 if ( 1 > data.num_row() ) {
return tuple->
Error(
"GP:matrix(2): illegal fixed matrix num_row" ); }
437 return tuple->
matrix( name, data, data.num_row(), data.num_col() );
441 const CLHEP::HepGenMatrix& data,
445 if ( cols != data.num_col() ) {
return tuple->
Error(
"GP:fmatrix(2): mismatch in matrix dimensions!" ); }
446 return tuple->
fmatrix( name, data, data.num_row(), cols, length, maxv );
455 return algo.
nTuple( title, clid );
460 return algo.
nTuple( ID, title, clid );
465 return algo.
nTuple( ID, title, clid );
470 return algo.
nTuple( ID, title, clid );
475 return algo.
evtCol( title, clid );
480 return algo.
evtCol( ID, title, clid );
485 return algo.
evtCol( ID, title, clid );
490 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...
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.
constexpr static const auto SUCCESS
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.
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.
constexpr static const auto FAILURE
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].