ATLAS Offline Software
EMClusterEnergyErrorsMatrix.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 <cmath>
7 #include <utility>
8 
9 // Constructors
12 {
13 }
14 
15 
16 EMClusterEnergyErrorsMatrix::EMClusterEnergyErrorsMatrix(const std::vector<EMAPMatrixAxis> &axes,
17  const std::string& textDescription) :
18  EMClusterErrorsMatrix(axes, textDescription)
19 {
20 }
21 
23 {
24  std::vector<double> v; // will actually be converted to a Float_t when stored in db.
25  v.push_back(eta);
26 
27  EMClusterErrorsEntry apEntry;
28  apEntry.push_back(a);
29  apEntry.push_back(b);
30  apEntry.push_back(c);
31 
32  return EMClusterErrorsMatrix::setError(v, apEntry);
33 }
34 
36 double EMClusterEnergyErrorsMatrix::getError(double eta, double clusterEnergy) const
37 {
38 
39  // for protection
40  if (clusterEnergy < 1.0) clusterEnergy = 1.0;
41  if (fabs(eta) > 8.0) eta = 8.0;
42 
44 
45  if (!params) return -1.0;
46 
47  double clusterEnergyGeV = clusterEnergy*1e-3; //GeV
48 
51  const double a = params->at(0);
52  const double b = params->at(1);
53  const double c = params->at(2);
54 
55  double function = a*a + (b*b*clusterEnergyGeV)
56  + ((c*clusterEnergyGeV)*(c*clusterEnergyGeV));
57 
58 // std::cout << "EMClusterEnergyErrorEntry called with (eta, energy) = (" << eta << ", " << clusterEnergy << ")\n";
59 // std::cout << " returned parameters (a, b, c) = (" << a << ", " << b << ", " << c << ")\n";
60 // std::cout << " returned error = " << sqrt(function)*1000.0 << std::endl;
61 
62  return sqrt(function)*1000.0; //MeV
63 
64 }
65 
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
EMClusterEnergyErrorsMatrix::EMClusterEnergyErrorsMatrix
EMClusterEnergyErrorsMatrix()
Definition: EMClusterEnergyErrorsMatrix.cxx:10
EMClusterEnergyErrorsMatrix.h
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
EMClusterEnergyErrorsMatrix::setError
StatusCode setError(double eta, float a, float b, float c)
Definition: EMClusterEnergyErrorsMatrix.cxx:22
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.PyAthena.v
v
Definition: PyAthena.py:157
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
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
EMClusterEnergyErrorsMatrix::getError
double getError(double eta, double energyCluster) const
Get (reconstruction/trigger) efficiency for a track.
Definition: EMClusterEnergyErrorsMatrix.cxx:36
python.compressB64.c
def c
Definition: compressB64.py:93