Skip to content

Commit

Permalink
[LLVM Analyzer][DQM] Fix dead assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Oct 4, 2024
1 parent 3019696 commit 06746e0
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 91 deletions.
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
2 changes: 0 additions & 2 deletions DQM/L1TMonitorClient/src/L1TOccupancyClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ double L1TOccupancyClient::getAvrg(TH2F* iHist, string iTestName, int iAxis, int

// median
case 2:
marked = 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 +627,6 @@ double L1TOccupancyClient::getAvrg(TH2F* iHist, string iTestName, int iAxis, int
break;
// median
case 2:
marked = 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;
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
2 changes: 2 additions & 0 deletions DQM/SiPixelMonitorCluster/src/SiPixelClusterSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ 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)
Expand All @@ -370,6 +371,7 @@ void SiPixelClusterSource::buildStructure(const edm::EventSetup &iSetup) {
mask = false;
if (isPIB && mask)
continue;
*/
SiPixelClusterModule *theModule = new SiPixelClusterModule(id, ncols, nrows);
thePixelStructure.insert(pair<uint32_t, SiPixelClusterModule *>(id, theModule));
}
Expand Down
7 changes: 4 additions & 3 deletions DQM/SiPixelMonitorDigi/src/SiPixelDigiSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ 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)
Expand Down Expand Up @@ -1165,13 +1166,13 @@ void SiPixelDigiSource::buildStructure(const edm::EventSetup& iSetup) {
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)
Expand Down Expand Up @@ -1199,7 +1200,7 @@ void SiPixelDigiSource::buildStructure(const edm::EventSetup& iSetup) {
mask = false;
if (isPIB && mask)
continue;

*/
thePixelStructure.insert(pair<uint32_t, SiPixelDigiModule*>(id, theModule));
} //end_elseif(isUpgrade)
}
Expand Down
6 changes: 3 additions & 3 deletions DQM/SiPixelMonitorRawData/src/SiPixelRawDataErrorSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ 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();
// 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;
Expand Down Expand Up @@ -227,7 +227,7 @@ 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();
Expand All @@ -252,7 +252,7 @@ void SiPixelRawDataErrorSource::buildStructure(const edm::EventSetup &iSetup) {
mask = false;
if (isPIB && mask)
continue;

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

Expand Down
4 changes: 0 additions & 4 deletions DQM/SiPixelMonitorTrack/src/SiPixelHitEfficiencySource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,6 @@ void SiPixelHitEfficiencySource::analyze(const edm::Event &iEvent, const edm::Ev
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
5 changes: 2 additions & 3 deletions DQMOffline/Muon/src/CSCOfflineMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@ void CSCOfflineMonitor::doPedestalNoise(edm::Handle<CSCStripDigiCollection> stri
// for ganged ME11A
if ((kStation == 1 && kRing == 4) && cscGeom->gangedStrips()) {
kRing = 1;
if (myStrip <= 16)
myStrip += 64; // no trapping for any bizarreness
// if (myStrip <= 16)
// myStrip += 64; // no trapping for any bizarreness
}

if (TotalADC > threshold) {
Expand Down Expand Up @@ -1848,7 +1848,6 @@ void CSCOfflineMonitor::doBXMonitor(edm::Handle<CSCALCTDigiCollection> alcts,
if (length >= 32) { ///if fed has data then unpack it
CSCDCCExaminer* examiner = nullptr;
std::stringstream examiner_out, examiner_err;
goodEvent = true;
examiner = new CSCDCCExaminer();
if (examinerMask & 0x40000)
examiner->crcCFEB(true);
Expand Down
44 changes: 14 additions & 30 deletions DQMOffline/Trigger/plugins/HLTInclusiveVBFSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -588,36 +588,20 @@ void HLTInclusiveVBFSource::bookHistograms(DQMStore::IBooker& iBooker, edm::Run
std::string trigPath = "(" + v.getPath() + ")";
iBooker.setCurrentFolder(subdirName);

MonitorElement* RECO_deltaEta_DiJet;
MonitorElement* RECO_deltaPhi_DiJet;
MonitorElement* RECO_invMass_DiJet;
MonitorElement* HLT_deltaEta_DiJet;
MonitorElement* HLT_deltaPhi_DiJet;
MonitorElement* HLT_invMass_DiJet;
MonitorElement* RECO_deltaEta_DiJet_Match;
MonitorElement* RECO_deltaPhi_DiJet_Match;
MonitorElement* RECO_invMass_DiJet_Match;
MonitorElement* RECOHLT_deltaEta;
MonitorElement* RECOHLT_deltaPhi;
MonitorElement* RECOHLT_invMass;
MonitorElement* NumberOfMatches;
MonitorElement* NumberOfEvents;

//dummy = iBooker.bookFloat("dummy");
RECO_deltaEta_DiJet = iBooker.bookFloat("RECO_deltaEta_DiJet");
RECO_deltaPhi_DiJet = iBooker.bookFloat("RECO_deltaPhi_DiJet");
RECO_invMass_DiJet = iBooker.bookFloat("RECO_invMass_DiJet");
HLT_deltaEta_DiJet = iBooker.bookFloat("HLT_deltaEta_DiJet");
HLT_deltaPhi_DiJet = iBooker.bookFloat("HLT_deltaPhi_DiJet ");
HLT_invMass_DiJet = iBooker.bookFloat("HLT_invMass_DiJet");
RECO_deltaEta_DiJet_Match = iBooker.bookFloat("RECO_deltaEta_DiJet_Match");
RECO_deltaPhi_DiJet_Match = iBooker.bookFloat("RECO_deltaPhi_DiJet_Match");
RECO_invMass_DiJet_Match = iBooker.bookFloat("RECO_invMass_DiJet_Match");
RECOHLT_deltaEta = iBooker.bookFloat("RECOHLT_deltaEta");
RECOHLT_deltaPhi = iBooker.bookFloat("RECOHLT_deltaPhi ");
RECOHLT_invMass = iBooker.bookFloat("RECOHLT_invMass");
NumberOfMatches = iBooker.bookFloat("NumberOfMatches");
NumberOfEvents = iBooker.bookFloat("NumberOfEvents");
MonitorElement* RECO_deltaEta_DiJet = nullptr;
MonitorElement* RECO_deltaPhi_DiJet = nullptr;
MonitorElement* RECO_invMass_DiJet = nullptr;
MonitorElement* HLT_deltaEta_DiJet = nullptr;
MonitorElement* HLT_deltaPhi_DiJet = nullptr;
MonitorElement* HLT_invMass_DiJet = nullptr;
MonitorElement* RECO_deltaEta_DiJet_Match = nullptr;
MonitorElement* RECO_deltaPhi_DiJet_Match = nullptr;
MonitorElement* RECO_invMass_DiJet_Match = nullptr;
MonitorElement* RECOHLT_deltaEta = nullptr;
MonitorElement* RECOHLT_deltaPhi = nullptr;
MonitorElement* RECOHLT_invMass = nullptr;
MonitorElement* NumberOfMatches = nullptr;
MonitorElement* NumberOfEvents = nullptr;

std::string labelname("ME");
std::string histoname(labelname + "");
Expand Down
Loading

0 comments on commit 06746e0

Please sign in to comment.