ATLAS Offline Software
EMClusterPhiErrorsMatrix.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 EMClusterPhiErrorsMatrix::EMClusterPhiErrorsMatrix(const std::vector<EMAPMatrixAxis> &axes,
19  const std::string& textDescription) :
20  EMClusterErrorsMatrix(axes, textDescription)
21 {
22 }
23 
25 StatusCode EMClusterPhiErrorsMatrix::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 EMClusterPhiErrorsMatrix::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 
53  const double a = params->at(0); // a should be in radians, not mrad
54 
55 // std::cout << "EMClusterPhiErrorEntry called with (eta, energy) = (" << eta << ", " << clusterEnergy << ")\n";
56 // std::cout << " returned parameters a = " << a << "\n";
57 // std::cout << " returned error = " << (a /sqrt(clusterEnergyGeV)) << std::endl;
58 
59  return (a /sqrt(clusterEnergyGeV));
60 
61 }
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
EMClusterPhiErrorsMatrix::EMClusterPhiErrorsMatrix
EMClusterPhiErrorsMatrix()
Definition: EMClusterPhiErrorsMatrix.cxx:12
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
EMClusterPhiErrorsMatrix::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: EMClusterPhiErrorsMatrix.cxx:25
EMClusterPhiErrorsMatrix::getError
double getError(double eta, double energyCluster) const
Get (reconstruction/trigger) efficiency for a track.
Definition: EMClusterPhiErrorsMatrix.cxx:38
python.PyAthena.v
v
Definition: PyAthena.py:154
a
TList * a
Definition: liststreamerinfos.cxx:10
EMClusterErrorsMatrix
Definition: EMClusterErrorsMatrix.h:26
EMClusterPhiErrorsMatrix.h
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