ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EMAPMatrix< T > Class Template Reference

#include <EMAPMatrix.h>

Collaboration diagram for EMAPMatrix< T >:

Public Member Functions

 EMAPMatrix ()
 Default constructor. More...
 
 EMAPMatrix (const std::vector< EMAPMatrixAxis > &axes, const std::string &textDescription)
 Constructor with std::vector of axes to define dimensions and binnging of this matrix. More...
 
 EMAPMatrix (const EMAPMatrix &ob)=default
 Constructor with std::vector of axes to define dimensions and binnging of this matrix. More...
 
 ~EMAPMatrix ()
 Default destructor. More...
 
EMAPMatrixoperator= (const EMAPMatrix &ob)=default
 Operator = Overload. More...
 
StatusCode setupMatrix (std::vector< EMAPMatrixAxis > axes)
 Setup Matrix via given std::vector of EMAPMatrixAxis objects. More...
 
StatusCode setBinContent (double x, T value)
 Set Bin-content to "T" in bin which corresponds to value "x". More...
 
StatusCode setBinContent (double x, double y, T value)
 Set Bin-content to "T" in bin which corresponds to value "x" and "y". More...
 
StatusCode setBinContent (double x, double y, double z, T value)
 Set Bin-content to "T" in bin which corresponds to value "x,y,z". More...
 
StatusCode setBinContent (double x, double y, double z, double u, T value)
 Set Bin-content to "T" in bin which corresponds to value "x,y,z,u". More...
 
StatusCode setBinContent (double x, double y, double z, double u, double v, T value)
 Set Bin-content to "T" in bin which corresponds to value "x,y,z,u,v". More...
 
StatusCode setBinContent (const std::vector< double > &x, T value)
 Set Bin-content to "T" in bin which corresponds to value std::vector x. More...
 
const T * getBinContent (double x) const
 Get Bin-content to "T" in bin which corresponds to value "x". More...
 
const T * getBinContent (double x, double y) const
 Get Bin-content to "T" in bin which corresponds to value "x,y". More...
 
const T * getBinContent (double x, double y, double z) const
 Get Bin-content to "T" in bin which corresponds to value "x,y,z". More...
 
const T * getBinContent (double x, double y, double z, double u) const
 Get Bin-content to "T" in bin which corresponds to value "x,y,z,u". More...
 
const T * getBinContent (double x, double y, double z, double u, double v) const
 Get Bin-content to "T" in bin which corresponds to value "x,y,z,u,v". More...
 
const T * getBinContent (const std::vector< double > &x) const
 Get Bin-content to "T" in bin which corresponds to value std::vector x. More...
 
int getDimensions () const
 Return status code of last operations. More...
 
EMAPMatrixAxis getAxis (unsigned int i) const
 
std::vector< T > getValues () const
 return the std::vector<T> which contains all content information of the matrix. More...
 
void clear ()
 Clear all Matrix information (Also binning,...) More...
 
void clearEntries ()
 Clear Matrix content but not binning, dimensions and axis. More...
 
bool isInRange (const std::vector< double > &x) const
 
void setTextDescription (const std::string &text)
 The user can add a Description of what this matrix contains and how it was produced, e.g. More...
 
std::string getTextDescription () const
 The user can add a Description of what this matrix contains and how it was produced, e.g. More...
 

Protected Member Functions

StatusCode setupEntries ()
 Description of the content of this matrix. More...
 
unsigned int Index (const std::vector< unsigned int > &x) const
 
std::vector< unsigned int > Index (unsigned int id)
 

Protected Attributes

unsigned int m_dimensions
 
std::vector< EMAPMatrixAxism_axis
 
std::vector< T > m_matrix
 
std::vector< unsigned int > m_base
 representation of the content of matrix More...
 
std::string m_textDescription
 helper object which is used to "convert" the 1dim m_matrix into a n-dimensional object More...
 

Detailed Description

template<class T>
class EMAPMatrix< T >

The EMAPMatrix class is a templete class which was design to represent a sort of a n-dimensional Histogram. Each entry of the matrix must provide a copy constructor and a addition function. It is based on APMatrix in InsituPerformance, by Matthias Schott, but simplified to remove dependencies and features not used. (EMClusterErrors is not additive, so all the addition routines are removed.)

Author
Jovan Mitrevski (this version), Matthias Schott (original)

Definition at line 71 of file EMAPMatrix.h.

Constructor & Destructor Documentation

◆ EMAPMatrix() [1/3]

template<class T >
EMAPMatrix< T >::EMAPMatrix ( )

Default constructor.

◆ EMAPMatrix() [2/3]

template<class T >
EMAPMatrix< T >::EMAPMatrix ( const std::vector< EMAPMatrixAxis > &  axes,
const std::string &  textDescription 
)

Constructor with std::vector of axes to define dimensions and binnging of this matrix.

Parameters
axesstd::vector of EMAPMatrixAxis objects

◆ EMAPMatrix() [3/3]

template<class T >
EMAPMatrix< T >::EMAPMatrix ( const EMAPMatrix< T > &  ob)
default

Constructor with std::vector of axes to define dimensions and binnging of this matrix.

Parameters
axesstd::vector of EMAPMatrixAxis objects @emptyObject: Standard object which is used to fill the matrix if it is supposed to be empty/cleaned Copy constructor

◆ ~EMAPMatrix()

template<class T >
EMAPMatrix< T >::~EMAPMatrix ( )

Default destructor.

Member Function Documentation

◆ clear()

template<class T >
void EMAPMatrix< T >::clear ( )

Clear all Matrix information (Also binning,...)

◆ clearEntries()

template<class T >
void EMAPMatrix< T >::clearEntries ( )

Clear Matrix content but not binning, dimensions and axis.

◆ getAxis()

template<class T >
EMAPMatrixAxis EMAPMatrix< T >::getAxis ( unsigned int  i) const
inline

Definition at line 168 of file EMAPMatrix.h.

168 { return m_axis[i];}

◆ getBinContent() [1/6]

template<class T >
const T* EMAPMatrix< T >::getBinContent ( const std::vector< double > &  x) const

Get Bin-content to "T" in bin which corresponds to value std::vector x.

Can only used for n-dimensional matrix if the length of the std::vector x ind n.

Parameters
xstd::vector of length n which represents the values on all axes
Tvalue which should be recieved

◆ getBinContent() [2/6]

template<class T >
const T* EMAPMatrix< T >::getBinContent ( double  x) const

Get Bin-content to "T" in bin which corresponds to value "x".

Can only used for 1-dimensional matrix

Parameters
xvalue on x-axis
Tvalue which is received

◆ getBinContent() [3/6]

template<class T >
const T* EMAPMatrix< T >::getBinContent ( double  x,
double  y 
) const

Get Bin-content to "T" in bin which corresponds to value "x,y".

Can only used for 2-dimensional matrix

Parameters
xvalue on x-axis
yvalue on y-axis
Tvalue which is received

◆ getBinContent() [4/6]

template<class T >
const T* EMAPMatrix< T >::getBinContent ( double  x,
double  y,
double  z 
) const

Get Bin-content to "T" in bin which corresponds to value "x,y,z".

Can only used for 3-dimensional matrix

Parameters
xvalue on x-axis
yvalue on y-axis
zvalue on z-axis
Tvalue which is received

◆ getBinContent() [5/6]

template<class T >
const T* EMAPMatrix< T >::getBinContent ( double  x,
double  y,
double  z,
double  u 
) const

Get Bin-content to "T" in bin which corresponds to value "x,y,z,u".

Can only used for 4-dimensional matrix

◆ getBinContent() [6/6]

template<class T >
const T* EMAPMatrix< T >::getBinContent ( double  x,
double  y,
double  z,
double  u,
double  v 
) const

Get Bin-content to "T" in bin which corresponds to value "x,y,z,u,v".

Can only used for 5-dimensional matrix

◆ getDimensions()

template<class T >
int EMAPMatrix< T >::getDimensions ( ) const
inline

Return status code of last operations.

Some access operations might have failed. In this case, the statusCode is set to false Return number of dimensions of this matrix

Definition at line 165 of file EMAPMatrix.h.

165 { return m_dimensions;}

◆ getTextDescription()

template<class T >
std::string EMAPMatrix< T >::getTextDescription ( ) const

The user can add a Description of what this matrix contains and how it was produced, e.g.

cuts

◆ getValues()

template<class T >
std::vector<T> EMAPMatrix< T >::getValues ( ) const
inline

return the std::vector<T> which contains all content information of the matrix.

Note that the binning and dimensions is not coded inside

Definition at line 171 of file EMAPMatrix.h.

171 { return m_matrix;}

◆ Index() [1/2]

template<class T >
unsigned int EMAPMatrix< T >::Index ( const std::vector< unsigned int > &  x) const
protected

◆ Index() [2/2]

template<class T >
std::vector<unsigned int> EMAPMatrix< T >::Index ( unsigned int  id)
protected

◆ isInRange()

template<class T >
bool EMAPMatrix< T >::isInRange ( const std::vector< double > &  x) const

◆ operator=()

template<class T >
EMAPMatrix& EMAPMatrix< T >::operator= ( const EMAPMatrix< T > &  ob)
default

Operator = Overload.

◆ setBinContent() [1/6]

template<class T >
StatusCode EMAPMatrix< T >::setBinContent ( const std::vector< double > &  x,
value 
)

Set Bin-content to "T" in bin which corresponds to value std::vector x.

Can only used for n-dimensional matrix if the length of the std::vector x ind n.

Parameters
xstd::vector of length n which represents the values on all axes
Tvalue which should be set

◆ setBinContent() [2/6]

template<class T >
StatusCode EMAPMatrix< T >::setBinContent ( double  x,
double  y,
double  z,
double  u,
double  v,
value 
)

Set Bin-content to "T" in bin which corresponds to value "x,y,z,u,v".

Can only used for 5-dimensional matrix

◆ setBinContent() [3/6]

template<class T >
StatusCode EMAPMatrix< T >::setBinContent ( double  x,
double  y,
double  z,
double  u,
value 
)

Set Bin-content to "T" in bin which corresponds to value "x,y,z,u".

Can only used for 4-dimensional matrix

◆ setBinContent() [4/6]

template<class T >
StatusCode EMAPMatrix< T >::setBinContent ( double  x,
double  y,
double  z,
value 
)

Set Bin-content to "T" in bin which corresponds to value "x,y,z".

Can only used for 3-dimensional matrix

Parameters
xvalue on x-axis
yvalue on y-axis
zvalue on z-axis
Tvalue which should be set

◆ setBinContent() [5/6]

template<class T >
StatusCode EMAPMatrix< T >::setBinContent ( double  x,
double  y,
value 
)

Set Bin-content to "T" in bin which corresponds to value "x" and "y".

Can only used for 2-dimensional matrix

Parameters
xvalue on x-axis
yvalue on y-axis
Tvalue which should be set

◆ setBinContent() [6/6]

template<class T >
StatusCode EMAPMatrix< T >::setBinContent ( double  x,
value 
)

Set Bin-content to "T" in bin which corresponds to value "x".

Can only used for 1-dimensional matrix

Parameters
xvalue on x-axis
Tvalue which should be set

◆ setTextDescription()

template<class T >
void EMAPMatrix< T >::setTextDescription ( const std::string &  text)

The user can add a Description of what this matrix contains and how it was produced, e.g.

cuts

◆ setupEntries()

template<class T >
StatusCode EMAPMatrix< T >::setupEntries ( )
protected

Description of the content of this matrix.

◆ setupMatrix()

template<class T >
StatusCode EMAPMatrix< T >::setupMatrix ( std::vector< EMAPMatrixAxis axes)

Setup Matrix via given std::vector of EMAPMatrixAxis objects.

Member Data Documentation

◆ m_axis

template<class T >
std::vector<EMAPMatrixAxis> EMAPMatrix< T >::m_axis
protected

Definition at line 193 of file EMAPMatrix.h.

◆ m_base

template<class T >
std::vector< unsigned int > EMAPMatrix< T >::m_base
protected

representation of the content of matrix

Definition at line 196 of file EMAPMatrix.h.

◆ m_dimensions

template<class T >
unsigned int EMAPMatrix< T >::m_dimensions
protected

Definition at line 191 of file EMAPMatrix.h.

◆ m_matrix

template<class T >
std::vector< T > EMAPMatrix< T >::m_matrix
protected

Definition at line 195 of file EMAPMatrix.h.

◆ m_textDescription

template<class T >
std::string EMAPMatrix< T >::m_textDescription
protected

helper object which is used to "convert" the 1dim m_matrix into a n-dimensional object

Definition at line 197 of file EMAPMatrix.h.


The documentation for this class was generated from the following file:
EMAPMatrix::m_axis
std::vector< EMAPMatrixAxis > m_axis
Definition: EMAPMatrix.h:193
EMAPMatrix::m_dimensions
unsigned int m_dimensions
Definition: EMAPMatrix.h:191
lumiFormat.i
int i
Definition: lumiFormat.py:92
EMAPMatrix::m_matrix
std::vector< T > m_matrix
Definition: EMAPMatrix.h:195