Skip to content
Snippets Groups Projects
Commit 462d7a57 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'coverity_egammaValidation' into 'master'

ATLASSQ-81: Coverity fix for egammaValidation

See merge request atlas/athena!14848
parents 7e7b9c6f d8eee174
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,6 @@ namespace egammaMonitoring{
public:
// Electron Plot(s)
TH1* TrkToEl; //!
using ParticleHistograms::ParticleHistograms;
using ParticleHistograms::initializePlots;
StatusCode initializePlots();
......
......@@ -22,22 +22,23 @@ StatusCode RecoPhotonHistograms::initializePlots() {
void RecoPhotonHistograms::fill(const xAOD::IParticle& phrec) {
float trueR = -999;
ParticleHistograms::fill(phrec);
m_tmp = xAOD::TruthHelpers::getTruthParticle(phrec);
m_trueR = -999;
const xAOD::TruthParticle *tmp = xAOD::TruthHelpers::getTruthParticle(phrec);
if (m_tmp) {
if (m_tmp->pdgId() == 22 && m_tmp->hasDecayVtx()) {
if (tmp) {
if (tmp->pdgId() == 22 && tmp->hasDecayVtx()) {
m_x = m_tmp->decayVtx()->x();
m_y = m_tmp->decayVtx()->y();
m_trueR = sqrt( m_x*m_x + m_y*m_y );
float x = tmp->decayVtx()->x();
float y = tmp->decayVtx()->y();
trueR = sqrt( x*x + y*y );
}
}
histoMap["convRadius"]->Fill(m_trueR);
histoMap["convRadius"]->Fill(trueR);
} // fill
......@@ -28,10 +28,7 @@ namespace egammaMonitoring {
private:
const xAOD::TruthParticle *m_tmp;
float m_cR_bins[15] = {0, 50, 89, 123, 170, 210, 250, 299, 335, 371, 443, 514, 554, 800, 1085};
float m_x, m_y, m_trueR;
};
......
......@@ -38,31 +38,26 @@ StatusCode ShowerShapesHistograms::initializePlots() {
} // initializePlots
void ShowerShapesHistograms::fill(const xAOD::Egamma& egamma) {
float eta2 = -999, rhad = -999, rhad1 = -999, hadrleak = -999, Reta = -999, Rphi = -999, shweta2 = -999, Eratio = -999, DeltaE = -999, frac_f1 = -999, shfside = -999, shwtots1= -999, shws3= -999;
eta2 = fabs(egamma.caloCluster()->etaBE(2));
m_eta2 = fabs(egamma.caloCluster()->etaBE(2));
if(egamma.showerShapeValue(m_rhad , xAOD::EgammaParameters::Rhad) &&
egamma.showerShapeValue(m_rhad1, xAOD::EgammaParameters::Rhad1)) {
if(egamma.showerShapeValue(rhad , xAOD::EgammaParameters::Rhad) &&
egamma.showerShapeValue(rhad1, xAOD::EgammaParameters::Rhad1)) {
m_hadrleak = (m_eta2 >= 0.8 && m_eta2 < 1.37) ? m_rhad : m_rhad1;
histoMap["hadleak"]->Fill(m_hadrleak);
hadrleak = (eta2 >= 0.8 && eta2 < 1.37) ? rhad : rhad1;
histoMap["hadleak"]->Fill(hadrleak);
}
if(egamma.showerShapeValue(m_Reta, xAOD::EgammaParameters::Reta)) histoMap["reta"]->Fill(m_Reta);
if(egamma.showerShapeValue(m_Rphi, xAOD::EgammaParameters::Rphi)) histoMap["rphi"]->Fill(m_Rphi);
if(egamma.showerShapeValue(m_shweta2, xAOD::EgammaParameters::weta2)) histoMap["weta2"]->Fill(m_shweta2);
if(egamma.showerShapeValue(m_Eratio, xAOD::EgammaParameters::Eratio)) histoMap["eratio"]->Fill(m_Eratio);
if(egamma.showerShapeValue(m_DeltaE, xAOD::EgammaParameters::DeltaE)) histoMap["deltae"]->Fill(m_DeltaE);
if(egamma.showerShapeValue(m_frac_f1 , xAOD::EgammaParameters::f1)) histoMap["f1"]->Fill(m_frac_f1);
if(egamma.showerShapeValue(m_shfside, xAOD::EgammaParameters::fracs1)) histoMap["fside"]->Fill(m_shfside);
if(egamma.showerShapeValue(m_shwtots1, xAOD::EgammaParameters::wtots1)) histoMap["wtots1"]->Fill(m_shwtots1);
if(egamma.showerShapeValue(m_shws3, xAOD::EgammaParameters::weta1)) histoMap["ws3"]->Fill(m_shws3);
if(egamma.showerShapeValue(Reta, xAOD::EgammaParameters::Reta)) histoMap["reta"]->Fill(Reta);
if(egamma.showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi)) histoMap["rphi"]->Fill(Rphi);
if(egamma.showerShapeValue(shweta2, xAOD::EgammaParameters::weta2)) histoMap["weta2"]->Fill(shweta2);
if(egamma.showerShapeValue(Eratio, xAOD::EgammaParameters::Eratio)) histoMap["eratio"]->Fill(Eratio);
if(egamma.showerShapeValue(DeltaE, xAOD::EgammaParameters::DeltaE)) histoMap["deltae"]->Fill(DeltaE);
if(egamma.showerShapeValue(frac_f1 , xAOD::EgammaParameters::f1)) histoMap["f1"]->Fill(frac_f1);
if(egamma.showerShapeValue(shfside, xAOD::EgammaParameters::fracs1)) histoMap["fside"]->Fill(shfside);
if(egamma.showerShapeValue(shwtots1, xAOD::EgammaParameters::wtots1)) histoMap["wtots1"]->Fill(shwtots1);
if(egamma.showerShapeValue(shws3, xAOD::EgammaParameters::weta1)) histoMap["ws3"]->Fill(shws3);
}
......@@ -38,9 +38,6 @@ namespace egammaMonitoring{
std::string m_folder;
ITHistSvc* m_rootHistSvc = nullptr;
float m_eta2, m_rhad, m_rhad1, m_hadrleak, m_Reta, m_Rphi, m_shweta2, m_Eratio, m_DeltaE, m_frac_f1, m_shfside, m_shwtots1, m_shws3;
};
......
......@@ -23,22 +23,23 @@ StatusCode TruthPhotonHistograms::initializePlots() {
void TruthPhotonHistograms::fill(const xAOD::IParticle& phrec) {
float trueR = -999;
ParticleHistograms::fill(phrec);
m_tmp = xAOD::TruthHelpers::getTruthParticle(phrec);
m_trueR = -999;
const xAOD::TruthParticle *tmp = xAOD::TruthHelpers::getTruthParticle(phrec);
if (m_tmp) {
if (m_tmp->pdgId() == 22 && m_tmp->hasDecayVtx()) {
if (tmp) {
if (tmp->pdgId() == 22 && tmp->hasDecayVtx()) {
m_x = m_tmp->decayVtx()->x();
m_y = m_tmp->decayVtx()->y();
m_trueR = sqrt( m_x*m_x + m_y*m_y );
float x = tmp->decayVtx()->x();
float y = tmp->decayVtx()->y();
trueR = sqrt( x*x + y*y );
}
}
histoMap["convRadius"]->Fill(m_trueR);
histoMap["convRadius"]->Fill(trueR);
} // fill
......@@ -28,10 +28,7 @@ namespace egammaMonitoring {
private:
const xAOD::TruthParticle *m_tmp;
float m_cR_bins[15] = {0, 50, 89, 123, 170, 210, 250, 299, 335, 371, 443, 514, 554, 800, 1085};
float m_x, m_y, m_trueR;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment