Commit 7611b05a authored by Christos Anastopoulos's avatar Christos Anastopoulos Committed by Edward Moyse
Browse files

TrkFitters, TrkExtrapolation. Try to avoid unitialized variables (clang-tidy)....

TrkFitters, TrkExtrapolation. Try to avoid unitialized variables (clang-tidy). Also add make members that could be const const
parent 03003bd1
......@@ -307,7 +307,7 @@ egammaTruthAssociationAlg::particleTruthClassifier(
const T* particle,
Cache* extrapolationCache) const
{
MCTruthInfo_t info;
MCTruthInfo_t info{};
IMCTruthClassifier::Info mcinfo(ctx);
mcinfo.extrapolationCache = extrapolationCache;
auto ret = m_mcTruthClassifier->particleTruthClassifier(particle, &mcinfo);
......@@ -326,7 +326,7 @@ egammaTruthAssociationAlg::particleTruthClassifier<xAOD::Electron>(
const xAOD::Electron* electron,
Cache* extrapolationCache) const
{
MCTruthInfo_t info;
MCTruthInfo_t info{};
IMCTruthClassifier::Info mcinfo(ctx);
mcinfo.extrapolationCache = extrapolationCache;
auto ret = m_mcTruthClassifier->particleTruthClassifier(electron, &mcinfo);
......
......@@ -177,8 +177,8 @@ private:
Gaudi::Property<bool> m_doPhotons {this, "doPhotons", true, "Run the Photon reconstruction"};
Gaudi::Property<bool> m_doElectrons {this, "doElectrons", true, "Run the Electron reconstruction"};
electronPearShapeAlignmentCorrection m_deltaEta1Pear;
bool m_doAmbiguity;
bool m_doOQ;
bool m_doAmbiguity{};
bool m_doOQ{};
};
#endif
......@@ -2,66 +2,66 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CORR_HV_EMBPS_H
#define CORR_HV_EMBPS_H
#include "TProfile2D.h"
#include "TFile.h"
/**
@class corr_HV_EMBPS
@brief Correction for time dependent HV effect in barrel presampler scale in 2012
Perform correction of E0_RAW (EMPBS) as function of run number, eta, phi to recover
effective scale at 1600V at the beginning of 2012
Data are divided intwo 6 time snapshots
runs 200804-204910 (nominal 1600V for most EMBPS, 2000V EMECPS)
runs 204932-205071 (20 EMBPS lines lowered to 1400V)
runs 205112-211620 (22 EMBPS lines lowered from 1400 to 1200V)
runs 211670-212272 (all EMBPS lowered to 1200V) (+changed in OFC / Mphys/Mcal) [main change for EMPBS]
runs 212619-212742 (14 EMBPS lines lowered to 800V, all EMECPS lowered to 1600V) [main change for EMECPS]
runs 212809-216432 ( 6 EMBPS lines lowered to 800V, 7 EMECPS lines lowered to 1200V)
The 1200->1600 and 800->1600 HV scale factors for the >211670 runs are derived from data
For run<211670 an extra small correction is applied on top to account for the change in OFC / MphysMcal computation
at run 211670 (using drift time for HV=1200V instead of old drift time for HV=2000V)
*/
class corr_HV_EMBPS {
public:
/** @brief constructor (initialization done there reading a root file for the HV maps per period */
corr_HV_EMBPS();
~corr_HV_EMBPS();
/** @brief get correction factor to apply to raw EMBPS energy : corrected raw EMBPS energy = correction factor * raw uncorrected EMBPS energy */
/** @brief inputs: run number, eta and phi */
float getCorr(int run, float eta, float phi) const;
private:
// response factor as computed in reconstruction
// (E measured = E nominalHV * response factor(HV)
float getRecoCorrection(float hv,float eta) const;
// functions to computed scale factor as in reconstruction
float Respo(float e, float e_nominal,float tempe) const;
float InvCharge(float e) const;
float vdrift(float e, float tempe) const;
// extra response factor derive from latest data
// (E measured data) = (E corrected by reconstruction)* extra response factor (HV) for run >=211670
float getDataCorrection(float hv,float eta) const;
// change to extra response factor to apply to data before run 211670 for HV<1600 to account for the fact that
// OFC and Mphys/Mcal where changed at run 211670 to be computed with HV=1200 instead of HV=2000
float getExtraScaleFactor() const;
// store HV corrections for 6 periods, and 2 sides
// each histogram has 8 bins in eta (deltaEta=0.4) and 32 bins in phi (2pi/32)
TProfile2D* m_hHV[6][2];
TFile* m_file;
};
#endif
#ifndef CORR_HV_EMBPS_H
#define CORR_HV_EMBPS_H
#include "TProfile2D.h"
#include "TFile.h"
/**
@class corr_HV_EMBPS
@brief Correction for time dependent HV effect in barrel presampler scale in 2012
Perform correction of E0_RAW (EMPBS) as function of run number, eta, phi to recover
effective scale at 1600V at the beginning of 2012
Data are divided intwo 6 time snapshots
runs 200804-204910 (nominal 1600V for most EMBPS, 2000V EMECPS)
runs 204932-205071 (20 EMBPS lines lowered to 1400V)
runs 205112-211620 (22 EMBPS lines lowered from 1400 to 1200V)
runs 211670-212272 (all EMBPS lowered to 1200V) (+changed in OFC / Mphys/Mcal) [main change for EMPBS]
runs 212619-212742 (14 EMBPS lines lowered to 800V, all EMECPS lowered to 1600V) [main change for EMECPS]
runs 212809-216432 ( 6 EMBPS lines lowered to 800V, 7 EMECPS lines lowered to 1200V)
The 1200->1600 and 800->1600 HV scale factors for the >211670 runs are derived from data
For run<211670 an extra small correction is applied on top to account for the change in OFC / MphysMcal computation
at run 211670 (using drift time for HV=1200V instead of old drift time for HV=2000V)
*/
class corr_HV_EMBPS {
public:
/** @brief constructor (initialization done there reading a root file for the HV maps per period */
corr_HV_EMBPS();
~corr_HV_EMBPS();
/** @brief get correction factor to apply to raw EMBPS energy : corrected raw EMBPS energy = correction factor * raw uncorrected EMBPS energy */
/** @brief inputs: run number, eta and phi */
float getCorr(int run, float eta, float phi) const;
private:
// response factor as computed in reconstruction
// (E measured = E nominalHV * response factor(HV)
float getRecoCorrection(float hv,float eta) const;
// functions to computed scale factor as in reconstruction
float Respo(float e, float e_nominal,float tempe) const;
float InvCharge(float e) const;
float vdrift(float e, float tempe) const;
// extra response factor derive from latest data
// (E measured data) = (E corrected by reconstruction)* extra response factor (HV) for run >=211670
float getDataCorrection(float hv,float eta) const;
// change to extra response factor to apply to data before run 211670 for HV<1600 to account for the fact that
// OFC and Mphys/Mcal where changed at run 211670 to be computed with HV=1200 instead of HV=2000
float getExtraScaleFactor() const;
// store HV corrections for 6 periods, and 2 sides
// each histogram has 8 bins in eta (deltaEta=0.4) and 32 bins in phi (2pi/32)
TProfile2D* m_hHV[6][2]{};
TFile* m_file;
};
#endif
#ifndef CORR_HV_EMECPS_H
#define CORR_HV_EMECPS_H
#include "TH2D.h"
#include "TFile.h"
/**
@class corr_HV_EMECPS
@brief Correction for wrong HV EMEC presampler correction for 20.7 processed data (2015,2016)
Perform correction of E0_RAW (EMEC PS) as function of run number and phi
*/
class corr_HV_EMECPS {
public:
/** @brief constructor (initialization done there reading a root file for the HV maps per period */
corr_HV_EMECPS();
~corr_HV_EMECPS();
/** @brief get correction factor to apply to raw EMECPS energy : corrected raw EMECPS energy = correction factor * raw uncorrected EMECPS energy */
/** @brief inputs: run number, eta and phi */
float getCorr(int run, float eta, float phi) const;
private:
// store HV corrections in 2D hist (phi-runnumber) for EMECA and EMECC separately
TH2D* m_HV[2];
TFile* m_file;
};
#endif
#ifndef CORR_HV_EMECPS_H
#define CORR_HV_EMECPS_H
#include "TH2D.h"
#include "TFile.h"
/**
@class corr_HV_EMECPS
@brief Correction for wrong HV EMEC presampler correction for 20.7 processed data (2015,2016)
Perform correction of E0_RAW (EMEC PS) as function of run number and phi
*/
class corr_HV_EMECPS {
public:
/** @brief constructor (initialization done there reading a root file for the HV maps per period */
corr_HV_EMECPS();
~corr_HV_EMECPS();
/** @brief get correction factor to apply to raw EMECPS energy : corrected raw EMECPS energy = correction factor * raw uncorrected EMECPS energy */
/** @brief inputs: run number, eta and phi */
float getCorr(int run, float eta, float phi) const;
private:
// store HV corrections in 2D hist (phi-runnumber) for EMECA and EMECC separately
TH2D* m_HV[2]{};
TFile* m_file;
};
#endif
#ifndef CORR_PILEUPHIFT_H
#define CORR_PILEUPHIFT_H
#include "TH1D.h"
#include "TFile.h"
/**
@class corr_pileupShift
@brief Correction for pileup induced energy shit as function of mu per layer for 2016 data
@author: Guillaume Unal
*/
class corr_pileupShift {
public:
/** @brief constructor (initialization done there reading a root file for the HV maps per period */
corr_pileupShift();
~corr_pileupShift();
/** @brief get shift to subtract to raw layer energy : corrected layer energy = raw energy - shift */
/** @brief inputs: layer (0 to 3), run (run number), mu (average number of interactions per crossing) and eta */
float getCorr(int layer, int run, float mu, float eta) const;
private:
// run range to apply the correction: 2016 data 296939 to 311563
int m_runMin, m_runMax;
// store corrections/mu vs eta per layer
TH1D* m_haverage[4];
TFile* m_file;
};
#endif
#ifndef CORR_PILEUPHIFT_H
#define CORR_PILEUPHIFT_H
#include "TH1D.h"
#include "TFile.h"
/**
@class corr_pileupShift
@brief Correction for pileup induced energy shit as function of mu per layer for 2016 data
@author: Guillaume Unal
*/
class corr_pileupShift {
public:
/** @brief constructor (initialization done there reading a root file for the HV maps per period */
corr_pileupShift();
~corr_pileupShift();
/** @brief get shift to subtract to raw layer energy : corrected layer energy = raw energy - shift */
/** @brief inputs: layer (0 to 3), run (run number), mu (average number of interactions per crossing) and eta */
float getCorr(int layer, int run, float mu, float eta) const;
private:
// run range to apply the correction: 2016 data 296939 to 311563
int m_runMin, m_runMax;
// store corrections/mu vs eta per layer
TH1D* m_haverage[4]{};
TFile* m_file;
};
#endif
......@@ -10,7 +10,7 @@
std::array<float, 4> get_MVAradius(float eta)
{
eta = std::abs(eta);
std::array<float, 4> radius;
std::array<float, 4> radius{};
if (eta / 0.025 < 57)
{
static const float
......
......@@ -133,9 +133,9 @@ private:
std::vector<ElementLink<xAOD::TrackParticleContainer>> m_trackParticles;
std::vector<ElementLink<xAOD::VertexContainer>> m_vertices;
std::array<double, 4> m_deltaEta;
std::array<double, 4> m_deltaPhi;
std::array<double, 4> m_deltaPhiRescaled;
std::array<double, 4> m_deltaEta{};
std::array<double, 4> m_deltaPhi{};
std::array<double, 4> m_deltaPhiRescaled{};
double m_deltaPhiLast;
float m_deltaEtaVtx;
......
......@@ -272,7 +272,7 @@ EMTrackMatchBuilder::inBroadWindow(const EventContext& ctx,
* Done with extrapolation
* Lets do the matching logic
*/
TrackMatch trkmatch;
TrackMatch trkmatch{};
// Add the matching variable to the TrackMAtch
trkmatch.deltaEta = deltaEta;
trkmatch.deltaPhi = deltaPhi;
......
......@@ -243,9 +243,9 @@ private:
"Boolean for use of cosmics" };
// Calculated values based on resolutions
double m_deltaEtaWeight;
double m_deltaPhiWeight;
double m_deltaPhiRescaleWeight;
double m_deltaEtaWeight{};
double m_deltaPhiWeight{};
double m_deltaPhiRescaleWeight{};
TrackMatchSorter m_sorter;
};
......
......@@ -76,8 +76,8 @@ namespace Trk {
mutable int m_layerIndex; //!< the layer index given by the TrackingGeometry
mutable int m_layerType; //!< the type of the layer 1 - cylinder, 2 - disk
mutable float m_layerTranslation[3]; //!< center of the transform
mutable float m_layerRotation[9]; //!< orientation of the layer
mutable float m_layerTranslation[3]{}; //!< center of the transform
mutable float m_layerRotation[9]{}; //!< orientation of the layer
mutable float m_layerDimension0; //!< dimension 0 : cylinder r, disk r_min
mutable float m_layerDimension1; //!< dimension 1 : cylinder z, disk r_max
mutable int m_layerBins; //!< total number of bins - loc0 * loc 1
......
......@@ -275,24 +275,24 @@ namespace Trk {
mutable float m_mappedPathRho; //!< total mapped path times rho
mutable float m_mappedPathZARho; //!< total mapped path times (Z/A)*rho
mutable float m_unmappedPathInX0; //!< total path in x0 in these events lost
mutable int m_mapped[TRKDETDESCRTOOLS_MAXSTEPS]; //!< mapped or not mapped
mutable float m_materialAccumPathInX0[TRKDETDESCRTOOLS_MAXSTEPS]; //!< accumulated path length in x0
mutable float m_materialAccumPathZARho[TRKDETDESCRTOOLS_MAXSTEPS]; //!< accumulated path length times (Z/A)*rho
mutable float m_materialStepPath[TRKDETDESCRTOOLS_MAXSTEPS]; //!< step path
mutable float m_materialStepX0[TRKDETDESCRTOOLS_MAXSTEPS]; //!< step x0
mutable float m_materialStepL0[TRKDETDESCRTOOLS_MAXSTEPS]; //!< step l0
mutable float m_materialStepZ[TRKDETDESCRTOOLS_MAXSTEPS]; //!< step Z
mutable float m_materialStepA[TRKDETDESCRTOOLS_MAXSTEPS]; //!< step A
mutable float m_materialStepRho[TRKDETDESCRTOOLS_MAXSTEPS]; //!< step rho
mutable float m_materialStepPositionX[TRKDETDESCRTOOLS_MAXSTEPS]; //!< x position of the material recording
mutable float m_materialStepPositionY[TRKDETDESCRTOOLS_MAXSTEPS]; //!< y position of the material recording
mutable float m_materialStepPositionZ[TRKDETDESCRTOOLS_MAXSTEPS]; //!< z position of the material recording
mutable float m_materialStepPositionR[TRKDETDESCRTOOLS_MAXSTEPS]; //!< r value of the material recording
mutable float m_materialProjPositionX[TRKDETDESCRTOOLS_MAXSTEPS]; //!< x position of the material recording when assigned to layer
mutable float m_materialProjPositionY[TRKDETDESCRTOOLS_MAXSTEPS]; //!< y position of the material recording when assigned to layer
mutable float m_materialProjPositionZ[TRKDETDESCRTOOLS_MAXSTEPS]; //!< z position of the material recording when assigned to layer
mutable float m_materialProjPositionR[TRKDETDESCRTOOLS_MAXSTEPS]; //!< r value of the material recording when assigned to layer
mutable float m_materialProjDistance[TRKDETDESCRTOOLS_MAXSTEPS]; //!< the distance to the projected hit
mutable int m_mapped[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< mapped or not mapped
mutable float m_materialAccumPathInX0[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< accumulated path length in x0
mutable float m_materialAccumPathZARho[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< accumulated path length times (Z/A)*rho
mutable float m_materialStepPath[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< step path
mutable float m_materialStepX0[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< step x0
mutable float m_materialStepL0[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< step l0
mutable float m_materialStepZ[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< step Z
mutable float m_materialStepA[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< step A
mutable float m_materialStepRho[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< step rho
mutable float m_materialStepPositionX[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< x position of the material recording
mutable float m_materialStepPositionY[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< y position of the material recording
mutable float m_materialStepPositionZ[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< z position of the material recording
mutable float m_materialStepPositionR[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< r value of the material recording
mutable float m_materialProjPositionX[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< x position of the material recording when assigned to layer
mutable float m_materialProjPositionY[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< y position of the material recording when assigned to layer
mutable float m_materialProjPositionZ[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< z position of the material recording when assigned to layer
mutable float m_materialProjPositionR[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< r value of the material recording when assigned to layer
mutable float m_materialProjDistance[TRKDETDESCRTOOLS_MAXSTEPS]{}; //!< the distance to the projected hit
// Per Volume Validation
bool m_volumeValidation;
......
......@@ -176,7 +176,7 @@ Trk::LayerMaterialProperties* Trk::CompressedLayerMaterialCreator::createCompres
zarhobin = ( (size_t)zarhobin >= m_compressedMaterialZARhoBins) ? m_compressedMaterialZARhoBins-1 : zarhobin;
zarhobin = zarhobin < 0 ? 0 : zarhobin;
// create indexed material
Trk::IndexedMaterial idxMaterial;
Trk::IndexedMaterial idxMaterial{};
idxMaterial.materialProperties = matProp;
idxMaterial.firstBin = ifir;
idxMaterial.secondBin = isec;
......
......@@ -417,7 +417,7 @@ namespace Trk {
const TrackingVolume* m_motherVolume; //!< mother volume of this volume
std::vector< SharedObject<const BoundarySurface<TrackingVolume> > >* m_boundarySurfaces; //!< boundary Surfaces
std::vector< SharedObject<const BoundarySurface<TrackingVolume> > >* m_boundarySurfaces{}; //!< boundary Surfaces
//(a)
const LayerArray* m_confinedLayers; //!< Array of Layers inside the Volume
const TrackingVolumeArray* m_confinedVolumes; //!< Array of Volumes inside the Volume
......
......@@ -87,10 +87,10 @@ namespace Trk {
private:
std::array<ThreeObjectsAccessor,4> m_bevelledcylinderAccessors;
std::array<ThreeObjectsAccessor,4> m_bevelledcylinderAccessors{};
std::array<FourObjectsAccessor,12> m_bevelledtubeAccessors;
std::array<FiveObjectsAccessor,1> m_sectoralBevelledCylinderAccessors;
std::array<SixObjectsAccessor,1> m_sectoralBevelledTubeAccessors;
std::array<FiveObjectsAccessor,1> m_sectoralBevelledCylinderAccessors{};
std::array<SixObjectsAccessor,1> m_sectoralBevelledTubeAccessors{};
};
......
......@@ -82,10 +82,10 @@ class CylinderVolumeBoundaryAccessors {
SectoralTubeAccessorType stat) const;
private:
std::array<ThreeObjectsAccessor, 4> m_cylinderAccessors;
std::array<ThreeObjectsAccessor, 4> m_cylinderAccessors{};
std::array<FourObjectsAccessor, 12> m_tubeAccessors;
std::array<FiveObjectsAccessor, 1> m_sectoralCylinderAccessors;
std::array<SixObjectsAccessor, 1> m_sectoralTubeAccessors;
std::array<FiveObjectsAccessor, 1> m_sectoralCylinderAccessors{};
std::array<SixObjectsAccessor, 1> m_sectoralTubeAccessors{};
};
inline const ThreeObjectsAccessor&
......
......@@ -116,7 +116,7 @@ protected:
friend class ::CompetingRIOsOnTrackCnv_p1;
//! index of hightest assignment probability
mutable std::atomic_uint m_indexMaxAssignProb;
mutable std::atomic_uint m_indexMaxAssignProb{};
//! assignment probabilities of the ROTs
const std::vector<AssignmentProb>* m_assignProb;
......
......@@ -127,7 +127,7 @@ public:
private:
std::unique_ptr<const MultiComponentState> m_multiComponentState;
double m_mixtureModeQoverP;
double m_mixtureModeQoverP{};
};
/** Overload of << operator for MsgStream for debug output */
......
......@@ -114,7 +114,7 @@ namespace Trk
private:
Trk::MvfFitInfo m_fitInfo;
bool m_initialized;
bool m_initialized{};
}; //end of class definitions
......
......@@ -143,7 +143,7 @@ protected:
* Pointer to the TrackToVtxLink object, which contains the association of
* this track with all the other vertices (multi vertex fit)
*/
TrackToVtxLink* m_linkToVertices;
TrackToVtxLink* m_linkToVertices{};
};
inline Trk::MVFVxTrackAtVertex*
......
......@@ -6,6 +6,8 @@
// RungeKuttaPropagator.cxx, (c) ATLAS Detector software
/////////////////////////////////////////////////////////////////////////////////
#include <cmath>
#include "TrkExUtils/RungeKuttaUtils.h"
#include "TrkExUtils/JacobianHelper.h"
#include "TrkExRungeKuttaPropagator/RungeKuttaPropagator.h"
......@@ -176,7 +178,7 @@ crossPoint(const Trk::TrackParameters& Tp,
// Transformation track parameters
//
bool useJac;
bool useJac = 0;
Tp.covariance() ? useJac = true : useJac = false;
if (useJac) {
......@@ -372,7 +374,7 @@ Trk::RungeKuttaPropagator::propagate
// Test is it measured track parameters
//
bool useJac; Tp.covariance() ? useJac = true : useJac = false;
bool useJac = 0; Tp.covariance() ? useJac = true : useJac = false;
// Magnetic field information preparation
//
......@@ -433,7 +435,7 @@ Trk::RungeKuttaPropagator::propagate
while (fabs(W) < Wmax) {
std::pair<double,int> SN;
double S;
double S = 0;
if(cache.m_mcondition) {
......@@ -466,7 +468,7 @@ Trk::RungeKuttaPropagator::propagate
reverted_P=false;
//----------------------------------
bool next; SN=Trk::RungeKuttaUtils::stepEstimator(DS,DN,Po,Pn,W,m_straightStep,Nveto,next);
bool next = 0; SN=Trk::RungeKuttaUtils::stepEstimator(DS,DN,Po,Pn,W,m_straightStep,Nveto,next);
if(next) {for(int i=0; i!=45; ++i) Po[i]=Pn[i]; W+=S; Nveto=-1; }
else {for(int i=0; i!=45; ++i) Pn[i]=Po[i]; reverted_P=true; cache.m_newfield= true;}
......@@ -951,7 +953,7 @@ bool Trk::RungeKuttaPropagator::propagateWithJacobian
// Step estimation until surface
//
bool Q; double S;
bool Q = 0; double S = 0;
double Step=Trk::RungeKuttaUtils::stepEstimator(kind,Su,P,Q); if(!Q) return false;
bool dir = true;
......@@ -1364,7 +1366,7 @@ bool Trk::RungeKuttaPropagator::propagate
const MagneticFieldProperties& M ,
ParticleHypothesis ) const
{
double S;
double S = 0;
Cache cache{};
// Get field cache object
......@@ -1412,7 +1414,7 @@ bool Trk::RungeKuttaPropagator::propagateParameters
const MagneticFieldProperties& M ,
ParticleHypothesis ) const
{
double S;
double S = 0;
Cache cache{};
// Get field cache object
......
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