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

#include <EMClusterEtaPosErrorsMatrix.h>

Inheritance diagram for EMClusterEtaPosErrorsMatrix:
Collaboration diagram for EMClusterEtaPosErrorsMatrix:

Public Member Functions

 EMClusterEtaPosErrorsMatrix ()
 
 EMClusterEtaPosErrorsMatrix (const std::vector< EMAPMatrixAxis > &axes, const std::string &textDescription="")
 
 ~EMClusterEtaPosErrorsMatrix ()
 Default destructor. More...
 
StatusCode setError (double eta, float a, float b)
 Add the outcome of the test at the given "eta" and "pt" value, i.e. if the reconstruction was successful or not. More...
 
double getError (double eta, double energyCluster) const
 Get (reconstruction/trigger) efficiency for a track. 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
 
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
 
std::vector< EMClusterErrorsEntrygetValues () 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< 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...
 

Detailed Description

The EMClusterEtaPosErrorsMatrix class is derived of EMClusterErrorsMatrix and was designed to represents the cluster eta resulutions. The current binning is in eta.

Author
T. Cuhadar Donszelmann, Jovan.nosp@m..Mit.nosp@m.revsk.nosp@m.i@ce.nosp@m.rn.ch

Definition at line 19 of file EMClusterEtaPosErrorsMatrix.h.

Constructor & Destructor Documentation

◆ EMClusterEtaPosErrorsMatrix() [1/2]

EMClusterEtaPosErrorsMatrix::EMClusterEtaPosErrorsMatrix ( )

Definition at line 11 of file EMClusterEtaPosErrorsMatrix.cxx.

11  :
13 {
14 }

◆ EMClusterEtaPosErrorsMatrix() [2/2]

EMClusterEtaPosErrorsMatrix::EMClusterEtaPosErrorsMatrix ( const std::vector< EMAPMatrixAxis > &  axes,
const std::string &  textDescription = "" 
)

Definition at line 17 of file EMClusterEtaPosErrorsMatrix.cxx.

18  :
19  EMClusterErrorsMatrix(axes, textDescription)
20 {
21 }

◆ ~EMClusterEtaPosErrorsMatrix()

EMClusterEtaPosErrorsMatrix::~EMClusterEtaPosErrorsMatrix ( )
inline

Default destructor.

Definition at line 27 of file EMClusterEtaPosErrorsMatrix.h.

27 {};

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]

double EMClusterEtaPosErrorsMatrix::getError ( double  eta,
double  energyCluster 
) const

Get (reconstruction/trigger) efficiency for a track.

Get the efficiency for the given "cluster energy".

Parameters
vecVector with eta, phi and pt information of track

sigma_etaS1

Definition at line 38 of file EMClusterEtaPosErrorsMatrix.cxx.

39 {
40 
42 
43  if (!params) return -1.0;
44 
45  // for protection, to not divide by 0;
46  if (clusterEnergy < 1.0) clusterEnergy = 1.0;
47 
48  const double clusterEnergyGeV = clusterEnergy*(1./Gaudi::Units::GeV); //GeV
49 
50  const double a = params->at(0); // "a" from DB
51  const double b = params->at(1); // "b" from DB
53  return ( a*sqrt(b/clusterEnergyGeV));
54 }

◆ getError() [2/3]

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

Definition at line 52 of file EMClusterErrorsMatrix.h.

52 {return getBinContent(x); };

◆ getError() [3/3]

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

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()

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()

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
inherited

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() [1/2]

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

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 }

◆ setError() [2/2]

StatusCode EMClusterEtaPosErrorsMatrix::setError ( double  eta,
float  a,
float  b 
)

Add the outcome of the test at the given "eta" and "pt" value, i.e. if the reconstruction was successful or not.

Definition at line 24 of file EMClusterEtaPosErrorsMatrix.cxx.

25 {
26 
27  std::vector<double> v; // will actually be converted to a Float_t when stored in db.
28  v.push_back(eta);
29 
30  EMClusterErrorsEntry apEntry;
31  apEntry.push_back(a);
32  apEntry.push_back(b);
33 
34  return EMClusterErrorsMatrix::setError(v, apEntry);
35 }

◆ 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.

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
EMClusterErrorsMatrix::EMClusterErrorsMatrix
EMClusterErrorsMatrix()
Defaul constructor.
Definition: EMClusterErrorsMatrix.cxx:10
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
EMAPMatrix< EMClusterErrorsEntry >::getTextDescription
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
EMClusterErrorsEntry
std::vector< float > EMClusterErrorsEntry
Definition: EMClusterErrorsMatrix.h:23
EMClusterErrorsMatrix::getError
const EMClusterErrorsEntry * getError(std::vector< double > x) const
Get efficiency in bin which corresponds to value std::vector x.
Definition: EMClusterErrorsMatrix.h:51
lumiFormat.i
int i
Definition: lumiFormat.py:92
EMAPMatrix< EMClusterErrorsEntry >::getBinContent
const EMClusterErrorsEntry * getBinContent(double x) const
Get Bin-content to "T" in bin which corresponds to value "x".
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
EMAPMatrix< EMClusterErrorsEntry >::m_matrix
std::vector< EMClusterErrorsEntry > m_matrix
Definition: EMAPMatrix.h:195
python.PyAthena.v
v
Definition: PyAthena.py:157
a
TList * a
Definition: liststreamerinfos.cxx:10
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
EMClusterErrorsMatrix::setError
StatusCode setError(const std::vector< double > &x, const EMClusterErrorsEntry &apEntry)
Sets bin-content to "apEntry" in bin which corresponds to value std::vector x.
Definition: EMClusterErrorsMatrix.cxx:24
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30