ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
EMClusterErrorsMatrix Class Reference

#include <EMClusterErrorsMatrix.h>

Inheritance diagram for EMClusterErrorsMatrix:
Collaboration diagram for EMClusterErrorsMatrix:

Public Member Functions

 EMClusterErrorsMatrix ()
 Defaul constructor. More...
 
 EMClusterErrorsMatrix (const std::vector< EMAPMatrixAxis > &axes, const std::string &textDescription)
 Constructor with std::vector of axes to define dimensions and binnging of this matrix. More...
 
 ~EMClusterErrorsMatrix ()
 Default destructor. More...
 
StatusCode setError (const std::vector< double > &x, const EMClusterErrorsEntry &apEntry)
 Sets bin-content to "apEntry" in bin which corresponds to value std::vector x. More...
 
const EMClusterErrorsEntrygetError (std::vector< double > x) const
 Get efficiency in bin which corresponds to value std::vector x. More...
 
const EMClusterErrorsEntrygetError (double x) const
 
const EMClusterErrorsEntrygetError (double x, double y) const
 
void printMatrix () const
 
StatusCode setupMatrix (std::vector< EMAPMatrixAxis > axes)
 Setup Matrix via given std::vector of EMAPMatrixAxis objects. More...
 
StatusCode setBinContent (double x, EMClusterErrorsEntry value)
 Set Bin-content to "T" in bin which corresponds to value "x". More...
 
StatusCode setBinContent (double x, double y, EMClusterErrorsEntry value)
 Set Bin-content to "T" in bin which corresponds to value "x" and "y". More...
 
StatusCode setBinContent (double x, double y, double z, EMClusterErrorsEntry 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, EMClusterErrorsEntry 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, EMClusterErrorsEntry 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, EMClusterErrorsEntry value)
 Set Bin-content to "T" in bin which corresponds to value std::vector x. More...
 
const EMClusterErrorsEntrygetBinContent (double x) const
 Get Bin-content to "T" in bin which corresponds to value "x". More...
 
const EMClusterErrorsEntrygetBinContent (double x, double y) const
 Get Bin-content to "T" in bin which corresponds to value "x,y". More...
 
const EMClusterErrorsEntrygetBinContent (double x, double y, double z) const
 Get Bin-content to "T" in bin which corresponds to value "x,y,z". More...
 
const EMClusterErrorsEntrygetBinContent (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 EMClusterErrorsEntrygetBinContent (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 EMClusterErrorsEntrygetBinContent (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
 
const std::vector< EMClusterErrorsEntry > & 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...
 
const 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< EMClusterErrorsEntrym_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...
 

Friends

class EMInsituDatabaseEntry
 

Detailed Description

Definition at line 25 of file EMClusterErrorsMatrix.h.

Constructor & Destructor Documentation

◆ EMClusterErrorsMatrix() [1/2]

EMClusterErrorsMatrix::EMClusterErrorsMatrix ( )

Defaul constructor.

Definition at line 10 of file EMClusterErrorsMatrix.cxx.

12 {
13 }

◆ EMClusterErrorsMatrix() [2/2]

EMClusterErrorsMatrix::EMClusterErrorsMatrix ( 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 APMatrixAxis objects

Definition at line 16 of file EMClusterErrorsMatrix.cxx.

18  : EMAPMatrix<EMClusterErrorsEntry>(axes, textDescription)
19 {
20 }

◆ ~EMClusterErrorsMatrix()

EMClusterErrorsMatrix::~EMClusterErrorsMatrix ( )
inline

Default destructor.

Definition at line 38 of file EMClusterErrorsMatrix.h.

38 {};

Member Function Documentation

◆ clear()

void EMAPMatrix< EMClusterErrorsEntry >::clear ( )
inherited

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

◆ clearEntries()

void EMAPMatrix< EMClusterErrorsEntry >::clearEntries ( )
inherited

Clear Matrix content but not binning, dimensions and axis.

◆ getAxis()

EMAPMatrixAxis EMAPMatrix< EMClusterErrorsEntry >::getAxis ( unsigned int  i) const
inlineinherited

Definition at line 168 of file EMAPMatrix.h.

168 { return m_axis[i];}

◆ getBinContent() [1/6]

const EMClusterErrorsEntry * EMAPMatrix< EMClusterErrorsEntry >::getBinContent ( const std::vector< double > &  x) const
inherited

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]

const EMClusterErrorsEntry * EMAPMatrix< EMClusterErrorsEntry >::getBinContent ( double  x) const
inherited

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]

const EMClusterErrorsEntry * EMAPMatrix< EMClusterErrorsEntry >::getBinContent ( double  x,
double  y 
) const
inherited

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]

const EMClusterErrorsEntry * EMAPMatrix< EMClusterErrorsEntry >::getBinContent ( double  x,
double  y,
double  z 
) const
inherited

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]

const EMClusterErrorsEntry * EMAPMatrix< EMClusterErrorsEntry >::getBinContent ( double  x,
double  y,
double  z,
double  u 
) const
inherited

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]

const EMClusterErrorsEntry * EMAPMatrix< EMClusterErrorsEntry >::getBinContent ( double  x,
double  y,
double  z,
double  u,
double  v 
) const
inherited

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

Can only used for 5-dimensional matrix

◆ getDimensions()

int EMAPMatrix< EMClusterErrorsEntry >::getDimensions ( ) const
inlineinherited

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;}

◆ getError() [1/3]

const EMClusterErrorsEntry* EMClusterErrorsMatrix::getError ( double  x) const
inline

Definition at line 52 of file EMClusterErrorsMatrix.h.

52 {return getBinContent(x); };

◆ getError() [2/3]

const EMClusterErrorsEntry* EMClusterErrorsMatrix::getError ( double  x,
double  y 
) const
inline

Definition at line 53 of file EMClusterErrorsMatrix.h.

53 {return getBinContent(x,y); };

◆ getError() [3/3]

const EMClusterErrorsEntry* EMClusterErrorsMatrix::getError ( std::vector< double >  x) const
inline

Get efficiency 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

Definition at line 51 of file EMClusterErrorsMatrix.h.

51 {return getBinContent(std::move(x)); };

◆ getTextDescription()

const std::string& EMAPMatrix< EMClusterErrorsEntry >::getTextDescription ( ) const
inherited

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

cuts

◆ getValues()

const std::vector<EMClusterErrorsEntry >& EMAPMatrix< EMClusterErrorsEntry >::getValues ( ) const
inlineinherited

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]

unsigned int EMAPMatrix< EMClusterErrorsEntry >::Index ( const std::vector< unsigned int > &  x) const
protectedinherited

◆ Index() [2/2]

std::vector<unsigned int> EMAPMatrix< EMClusterErrorsEntry >::Index ( unsigned int  id)
protectedinherited

◆ isInRange()

bool EMAPMatrix< EMClusterErrorsEntry >::isInRange ( const std::vector< double > &  x) const
inherited

◆ printMatrix()

void EMClusterErrorsMatrix::printMatrix ( ) const

Definition at line 29 of file EMClusterErrorsMatrix.cxx.

30 {
31  std::cout << "***** Printing EMClusterErrorsMatrix: " << getTextDescription() << " *******"<< std::endl;
32  std::cout << " Matrix has " << m_dimensions << " dimensions" << std::endl;
33  for(unsigned i = 0; i < m_dimensions; i++) {
34  std::cout << " Dim " << i << " is binning in " << m_axis.at(i).getName() << " with bin boundaries \n ";
35  std::vector<double> axisBinning = m_axis.at(i).getBinningInformation();
36  for (double j : axisBinning) {
37  std::cout << j << " ";
38  }
39  std::cout << std::endl;
40  }
41 
42  std::cout << " Mapping of extra dimensions in matrix (m_base): ";
43  for (unsigned int i : m_base) {
44  std::cout << i << " ";
45  }
46 
47  std::cout << "\n Matrix data:\n ";
48 
49  const unsigned int matrixSize = m_matrix.size();
50 
51  // push back the number of floats to store per matrix entry
52  const unsigned int vectSize = (matrixSize) ? m_matrix.at(0).size() : 0;
53 
54  //std::cerr << "matrixSize = " << matrixSize << ", vectSize = " << vectSize << std::endl;
55 
56  for (unsigned int i=0; i<matrixSize; i++) {
57  const EMClusterErrorsEntry vect = m_matrix.at(i);
58  if (vect.size() != vectSize) {
59  std::cerr << "The input EMClusterErrorsMatrix doesn't have entries with all having the same number of floats" << std::endl; // shoudl this go to a message stream instead? The macros didn't work.
60  return;
61  }
62  for (unsigned int j=0; j<vectSize; j++) {
63  std::cout << vect.at(j) << " ";
64  }
65  std::cout << "\n ";
66  }
67  std::cout << std::endl;
68 }

◆ setBinContent() [1/6]

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setBinContent ( const std::vector< double > &  x,
value 
)
inherited

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]

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setBinContent ( double  x,
double  y,
double  z,
double  u,
double  v,
value 
)
inherited

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]

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setBinContent ( double  x,
double  y,
double  z,
double  u,
value 
)
inherited

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]

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setBinContent ( double  x,
double  y,
double  z,
value 
)
inherited

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]

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setBinContent ( double  x,
double  y,
value 
)
inherited

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]

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setBinContent ( double  x,
value 
)
inherited

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

◆ setError()

StatusCode EMClusterErrorsMatrix::setError ( const std::vector< double > &  x,
const EMClusterErrorsEntry apEntry 
)

Sets bin-content to "apEntry" 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
apEntryvalue which should be set

Definition at line 24 of file EMClusterErrorsMatrix.cxx.

25 {
26  return setBinContent(x, apEntry);
27 }

◆ setTextDescription()

void EMAPMatrix< EMClusterErrorsEntry >::setTextDescription ( const std::string &  text)
inherited

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

cuts

◆ setupEntries()

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setupEntries ( )
protectedinherited

Description of the content of this matrix.

◆ setupMatrix()

StatusCode EMAPMatrix< EMClusterErrorsEntry >::setupMatrix ( std::vector< EMAPMatrixAxis axes)
inherited

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

Friends And Related Function Documentation

◆ EMInsituDatabaseEntry

friend class EMInsituDatabaseEntry
friend

Definition at line 27 of file EMClusterErrorsMatrix.h.

Member Data Documentation

◆ m_axis

std::vector<EMAPMatrixAxis> EMAPMatrix< EMClusterErrorsEntry >::m_axis
protectedinherited

Definition at line 193 of file EMAPMatrix.h.

◆ m_base

std::vector< unsigned int > EMAPMatrix< EMClusterErrorsEntry >::m_base
protectedinherited

representation of the content of matrix

Definition at line 196 of file EMAPMatrix.h.

◆ m_dimensions

unsigned int EMAPMatrix< EMClusterErrorsEntry >::m_dimensions
protectedinherited

Definition at line 191 of file EMAPMatrix.h.

◆ m_matrix

std::vector< EMClusterErrorsEntry > EMAPMatrix< EMClusterErrorsEntry >::m_matrix
protectedinherited

Definition at line 195 of file EMAPMatrix.h.

◆ m_textDescription

std::string EMAPMatrix< EMClusterErrorsEntry >::m_textDescription
protectedinherited

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 files:
EMAPMatrix< EMClusterErrorsEntry >::setBinContent
StatusCode setBinContent(double x, EMClusterErrorsEntry value)
Set Bin-content to "T" in bin which corresponds to value "x".
EMAPMatrix< EMClusterErrorsEntry >::m_axis
std::vector< EMAPMatrixAxis > m_axis
Definition: EMAPMatrix.h:193
EMAPMatrix< EMClusterErrorsEntry >::getTextDescription
const std::string & getTextDescription() const
The user can add a Description of what this matrix contains and how it was produced,...
x
#define x
EMAPMatrix< EMClusterErrorsEntry >::m_dimensions
unsigned int m_dimensions
Definition: EMAPMatrix.h:191
EMAPMatrix< EMClusterErrorsEntry >::m_base
std::vector< unsigned int > m_base
representation of the content of matrix
Definition: EMAPMatrix.h:196
EMAPMatrix< EMClusterErrorsEntry >
EMClusterErrorsEntry
std::vector< float > EMClusterErrorsEntry
Definition: EMClusterErrorsMatrix.h:23
lumiFormat.i
int i
Definition: lumiFormat.py:85
EMAPMatrix< EMClusterErrorsEntry >::getBinContent
const EMClusterErrorsEntry * getBinContent(double x) const
Get Bin-content to "T" in bin which corresponds to value "x".
EMAPMatrix< EMClusterErrorsEntry >::m_matrix
std::vector< EMClusterErrorsEntry > m_matrix
Definition: EMAPMatrix.h:195
y
#define y