ATLAS Offline Software
EMClusterEtaPosErrorsMatrix.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/SystemOfUnits.h"
7 #include <cmath>
8 #include <utility>
9 
10 // Constructors
13 {
14 }
15 
16 
17 EMClusterEtaPosErrorsMatrix::EMClusterEtaPosErrorsMatrix(const std::vector<EMAPMatrixAxis> &axes,
18  const std::string& textDescription) :
19  EMClusterErrorsMatrix(axes, textDescription)
20 {
21 }
22 
24 StatusCode EMClusterEtaPosErrorsMatrix::setError(double eta, float a, float b) // a should be in rad, not mrad
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 }
36 
38 double EMClusterEtaPosErrorsMatrix::getError(double eta, double clusterEnergy) const
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 }
EMClusterEtaPosErrorsMatrix::setError
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 success...
Definition: EMClusterEtaPosErrorsMatrix.cxx:24
EMClusterEtaPosErrorsMatrix.h
EMClusterEtaPosErrorsMatrix::getError
double getError(double eta, double energyCluster) const
Get (reconstruction/trigger) efficiency for a track.
Definition: EMClusterEtaPosErrorsMatrix.cxx:38
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
EMClusterEtaPosErrorsMatrix::EMClusterEtaPosErrorsMatrix
EMClusterEtaPosErrorsMatrix()
Definition: EMClusterEtaPosErrorsMatrix.cxx:11
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.PyAthena.v
v
Definition: PyAthena.py:157
a
TList * a
Definition: liststreamerinfos.cxx:10
EMClusterErrorsMatrix
Definition: EMClusterErrorsMatrix.h:26
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