18 return StatusCode::SUCCESS;
24 if (!cluster) {
return StatusCode::FAILURE; }
26 ptGeV = cluster->
pt() * 1e-3f;
27 return StatusCode::SUCCESS;
45 return StatusCode::SUCCESS;
53 float eta = 0.f, ptGeV = 0.f;
56 const float ptGeV_capped = std::min(ptGeV, 700.f);
58 float reta = 0.f, rphi = 0.f, weta2 = 0.f, fracs1 = 0.f, weta1 = 0.f, wtots1 = 0.f, rhad = 0.f, rhad1 = 0.f, eratio = 0.f, deltaE = 0.f;
77 deltaE = std::round(deltaE);
80 vars.push_back(ptGeV_capped);
84 vars.push_back(weta2);
85 vars.push_back(fracs1);
86 vars.push_back(weta1);
87 vars.push_back(wtots1);
89 vars.push_back(rhad1);
90 vars.push_back(eratio);
91 vars.push_back(deltaE);
93 return StatusCode::SUCCESS;
100 float eta = 0.f, ptGeV = 0.f;
103 const float ptGeV_capped = std::min(ptGeV, 700.f);
105 float reta = 0.f, rphi = 0.f, weta2 = 0.f, fracs1 = 0.f, weta1 = 0.f, wtots1 = 0.f, rhad = 0.f, rhad1 = 0.f, eratio = 0.f, deltaE = 0.f;
124 deltaE = std::round(deltaE);
127 vars.push_back(ptGeV_capped);
129 vars.push_back(reta);
130 vars.push_back(rphi);
131 vars.push_back(weta2);
132 vars.push_back(fracs1);
133 vars.push_back(weta1);
134 vars.push_back(wtots1);
135 vars.push_back(rhad);
136 vars.push_back(rhad1);
137 vars.push_back(eratio);
138 vars.push_back(deltaE);
140 return StatusCode::SUCCESS;
151 decScore(ph) = score;
152 return StatusCode::SUCCESS;
158 score = accScore(ph);
159 return StatusCode::SUCCESS;
161 std::vector<float> vars;
169 return StatusCode::SUCCESS;
175 throw std::invalid_argument(
"PhotonBDTCalculator::evaluate called with nullptr photon");
179 const StatusCode
sc =
getScore(*photon, score);
180 if (
sc.isFailure()) {
182 throw std::runtime_error(
"PhotonBDTCalculator::evaluate failed to compute BDT score");
184 return static_cast<double>(score);
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode getScore(const xAOD::Photon &ph, float &score) const
Return the score (computes if needed if m_forceRecompute is true).
Gaudi::Property< bool > m_excludeTRT
StatusCode fillVariablesConv(const xAOD::Photon &ph, std::vector< float > &vars) const
virtual double evaluate(const xAOD::Photon *photon) const override
virtual ~PhotonBDTCalculator() override
Gaudi::Property< bool > m_forceRecompute
bool isConverted(const xAOD::Photon &ph) const
Gaudi::Property< unsigned > m_reserveVarsConv
StatusCode fillVariablesUnconv(const xAOD::Photon &ph, std::vector< float > &vars) const
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Gaudi::Property< std::string > m_decorationName
ToolHandle< PhotonSingleBDTCalculator > m_toolConv
ToolHandle< PhotonSingleBDTCalculator > m_toolUnconv
StatusCode decorate(const xAOD::Photon &ph) const
Compute and decorate the photon with the BDT score.
Gaudi::Property< unsigned > m_reserveVarsUnconv
PhotonBDTCalculator(const std::string &name)
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters).
virtual double eta() const
The pseudorapidity ( ) of the particle.
bool showerShapeValue(float &value, const EgammaParameters::ShowerShapeType information) const
Accessor for ShowerShape values.
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
@ wtots1
shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips...
@ Eratio
(emaxs1-e2tsts1)/(emaxs1+e2tsts1)
@ fracs1
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strip...
@ weta2
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...
@ weta1
shower width using +/-3 strips around the one with the maximal energy deposit: w3 strips = sqrt{sum(E...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Photon_v1 Photon
Definition of the current "egamma version".