Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup of uninitialized reads reported by valgrind #11173

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1288,7 +1288,7 @@ namespace cscdqm {
// CSCCFEBData * cfebData[N_CFEBs];
// CSCCFEBTimeSlice * timeSlice[N_CFEBs][16];
// CSCCFEBDataWord * timeSample[N_CFEBs][16][6][16];
int Pedestal[N_CFEBs][6][16];
int Pedestal[N_CFEBs][6][16]; memset(Pedestal, 0, sizeof(Pedestal));
#ifdef __clang__
std::vector<std::array<std::array<std::pair<int,int>, 6>, 16>> CellPeak(N_CFEBs);
std::fill(CellPeak.begin(), CellPeak.end(), std::array<std::array<std::pair<int,int>, 6>, 16>{});
Expand Down
2 changes: 1 addition & 1 deletion DQM/CSCMonitorModule/plugins/CSCDQM_StripClusterFinder.cc
Expand Up @@ -381,7 +381,7 @@ void StripClusterFinder::printClusters(void)
std::cout << "======================================================================" << std::endl;
return;
}
bool StripClusterFinder::Sort::operator()(StripClusterFitData a , StripClusterFitData b) const
bool StripClusterFinder::Sort::operator()(const StripClusterFitData& a , const StripClusterFitData& b) const
{return a.channel_ < b.channel_;}

}
2 changes: 1 addition & 1 deletion DQM/CSCMonitorModule/plugins/CSCDQM_StripClusterFinder.h
Expand Up @@ -30,7 +30,7 @@ class StripClusterFinder {
public:
class Sort{
public:
bool operator()(StripClusterFitData a,StripClusterFitData b) const;
bool operator()(const StripClusterFitData& a, const StripClusterFitData& b) const;
};
std::vector<StripCluster> MEStripClusters;
ClusterLocalMax localMaxTMP;
Expand Down
7 changes: 5 additions & 2 deletions DQM/HcalMonitorTasks/src/HcalZDCMonitor.cc
@@ -1,6 +1,9 @@
#include "DQM/HcalMonitorTasks/interface/HcalZDCMonitor.h"

HcalZDCMonitor::HcalZDCMonitor() {
HcalZDCMonitor::HcalZDCMonitor() : TotalChannelErrors{}, DeadChannelCounter{}, ColdChannelCounter{},
DeadChannelError{}, HotChannelError{}, DigiErrorCAPID{}, DigiErrorDVER{},
ChannelHasDigiError{}
{
}
HcalZDCMonitor::~HcalZDCMonitor() {
}
Expand All @@ -12,7 +15,7 @@ void HcalZDCMonitor::setup(const edm::ParameterSet & ps, DQMStore::IBooker & ib)

baseFolder_ = rootFolder_ + "ZDCMonitor_Hcal";

const edm::ParameterSet psZDC(ps.getParameter<edm::ParameterSet>("zdcMonitorTask"));
const edm::ParameterSet& psZDC(ps.getParameter<edm::ParameterSet>("zdcMonitorTask"));
NLumiBlocks_ = psZDC.getUntrackedParameter<int>("NLumiBlocks",4000);
ChannelWeighting_ = psZDC.getUntrackedParameter<std::vector<double>> ("ZDC_ChannelWeighting");
MaxErrorRates_ = psZDC.getUntrackedParameter<std::vector<double>> ("ZDC_AcceptableChannelErrorRates");
Expand Down
1 change: 1 addition & 0 deletions DQM/Physics/src/B2GDQM.cc
Expand Up @@ -123,6 +123,7 @@ B2GDQM::B2GDQM(const edm::ParameterSet& ps) {
ps.getParameter<std::string>("muonSelect")));

semiE_HadJetPtCut_ = ps.getParameter<double>("semiE_HadJetPtCut");
semiE_LepJetPtCut_ = ps.getParameter<double>("semiE_LepJetPtCut");
semiE_dphiHadCut_ = ps.getParameter<double>("semiE_dphiHadCut");
semiE_dRMin_ = ps.getParameter<double>("semiE_dRMin");
semiE_ptRel_ = ps.getParameter<double>("semiE_ptRel");
Expand Down
7 changes: 3 additions & 4 deletions DataFormats/JetReco/src/PileupJetIdentifier.cc
@@ -1,13 +1,11 @@
#include "DataFormats/JetReco/interface/PileupJetIdentifier.h"

#include <iostream>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>

// ------------------------------------------------------------------------------------------
StoredPileupJetIdentifier::StoredPileupJetIdentifier()
{
memset(this, 0, sizeof(StoredPileupJetIdentifier));
}

// ------------------------------------------------------------------------------------------
Expand All @@ -18,6 +16,7 @@ StoredPileupJetIdentifier::~StoredPileupJetIdentifier()
// ------------------------------------------------------------------------------------------
PileupJetIdentifier::PileupJetIdentifier()
{
memset(this, 0, sizeof(PileupJetIdentifier));
}

// ------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion PhysicsTools/PatUtils/python/patPFMETCorrections_cff.py
Expand Up @@ -110,7 +110,7 @@
# even though jet energy got smeared by merely 1 GeV
#
skipJetSelection = cms.string(
'jecSetsAvailable & abs(energy - correctedP4("Uncorrected").energy) > (5.*min(energy, correctedP4("Uncorrected").energy))'
'jecSetsAvailable && abs(energy - correctedP4("Uncorrected").energy) > (5.*min(energy, correctedP4("Uncorrected").energy))'
),
skipRawJetPtThreshold = cms.double(10.), # GeV
skipCorrJetPtThreshold = cms.double(1.e-2),
Expand Down
10 changes: 5 additions & 5 deletions RecoEcal/EgammaCoreTools/src/EcalClusterLazyTools.cc
Expand Up @@ -333,7 +333,7 @@ std::vector<float> EcalClusterLazyToolsBase::getESHits(double X, double Y, doubl
for (int i=0; i<31; ++i) esHits.push_back(0);
} else {
it = rechits_map.find(strip);
if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
else esHits.push_back(0);
//cout<<"center : "<<strip<<" "<<it->second.energy()<<endl;

Expand All @@ -344,7 +344,7 @@ std::vector<float> EcalClusterLazyToolsBase::getESHits(double X, double Y, doubl
next = theESNav.east();
if (next != ESDetId(0)) {
it = rechits_map.find(next);
if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
else esHits.push_back(0);
//cout<<"east "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
} else {
Expand All @@ -361,7 +361,7 @@ std::vector<float> EcalClusterLazyToolsBase::getESHits(double X, double Y, doubl
next = theESNav.west();
if (next != ESDetId(0)) {
it = rechits_map.find(next);
if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
else esHits.push_back(0);
//cout<<"west "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
} else {
Expand All @@ -379,7 +379,7 @@ std::vector<float> EcalClusterLazyToolsBase::getESHits(double X, double Y, doubl
next = theESNav.north();
if (next != ESDetId(0)) {
it = rechits_map.find(next);
if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
else esHits.push_back(0);
//cout<<"north "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
} else {
Expand All @@ -396,7 +396,7 @@ std::vector<float> EcalClusterLazyToolsBase::getESHits(double X, double Y, doubl
next = theESNav.south();
if (next != ESDetId(0)) {
it = rechits_map.find(next);
if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
else esHits.push_back(0);
//cout<<"south "<<i<<" : "<<next<<" "<<it->second.energy()<<endl;
} else {
Expand Down