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

[LLVM Analyzer][DQM] Fix dead assignments #46247

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions DQM/BeamMonitor/plugins/BeamMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,6 @@ void BeamMonitor::FitAndFill(const LuminosityBlock& lumiSeg, int& lastlumi, int&
DipPVInfo_.push_back(h_nVtx_st->getRMSError());
DipPVInfo_.push_back((float)MaxPVs);
DipPVInfo_.push_back((float)countTotPV_);
MaxPVs = 0;
} else {
for (size_t i = 0; i < 7; i++) {
if (i > 0) {
Expand All @@ -934,7 +933,6 @@ void BeamMonitor::FitAndFill(const LuminosityBlock& lumiSeg, int& lastlumi, int&
}
}
theBeamFitter->SetPVInfo(DipPVInfo_);
countEvtLastNLS_ = 0;

if (onlineMode_) { // filling LS gap
// FIXME: need to add protection for the case if the gap is at the resetting LS!
Expand Down
4 changes: 1 addition & 3 deletions DQM/DTMonitorClient/src/DTLocalTriggerTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ void DTLocalTriggerTest::runClientDiagnostic(DQMStore::IBooker& ibooker, DQMStor
delete QualDistr;
}

std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);

if (whME[wh].find(fullName("CorrectBXPhiOut")) == whME[wh].end()) {
bookWheelHistos(ibooker, wh, "ResidualBXPhiOut");
bookWheelHistos(ibooker, wh, "CorrectBXPhiOut");
Expand All @@ -307,7 +305,7 @@ void DTLocalTriggerTest::runClientDiagnostic(DQMStore::IBooker& ibooker, DQMStor
bookWheelHistos(ibooker, wh, "TriggerInclusivePhiOut");
}

innerME = &(whME[wh]);
std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
innerME->find(fullName("CorrectBXPhiOut"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
innerME->find(fullName("ResidualBXPhiOut"))
->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
Expand Down
1 change: 0 additions & 1 deletion DQM/DTMonitorModule/src/DTChamberEfficiencyTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ void DTChamberEfficiencyTask::analyze(const edm::Event& event, const edm::EventS
DTChamberId TopId14(wheel, top, 14);
DTRecSegment4DCollection::range segsTop14 = segs->get(TopId14);
int nSegsTop14 = segsTop14.second - segsTop14.first;
nSegsTop += nSegsTop14;
if (nSegsTop14) {
DTRecSegment4D* pBestTopSeg14 = const_cast<DTRecSegment4D*>(&getBestSegment(segsTop14));
// get best between sector 10 and 14
Expand Down
4 changes: 2 additions & 2 deletions DQM/L1TMonitorClient/src/L1TOccupancyClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ double L1TOccupancyClient::getAvrg(TH2F* iHist, string iTestName, int iAxis, int

// median
case 2:
marked = hservice_->maskBins(iTestName, histo, iBinStrip, iAxis);
hservice_->maskBins(iTestName, histo, iBinStrip, iAxis);
proj = histo->ProjectionY("_py", iBinStrip, iBinStrip);
for (int i = 0; i < iNBins; i++) {
values.push_back(proj->GetBinContent(i + 1));
Expand All @@ -628,7 +628,7 @@ double L1TOccupancyClient::getAvrg(TH2F* iHist, string iTestName, int iAxis, int
break;
// median
case 2:
marked = hservice_->maskBins(iTestName, histo, iBinStrip, iAxis);
hservice_->maskBins(iTestName, histo, iBinStrip, iAxis);
proj = histo->ProjectionX("_px", iBinStrip, iBinStrip);
for (int i = 0; i < iNBins; i++) {
values.push_back(proj->GetBinContent(i + 1));
Expand Down
12 changes: 4 additions & 8 deletions DQM/Physics/src/QcdPhotonsDQM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ void QcdPhotonsDQM::analyze(const Event& iEvent, const EventSetup& iSetup) {
float photon_eta = -9.0;
float photon_phi = -9.0;
bool photon_passPhotonID = false;
bool found_lead_pho = false;
Copy link
Contributor Author

@iarspider iarspider Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are exactly three uses of this variable: declaration here, check on line 392 and setting to true on line 393

int photon_count_bar = 0;
int photon_count_end = 0;
// False Assumption: reco photons are ordered by Et
Expand Down Expand Up @@ -389,13 +388,10 @@ void QcdPhotonsDQM::analyze(const Event& iEvent, const EventSetup& iSetup) {
photon_count_end++;
}

if (!found_lead_pho) {
found_lead_pho = true;
photon_passPhotonID = pho_current_passPhotonID;
photon_et = pho_maxet->et();
photon_eta = pho_maxet->eta();
photon_phi = pho_maxet->phi();
}
photon_passPhotonID = pho_current_passPhotonID;
photon_et = pho_maxet->et();
photon_eta = pho_maxet->eta();
photon_phi = pho_maxet->phi();
}

// If user requires a photon to be found, but none is, return.
Expand Down
5 changes: 0 additions & 5 deletions DQM/Physics/src/TopDiLeptonDQM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ void TopDiLeptonDQM::analyze(const edm::Event& evt, const edm::EventSetup& conte
bool Fired_Signal_Trigger[100] = {false};
bool Fired_Control_Trigger[100] = {false};

int N_leptons = 0;
int N_iso_mu = 0;
int N_iso_el = 0;

Expand Down Expand Up @@ -260,8 +259,6 @@ void TopDiLeptonDQM::analyze(const edm::Event& evt, const edm::EventSetup& conte
if (!muons.failedToGet()) {
Nmuons_->Fill(muons->size());

N_leptons = N_leptons + muons->size();

for (muon = muons->begin(); muon != muons->end(); ++muon) {
float N_muons = muons->size();
float Q_muon = muon->charge();
Expand Down Expand Up @@ -331,8 +328,6 @@ void TopDiLeptonDQM::analyze(const edm::Event& evt, const edm::EventSetup& conte
if (!elecs.failedToGet()) {
Nelecs_->Fill(elecs->size());

N_leptons = N_leptons + elecs->size();

for (elec = elecs->begin(); elec != elecs->end(); ++elec) {
float N_elecs = elecs->size();
float Q_elec = elec->charge();
Expand Down
6 changes: 1 addition & 5 deletions DQM/SiPixelMonitorClient/src/SiPixelDataQuality.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ void SiPixelDataQuality::computeGlobalQualityFlag(
digiCounterBarrel = 0, clusterCounterBarrel = 0, trackCounterBarrel = 0;
digiStatsEndcap = false, clusterStatsEndcap = false, trackStatsEndcap = false;
digiCounterEndcap = 0, clusterCounterEndcap = 0, trackCounterEndcap = 0;
init = false;
}
if (nFEDs == 0)
return;
Expand Down Expand Up @@ -652,9 +651,7 @@ void SiPixelDataQuality::computeGlobalQualityFlag(
endcapFlag = endcap_errors_temp[0] * combinedCuts;

// Track results:
combinedCuts = 1.;
numerator = 0;
denominator = 0;

me = iGetter.get("Pixel/Tracks/PixelTracksCut");
if (me)
pixel_cuts_temp[0] = me->getIntValue();
Expand Down Expand Up @@ -799,7 +796,6 @@ void SiPixelDataQuality::fillGlobalQualityPlot(DQMStore::IBooker &iBooker,
if (init) {
count = 0;
errcount = 0;
init = false;
count1 = 0;
count2 = 0;
count3 = 0;
Expand Down
23 changes: 0 additions & 23 deletions DQM/SiPixelMonitorCluster/src/SiPixelClusterSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,32 +344,9 @@ void SiPixelClusterSource::buildStructure(const edm::EventSetup &iSetup) {
thePixelStructure.insert(pair<uint32_t, SiPixelClusterModule *>(id, theModule));
} else if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
LogDebug("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(id), pTT, isUpgrade).halfCylinder();
int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
if (disk > noOfDisks)
noOfDisks = disk;
int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
int module = PixelEndcapName(DetId(id), pTT, isUpgrade).plaquetteName();
char sside[80];
sprintf(sside, "HalfCylinder_%i", side);
char sdisk[80];
sprintf(sdisk, "Disk_%i", disk);
char sblade[80];
sprintf(sblade, "Blade_%02i", blade);
char spanel[80];
sprintf(spanel, "Panel_%i", panel);
char smodule[80];
sprintf(smodule, "Module_%i", module);
std::string side_str = sside;
std::string disk_str = sdisk;
bool mask = side_str.find("HalfCylinder_1") != string::npos ||
side_str.find("HalfCylinder_2") != string::npos ||
side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
// clutch to take all of FPIX, but no BPIX:
mask = false;
if (isPIB && mask)
continue;
SiPixelClusterModule *theModule = new SiPixelClusterModule(id, ncols, nrows);
thePixelStructure.insert(pair<uint32_t, SiPixelClusterModule *>(id, theModule));
}
Expand Down
50 changes: 0 additions & 50 deletions DQM/SiPixelMonitorDigi/src/SiPixelDigiSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,68 +1138,18 @@ void SiPixelDigiSource::buildStructure(const edm::EventSetup& iSetup) {
uint32_t id = detId();
SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);

PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(id), pTT, isUpgrade).halfCylinder();
int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
if (disk > noOfDisks)
noOfDisks = disk;
int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
int module = PixelEndcapName(DetId(id), pTT, isUpgrade).plaquetteName();

char sside[80];
sprintf(sside, "HalfCylinder_%i", side);
char sdisk[80];
sprintf(sdisk, "Disk_%i", disk);
char sblade[80];
sprintf(sblade, "Blade_%02i", blade);
char spanel[80];
sprintf(spanel, "Panel_%i", panel);
char smodule[80];
sprintf(smodule, "Module_%i", module);
std::string side_str = sside;
std::string disk_str = sdisk;
bool mask = side_str.find("HalfCylinder_1") != string::npos ||
side_str.find("HalfCylinder_2") != string::npos ||
side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
// clutch to take all of FPIX, but no BPIX:
mask = false;
if (isPIB && mask)
continue;

thePixelStructure.insert(pair<uint32_t, SiPixelDigiModule*>(id, theModule));
} else if ((detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) && (isUpgrade)) {
LogDebug("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
uint32_t id = detId();
SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);

PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(id), pTT, isUpgrade).halfCylinder();
int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
if (disk > noOfDisks)
noOfDisks = disk;
int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
int module = PixelEndcapName(DetId(id), pTT, isUpgrade).plaquetteName();

char sside[80];
sprintf(sside, "HalfCylinder_%i", side);
char sdisk[80];
sprintf(sdisk, "Disk_%i", disk);
char sblade[80];
sprintf(sblade, "Blade_%02i", blade);
char spanel[80];
sprintf(spanel, "Panel_%i", panel);
char smodule[80];
sprintf(smodule, "Module_%i", module);
std::string side_str = sside;
std::string disk_str = sdisk;
bool mask = side_str.find("HalfCylinder_1") != string::npos ||
side_str.find("HalfCylinder_2") != string::npos ||
side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
// clutch to take all of FPIX, but no BPIX:
mask = false;
if (isPIB && mask)
continue;

thePixelStructure.insert(pair<uint32_t, SiPixelDigiModule*>(id, theModule));
} //end_elseif(isUpgrade)
}
Expand Down
29 changes: 0 additions & 29 deletions DQM/SiPixelMonitorRawData/src/SiPixelRawDataErrorSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ void SiPixelRawDataErrorSource::buildStructure(const edm::EventSetup &iSetup) {

edm::ESHandle<TrackerGeometry> pDD = iSetup.getHandle(trackerGeomTokenBeginRun_);

edm::ESHandle<TrackerTopology> tTopoHandle = iSetup.getHandle(trackerTopoTokenBeginRun_);
const TrackerTopology *pTT = tTopoHandle.product();

LogVerbatim("PixelDQM") << " *** Geometry node for TrackerGeom is " << &(*pDD) << std::endl;
LogVerbatim("PixelDQM") << " *** I have " << pDD->detsPXB().size() << " barrel pixel detectors" << std::endl;
LogVerbatim("PixelDQM") << " *** I have " << pDD->detsPXF().size() << " endcap pixel detectors" << std::endl;
Expand Down Expand Up @@ -227,32 +224,6 @@ void SiPixelRawDataErrorSource::buildStructure(const edm::EventSetup &iSetup) {
LogDebug("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
uint32_t id = detId();
SiPixelRawDataErrorModule *theModule = new SiPixelRawDataErrorModule(id, ncols, nrows);

PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(id), pTT, isUpgrade).halfCylinder();
int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
int module = PixelEndcapName(DetId(id), pTT, isUpgrade).plaquetteName();

char sside[80];
sprintf(sside, "HalfCylinder_%i", side);
char sdisk[80];
sprintf(sdisk, "Disk_%i", disk);
char sblade[80];
sprintf(sblade, "Blade_%02i", blade);
char spanel[80];
sprintf(spanel, "Panel_%i", panel);
char smodule[80];
sprintf(smodule, "Module_%i", module);
std::string side_str = sside;
std::string disk_str = sdisk;
bool mask = side_str.find("HalfCylinder_1") != string::npos || side_str.find("HalfCylinder_2") != string::npos ||
side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
// clutch to take all of FPIX, but no BPIX:
mask = false;
if (isPIB && mask)
continue;

thePixelStructure.insert(pair<uint32_t, SiPixelRawDataErrorModule *>(id, theModule));
}

Expand Down
6 changes: 0 additions & 6 deletions DQM/SiPixelMonitorTrack/src/SiPixelHitEfficiencySource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,6 @@ void SiPixelHitEfficiencySource::analyze(const edm::Event &iEvent, const edm::Ev
float lymatch = 9999.0;
if (!expTrajMeasurements.empty()) {
if (glmatch < 9999.) { // if there is any propagated trajectory for this hit
const DetId &matchhit_detId = expTrajMeasurements[imatch].recHit()->geographicalId();

int matchhit_ladder = PXBDetId(matchhit_detId).ladder();
int dladder = abs(matchhit_ladder - hit_ladder);
if (dladder > 10)
dladder = 20 - dladder;
LocalPoint lp = expTrajMeasurements[imatch].updatedState().localPosition();
lxmatch = fabs(lp.x() - chklp.x());
lymatch = fabs(lp.y() - chklp.y());
Expand Down
4 changes: 0 additions & 4 deletions DQM/SiStripCommissioningAnalysis/src/ApvTimingAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ void ApvTimingAlgorithm::analyse() {
if (!found) { //Try tick mark recovery

max_derivative_bin = sistrip::invalid_;
max_derivative = -1. * sistrip::invalid_;

// Find rising edges_r (derivative_r across five bins > threshold)
std::map<uint16_t, float> edges_r;
Expand Down Expand Up @@ -288,7 +287,6 @@ void ApvTimingAlgorithm::analyse() {
// Store max derivative_r
if (temp_r > max_derivative_r && ii_r < 10) {
max_derivative_r = temp_r;
max_derivative = temp_r;
max_derivative_bin = bin_r;
}

Expand All @@ -304,11 +302,9 @@ void ApvTimingAlgorithm::analyse() {
// Break from loop if recovery tick mark found
if (valid_r) {
found_r = true;
found = true;
anal->addErrorCode(sistrip::tickMarkRecovered_);
} else {
max_derivative_r = -1. * sistrip::invalid_;
max_derivative = -1. * sistrip::invalid_;
max_derivative_bin = sistrip::invalid_;
//edges_r.erase(iter_r);
anal->addErrorCode(sistrip::rejectedCandidate_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ void PedsFullNoiseAlgorithm::analyse() {
}

// Calculate the spread for noise and pedestal
apvID = -1;

for (int iStrip = 0; iStrip < histoNoiseMean->GetNbinsX(); iStrip++) {
if (iStrip < histoNoiseMean->GetNbinsX() / 2)
apvID = 0;
Expand All @@ -380,7 +378,6 @@ void PedsFullNoiseAlgorithm::analyse() {
}

// loop on each strip in the lldChannel
apvID = 0;
TH1S* histoResidualStrip = new TH1S("histoResidualStrip",
"",
histoNoise->GetNbinsX(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ TH1* CommissioningHistograms::histogram(const sistrip::Monitorable& mon,
// Construct histogram name
std::string name = SummaryGenerator::name(task_, mon, pres, view, directory);

MonitorElement* me = bei_->get(bei_->pwd() + "/" + name);
MonitorElement* me = nullptr;

// Create summary plot
float high = static_cast<float>(xbins);
Expand Down
4 changes: 2 additions & 2 deletions DQM/SiStripMonitorSummary/src/SiStripApvGainsDQM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ void SiStripApvGainsDQM::fillMEsForLayer(
}

for (int iapv = 0; iapv < nApv; ++iapv) {
meanApvGain = meanApvGain + condObj_->getApvGain(iapv, gainRange);
// meanApvGain = meanApvGain + condObj_->getApvGain(iapv, gainRange);
selME_.SummaryDistr->Fill(iBin, condObj_->getApvGain(iapv, gainRange));
} // iapv
meanApvGain = meanApvGain / nApv;
// meanApvGain = meanApvGain / nApv;

// Fill the TkHistoMap with meanApvgain:
// if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);
Expand Down
4 changes: 2 additions & 2 deletions DQMOffline/Hcal/src/HcalRecHitsDQMClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ int HcalRecHitsDQMClient::HcalRecHitsEndjob(const std::vector<MonitorElement *>
float cnorm;
float enorm;

unsigned int vsIetaIdx = occupancy_vs_ieta.size();
unsigned int vsIetaIdx = 0;
omatched = false;

for (vsIetaIdx = 0; vsIetaIdx < occupancy_vs_ieta.size(); vsIetaIdx++) {
for (; vsIetaIdx < occupancy_vs_ieta.size(); vsIetaIdx++) {
if (occupancyID[occupancyIdx] == occupancy_vs_ietaID[vsIetaIdx]) {
omatched = true;
break;
Expand Down
5 changes: 2 additions & 3 deletions DQMOffline/JetMET/src/METAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1321,8 +1321,7 @@ void METAnalyzer::dqmEndRun(const edm::Run& iRun, const edm::EventSetup& iSetup)

TH1F* tlumisec;

MonitorElement* meLumiSec = map_dijet_MEs["aaa"];
meLumiSec = map_dijet_MEs["JetMET/lumisec"];
MonitorElement* meLumiSec = map_dijet_MEs["JetMET/lumisec"];

int totlsec = 0;
int totlssecsum = 0;
Expand Down Expand Up @@ -2145,7 +2144,7 @@ void METAnalyzer::fillMonitorElement(const edm::Event& iEvent,

//protection for VERY special case where Z-Pt==0
double u_par = 0;
double u_perp = sqrt(u_x * u_x + u_y * u_y);
double u_perp = 0;
double e_Z_x = 0;
double e_Z_y = 0;
if (zCand.Pt() != 0) {
Expand Down
Loading