Commit bce08288 authored by Christos Anastopoulos's avatar Christos Anastopoulos Committed by Johannes Elmsheuser
Browse files

egamma reconstruction more clang-tidy related fixes

parent c320b523
......@@ -265,7 +265,7 @@ private:
* @param evalPoint The evaluation point for which the bin number should be found
* @param binning The binning which should be evaluated
*/
const StatusCode findBin(int& return_bin, const float evalPoint, const std::vector<float>& binning) const;
static const StatusCode findBin(int& return_bin, const float evalPoint, const std::vector<float>& binning) ;
/** @brief Return the interpolation flag of parameter parameter_number as a boolean.
* @param parameter_number Number of the parameter for which the interpolation flag should be checked
......@@ -296,7 +296,7 @@ private:
* @param right_bin_center The x-value of the right bin center used for the interpolation
* @param right_bin_value The y-value of the right bin at the right bin center
*/
float interpolate_function(const float value, const float left_bin_center, const float left_bin_value, const float right_bin_center, const float right_bin_value) const;
static float interpolate_function(const float value, const float left_bin_center, const float left_bin_value, const float right_bin_center, const float right_bin_value) ;
/** @brief Get the events energy density from the eventShape
* @param value The respective correction function parameter value is saved in this parameter
......
......@@ -772,7 +772,7 @@ const StatusCode ElectronPhotonVariableCorrectionBase::get2DHistParameter(float&
}
const StatusCode ElectronPhotonVariableCorrectionBase::findBin(int& return_bin, const float evalPoint, const std::vector<float>& binning) const
const StatusCode ElectronPhotonVariableCorrectionBase::findBin(int& return_bin, const float evalPoint, const std::vector<float>& binning)
{
// need to find the bin in which the evalPoint is
return_bin = -1;
......@@ -918,7 +918,7 @@ const StatusCode ElectronPhotonVariableCorrectionBase::getBinCenter(float& retur
return StatusCode::SUCCESS;
}
float ElectronPhotonVariableCorrectionBase::interpolate_function(const float value, const float left_bin_center, const float left_bin_value, const float right_bin_center, const float right_bin_value) const
float ElectronPhotonVariableCorrectionBase::interpolate_function(const float value, const float left_bin_center, const float left_bin_value, const float right_bin_center, const float right_bin_value)
{
return left_bin_value + (value - left_bin_center) * (right_bin_value - left_bin_value) / (right_bin_center - left_bin_center);
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/*! @file TElectronMCShifterTool.h
......@@ -204,14 +204,14 @@ private :
@param eT The value of eT.
@return The bin associated with the given eT value.
*/
unsigned int getShifterEtBin(double eT) const;
static unsigned int getShifterEtBin(double eT) ;
//! Convert the eta value to eta bin.
/*!
@param eta The value of eta.
@return The bin associated with the given eta value.
*/
unsigned int getShifterEtaBin(double eta) const;
static unsigned int getShifterEtaBin(double eta) ;
};
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "ElectronPhotonShowerShapeFudgeTool/TElectronMCShifterTool.h"
......@@ -18,7 +18,7 @@ TElectronMCShifterTool::TElectronMCShifterTool():
TElectronMCShifterTool::~TElectronMCShifterTool(){}
//---------------------------------------------------------------------------------------
// Gets the Et bin given the et (MeV)
unsigned int TElectronMCShifterTool::getShifterEtBin(double eT) const {
unsigned int TElectronMCShifterTool::getShifterEtBin(double eT) {
const unsigned int nEtBins = 6;
const double GeV = 1000;
const double eTBins[nEtBins] = {10*GeV,15*GeV,20*GeV,30*GeV,40*GeV,50*GeV};
......@@ -33,7 +33,7 @@ unsigned int TElectronMCShifterTool::getShifterEtBin(double eT) const {
//---------------------------------------------------------------------------------------
// Gets the Eta bin [0-8] given the eta
unsigned int TElectronMCShifterTool::getShifterEtaBin(double eta) const{
unsigned int TElectronMCShifterTool::getShifterEtaBin(double eta) {
const unsigned int nEtaBins = 9;
const double etaBins[nEtaBins] = {0.6,0.8,1.15,1.37,1.52,1.81,2.01,2.37,2.47};
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
......@@ -36,8 +36,8 @@ struct XmlVariableInfo {
TString label;
TString varType;
TString nodeName;
float min;
float max;
float min = 0.0F;
float max = 0.0F;
};
TString AnalysisType;
unsigned int NClass;
......
......@@ -477,7 +477,7 @@ StatusCode EgammaPhysValMonitoringTool::procHistograms()
//--------------------------------------------------------------------------------------------
const xAOD::TruthParticle* EgammaPhysValMonitoringTool::Match(const xAOD::Egamma* particle,
int pdg,
const xAOD::TruthParticleContainer* truthParticles) const {
const xAOD::TruthParticleContainer* truthParticles) {
//-------------------------------------------------------------------------------------------
float currentdr = 0.05;
const xAOD::TruthParticle* matchedTruthParticle = nullptr;
......
......@@ -90,8 +90,8 @@ class EgammaPhysValMonitoringTool
StatusCode fillRecoFrwdElecHistograms(const xAOD::TruthParticleContainer* truthParticles, const xAOD::EventInfo* eventInfo);
StatusCode fillRecoPhotHistograms(const xAOD::TruthParticleContainer* truthParticles, const xAOD::EventInfo* eventInfo);
const xAOD::TruthParticle* Match(const xAOD::Egamma* particle, int pdg,
const xAOD::TruthParticleContainer* truthParticles) const;
static const xAOD::TruthParticle* Match(const xAOD::Egamma* particle, int pdg,
const xAOD::TruthParticleContainer* truthParticles) ;
// Containers
......
......@@ -47,7 +47,7 @@ void ElectronPlots::initializePlots(){
nParticles_weighted = Book1D("n_weighted", "Number of "+ m_sParticleType + "s;#" + m_sParticleType + " electrons;Events", 15, 0, 15.);
}
void ElectronPlots::fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) {
void ElectronPlots::fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) const {
m_oKinAllRecoPlots.fill(electron,eventInfo);
m_oShowerShapesAllRecoPlots.fill(electron,eventInfo);
......
......@@ -24,7 +24,7 @@ namespace Egamma{
class ElectronPlots:public PlotBase {
public:
ElectronPlots(PlotBase* pParent, const std::string& sDir, const std::string& sParticleType);
void fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt);
void fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) const;
// Reco only information
Egamma::KinematicsPlots m_oKinAllRecoPlots;
......
......@@ -36,7 +36,7 @@ void ElectronValidationPlots::initializePlots(){
}
void ElectronValidationPlots::fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) {
void ElectronValidationPlots::fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) const {
float weight = 1.;
weight = !eventInfo.beamSpotWeight() ? eventInfo.beamSpotWeight() : 1.;
......
......@@ -19,7 +19,7 @@
class ElectronValidationPlots:public PlotBase {
public:
ElectronValidationPlots(PlotBase* pParent, const std::string& sDir);
void fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt);
void fill(const xAOD::Electron& electron, const xAOD::EventInfo& eventInfo, bool isPrompt) const;
std::string m_sParticleType;
......
......@@ -46,7 +46,7 @@ namespace Egamma{
void IsolationPlots::fill(const xAOD::Egamma& egamma, const xAOD::EventInfo& eventInfo){
void IsolationPlots::fill(const xAOD::Egamma& egamma, const xAOD::EventInfo& eventInfo) const{
FillIsolationPlot(etcone20 ,xAOD::Iso::etcone20, egamma, eventInfo);
FillIsolationPlot(etcone30 ,xAOD::Iso::etcone30, egamma, eventInfo);
FillIsolationPlot(etcone40 ,xAOD::Iso::etcone40, egamma, eventInfo);
......
......@@ -16,7 +16,7 @@ namespace Egamma{
class IsolationPlots:public PlotBase {
public:
IsolationPlots(PlotBase* pParent, const std::string& sDir, std::string sParticleType);
void fill(const xAOD::Egamma& egamma, const xAOD::EventInfo& eventInfo);
void fill(const xAOD::Egamma& egamma, const xAOD::EventInfo& eventInfo) const;
std::string m_sParticleType;
......@@ -35,7 +35,7 @@ class IsolationPlots:public PlotBase {
private:
virtual void initializePlots();
void FillIsolationPlot(TH1* hist, xAOD::Iso::IsolationType isoType, const xAOD::Egamma& egamma, const xAOD::EventInfo& eventInfo);
static void FillIsolationPlot(TH1* hist, xAOD::Iso::IsolationType isoType, const xAOD::Egamma& egamma, const xAOD::EventInfo& eventInfo);
// void FillIsolationPlot(TH1* hist, xAOD::EgammaParameters::IsolationType isoType, const xAOD::Egamma& egamma);//rel19
};
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////////////////
......@@ -145,9 +145,9 @@ public:
private:
/** deletes characters '_',' ','/' and '\\' out of the string*/
std::string beautify(const std::string& s) const;
static std::string beautify(const std::string& s) ;
/** converts int to string */
std::string intToString(long l) const;
static std::string intToString(long l) ;
EMDatabaseIDDescriptor m_idDes; /** Descriptor of DatabaseID*/
};
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include <cstdlib>
......@@ -225,14 +225,14 @@ int EMDatabaseID::setRunOrMCSWV(std::string n)
return 0;
}
std::string EMDatabaseID::beautify(const std::string& s) const
std::string EMDatabaseID::beautify(const std::string& s)
{
std::string n;
for (char i : s) if ((i!=' ') && (i!='_') && (i!='/') && (i!='\\')) n+=i;
return n;
}
std::string EMDatabaseID::intToString(long l) const
std::string EMDatabaseID::intToString(long l)
{
// std::string s;
std::stringstream out;
......
......@@ -20,7 +20,7 @@ EMInsituDatabaseEntry::EMInsituDatabaseEntry()
EMInsituDatabaseEntry::EMInsituDatabaseEntry(const std::string& dbaseID)
{
clear();
setDatabaseID(std::move(dbaseID));
setDatabaseID(dbaseID);
}
/** Default Destructor*/
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef EGAMMAEVENT_EMERRORBUILDER_H
......@@ -357,19 +357,19 @@ class EMErrorDetail : public egDetail
/** @brief get the position eta error; since this is used by the
EMExtrapolCaloConversion tool, it has to be public */
double getClusterEtaPosError(const egamma*,
static double getClusterEtaPosError(const egamma*,
const EMClusterErrorsParametrizations*,
bool forcePhoton = false) const;
bool forcePhoton = false) ;
private:
void set_parameterInt(egammaParameters::ParamDef, int, bool overwrite=false) ;
/** @brief Get the error on cluster energy, eta and phi */
double caloEta(const egamma*, double clusterEta) const;
double getClusterEnergyError(const egamma*, const EMClusterErrorsParametrizations*, bool forcePhoton = false) const;
double getClusterEtaError(const egamma*, const EMClusterErrorsParametrizations*, bool forcePhoton = false) const;
double getClusterPhiError(const egamma*, const EMClusterErrorsParametrizations*, bool forcePhoton = false) const;
static double caloEta(const egamma*, double clusterEta) ;
static double getClusterEnergyError(const egamma*, const EMClusterErrorsParametrizations*, bool forcePhoton = false) ;
static double getClusterEtaError(const egamma*, const EMClusterErrorsParametrizations*, bool forcePhoton = false) ;
static double getClusterPhiError(const egamma*, const EMClusterErrorsParametrizations*, bool forcePhoton = false) ;
/** Obsolete Fill the perigree parameter for converted photon */
......@@ -392,11 +392,11 @@ private:
//** @brief is it an electron? */
// Should maybe make it return electron, photon, or conversion in the future **/
bool isElectron(const egamma*, bool forcePhoton) const;
static bool isElectron(const egamma*, bool forcePhoton) ;
// jacobians
AmgSymMatrix(5) P5Jacobiand0z0PhiThetaE2d0z0PhiEtaE(const double phi) const;
AmgSymMatrix(4) P4JacobiandEThetaPhiM2EEtaPhiM(const double theta) const;
static AmgSymMatrix(5) P5Jacobiand0z0PhiThetaE2d0z0PhiEtaE(const double phi) ;
static AmgSymMatrix(4) P4JacobiandEThetaPhiM2EEtaPhiM(const double theta) ;
std::vector< std::pair<egammaParameters::ParamDef,double> > m_parameters;
std::vector< std::pair<egammaParameters::ParamDef,int> > m_parametersInt;
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "egammaEvent/EMErrorDetail.h"
......@@ -126,7 +126,7 @@ void EMErrorDetail::set_parameter(egammaParameters::ParamDef key, double value,
}
// =======================================================================
bool EMErrorDetail::isElectron(const egamma* eg, bool forcePhoton) const
bool EMErrorDetail::isElectron(const egamma* eg, bool forcePhoton)
{
return (!forcePhoton && ((eg->conversion() != nullptr) || (eg->trackParticle() != nullptr)));
}
......@@ -134,7 +134,7 @@ bool EMErrorDetail::isElectron(const egamma* eg, bool forcePhoton) const
// =======================================================================
double EMErrorDetail::getClusterEtaPosError(const egamma* eg,
const EMClusterErrorsParametrizations* pars,
bool forcePhoton) const
bool forcePhoton)
{
EMClusterErrorsParametrizations::Type tp = isElectron(eg, forcePhoton) ?
......@@ -168,7 +168,7 @@ double EMErrorDetail::getClusterEtaPosError(const egamma* eg,
// =======================================================================
double EMErrorDetail::getClusterEnergyError(const egamma* eg,
const EMClusterErrorsParametrizations* pars,
bool forcePhoton ) const
bool forcePhoton )
{
EMClusterErrorsParametrizations::Type tp = isElectron(eg, forcePhoton) ?
......@@ -185,7 +185,7 @@ double EMErrorDetail::getClusterEnergyError(const egamma* eg,
// =======================================================================
double EMErrorDetail::getClusterEtaError(const egamma* eg,
const EMClusterErrorsParametrizations* pars,
bool forcePhoton ) const
bool forcePhoton )
{
EMClusterErrorsParametrizations::Type tp = isElectron(eg, forcePhoton) ?
......@@ -212,7 +212,7 @@ double EMErrorDetail::getClusterEtaError(const egamma* eg,
// =======================================================================
double EMErrorDetail::getClusterPhiError(const egamma* eg,
const EMClusterErrorsParametrizations* pars,
bool forcePhoton ) const
bool forcePhoton )
{
EMClusterErrorsParametrizations::Type tp = isElectron(eg, forcePhoton) ?
......@@ -228,7 +228,7 @@ double EMErrorDetail::getClusterPhiError(const egamma* eg,
// ===================================================================
double EMErrorDetail::caloEta(const egamma* eg, double clusterEta) const {
double EMErrorDetail::caloEta(const egamma* eg, double clusterEta) {
const double etaPointing = eg->detailValue(egammaParameters::etap);
if ( fabs(etaPointing - clusterEta ) < 0.15 ) {
......@@ -733,7 +733,7 @@ int EMErrorDetail::hasSiliconHits() const {return intParameter(egammaParameters
void EMErrorDetail::set_hasSiliconHits (int x) {set_parameterInt(egammaParameters::hasSiliconHits, x, true) ;}
AmgSymMatrix(5) EMErrorDetail::P5Jacobiand0z0PhiThetaE2d0z0PhiEtaE(const double theta) const
AmgSymMatrix(5) EMErrorDetail::P5Jacobiand0z0PhiThetaE2d0z0PhiEtaE(const double theta)
{
AmgSymMatrix(5) m;
m.setIdentity();
......@@ -741,7 +741,7 @@ AmgSymMatrix(5) EMErrorDetail::P5Jacobiand0z0PhiThetaE2d0z0PhiEtaE(const double
return m;
}
AmgSymMatrix(4) EMErrorDetail::P4JacobiandEThetaPhiM2EEtaPhiM(const double theta) const
AmgSymMatrix(4) EMErrorDetail::P4JacobiandEThetaPhiM2EEtaPhiM(const double theta)
{
AmgSymMatrix(4) m;
m.setIdentity();
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "egammaLayerRecalibTool/corr_HV_EMBPS.h"
......@@ -96,7 +96,7 @@ float corr_HV_EMBPS::getCorr(int run, float eta,float phi) const
//===============================================================================
// return scale factor of response vs HV used in reconstruction
float corr_HV_EMBPS::getRecoCorrection(float hv,float eta) const
float corr_HV_EMBPS::getRecoCorrection(float hv,float eta)
{
float nominal = 2000.;
float T = 88.37;
......@@ -117,7 +117,7 @@ float corr_HV_EMBPS::getRecoCorrection(float hv,float eta) const
}
//===============================================================================
float corr_HV_EMBPS::Respo(float e, float e_nominal,float tempe) const
float corr_HV_EMBPS::Respo(float e, float e_nominal,float tempe)
{
if (e < -999.) return 1.;
if (e < 0.01) return 0;
......@@ -127,7 +127,7 @@ float corr_HV_EMBPS::Respo(float e, float e_nominal,float tempe) const
}
//===============================================================================
float corr_HV_EMBPS::InvCharge(float e) const
float corr_HV_EMBPS::InvCharge(float e)
{
float q = 1.;
if ( e > 2.) q=(1.+0.36/e);
......@@ -136,7 +136,7 @@ float corr_HV_EMBPS::InvCharge(float e) const
}
//===============================================================================
float corr_HV_EMBPS::vdrift(float e, float tempe) const
float corr_HV_EMBPS::vdrift(float e, float tempe)
{
const float T = tempe;
static const float P[6] = {-0.01481,-0.0075,0.141,12.4,1.627,0.317};
......@@ -147,7 +147,7 @@ float corr_HV_EMBPS::vdrift(float e, float tempe) const
//===============================================================================
float corr_HV_EMBPS::getDataCorrection(float hv,float eta) const
float corr_HV_EMBPS::getDataCorrection(float hv,float eta)
//
// values are measured 1 + <Eraw0_end of run>-<Eraw0 beginning of run> / <Eraw0> (i.e <Eraw end>/<Eraw begin>)
// for the sectors with both sides going from 1600->1200V from beginning to end of run
......@@ -168,7 +168,7 @@ float corr_HV_EMBPS::getDataCorrection(float hv,float eta) const
}
//===============================================================================
float corr_HV_EMBPS::getExtraScaleFactor() const
float corr_HV_EMBPS::getExtraScaleFactor()
{
return 1.013;
}
......@@ -169,7 +169,7 @@ void ScaleEcalorimeter::shift_inputs(StdCalibrationInputs & inputs, float amount
inputs.E3raw += amount;
}
std::string egammaLayerRecalibTool::resolve_alias(const std::string& tune) const {
std::string egammaLayerRecalibTool::resolve_alias(const std::string& tune) {
if ("layer1_2012" == tune) return "layer1_2012_v5";
if ("layer1_alt_2012" == tune) return "layer1_alt_2012_v5";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment