ATLAS Offline Software
EMClusterEtaErrorsMatrix.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 
11 // Constructors
14 {
15 }
16 
17 
18 EMClusterEtaErrorsMatrix::EMClusterEtaErrorsMatrix(const std::vector<EMAPMatrixAxis> &axes,
19  const std::string& textDescription) :
20  EMClusterErrorsMatrix(axes, textDescription)
21 {
22 }
23 
25 StatusCode EMClusterEtaErrorsMatrix::setError(double eta, float a) // a should be in rad, not mrad
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 
33  return EMClusterErrorsMatrix::setError(v, apEntry);
34 }
35 
37 // which eta should we use? Should look at note.
38 double EMClusterEtaErrorsMatrix::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  if (fabs(eta) > 8.0) eta = 8.0;
48 
49  const double clusterEnergyGeV = clusterEnergy*(1./Gaudi::Units::GeV); //GeV
50 
54  const double a = params->at(0); // a should be in radians, not mrad
55  const double sigma_theta = a /sqrt(clusterEnergyGeV);
56 
58  const double theta = 2.*atan(exp(-eta));
59 
60 // std::cout << "EMClusterEtaErrorEntry called with (eta, energy) = (" << eta << ", " << clusterEnergy << ")\n";
61 // std::cout << " returned parameters a = " << a << "\n";
62 // std::cout << " returned error = " << fabs(sigma_theta/sin(theta)) << std::endl;
63 
65  return ( fabs(sigma_theta/sin(theta)) );
66 }
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
EMClusterEtaErrorsMatrix::getError
double getError(double eta, double energyCluster) const
Get (reconstruction/trigger) efficiency for a track.
Definition: EMClusterEtaErrorsMatrix.cxx:38
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
EMClusterEtaErrorsMatrix::setError
StatusCode setError(double eta, float a)
Add the outcome of the test at the given "eta" and "pt" value, i.e. if the reconstruction was success...
Definition: EMClusterEtaErrorsMatrix.cxx:25
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
python.PyAthena.v
v
Definition: PyAthena.py:157
a
TList * a
Definition: liststreamerinfos.cxx:10
EMClusterEtaErrorsMatrix::EMClusterEtaErrorsMatrix
EMClusterEtaErrorsMatrix()
Definition: EMClusterEtaErrorsMatrix.cxx:12
EMClusterErrorsMatrix
Definition: EMClusterErrorsMatrix.h:26
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
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
EMClusterEtaErrorsMatrix.h