Skip to content

Commit

Permalink
[DB] [LLVM16]Fix set but unused variables warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed May 3, 2023
1 parent 85b455d commit 0eba1e2
Show file tree
Hide file tree
Showing 33 changed files with 10 additions and 185 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -901,26 +901,34 @@ namespace {

std::vector<uint32_t> allDetIds = detInfo.getAllDetIds();

#ifdef MMDEBUG
int countLastButNotFirst(0);
int countFirstButNotLast(0);
int countBoth(0);
#endif

for (const auto& d : allDetIds) {
if (LastFractionPerDetId.find(d) != LastFractionPerDetId.end() &&
FirstFractionPerDetId.find(d) == FirstFractionPerDetId.end()) {
tmap->fill(d, LastFractionPerDetId[d]);
#ifdef MMDEBUG
countLastButNotFirst++;
#endif
} else if (LastFractionPerDetId.find(d) == LastFractionPerDetId.end() &&
FirstFractionPerDetId.find(d) != FirstFractionPerDetId.end()) {
tmap->fill(d, -FirstFractionPerDetId[d]);
#ifdef MMDEBUG
countFirstButNotLast++;
#endif
} else if (LastFractionPerDetId.find(d) != LastFractionPerDetId.end() &&
FirstFractionPerDetId.find(d) != FirstFractionPerDetId.end()) {
float delta = (LastFractionPerDetId[d] - FirstFractionPerDetId[d]);
if (delta != 0.) {
tmap->fill(d, delta);
}
#ifdef MMDEBUG
countBoth++;
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,8 @@ namespace {
std::map<uint32_t, int> zeropeds_per_detid;

for (const auto& d : detid) {
int nstrips = 0;
SiStripPedestals::Range range = payload->getRange(d);
for (int it = 0; it < (range.second - range.first) * 8 / 10; ++it) {
nstrips++;
auto ped = payload->getPed(it, range);
if (ped == 0.) {
zeropeds_per_detid[d] += 1;
Expand Down
2 changes: 0 additions & 2 deletions CondCore/Utilities/bin/conddb_test_gt_perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,7 @@ int cond::TestGTPerf::execute() {
std::cout << "Loading " << gt.size() << " tags..." << std::endl;
std::vector<UntypedPayloadProxy*> proxies;
std::map<std::string, size_t> requests;
size_t nt = 0;
for (const auto& t : gt) {
nt++;
UntypedPayloadProxy* p = new UntypedPayloadProxy;
p->init(session);
try {
Expand Down
6 changes: 1 addition & 5 deletions CondTools/Ecal/plugins/EcalPedestalHistory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void EcalPedestalHistory::beginRun(edm::Run const&, edm::EventSetup const& c) {
std::map<EcalLogicID, MonPedestalsDat> dataset_mon;
econn->fetchDataSet(&dataset_mon, &mon_run_vec[kr]);
std::cout << "OMDS record for run " << irun << " is made of " << dataset_mon.size() << std::endl;
int nEB = 0, nEE = 0, nEBbad = 0, nEEbad = 0;
int nEB = 0, nEE = 0;
typedef std::map<EcalLogicID, MonPedestalsDat>::const_iterator CImon;
EcalLogicID ecid_xt;
MonPedestalsDat rd_ped;
Expand Down Expand Up @@ -280,12 +280,8 @@ void EcalPedestalHistory::beginRun(edm::Run const&, edm::EventSetup const& c) {
}
if (ecid_xt.getName() == "EB_crystal_number") {
nEB++;
if (!result)
nEBbad++;
} else {
nEE++;
if (!result)
nEEbad++;
}
} // end loop over pedestal data
// ok or bad? A bad run is for more than 5% bad channels
Expand Down
4 changes: 0 additions & 4 deletions CondTools/Ecal/plugins/StoreEcalCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1109,15 +1109,13 @@ std::shared_ptr<EcalChannelStatus> StoreEcalCondition::readEcalChannelStatusFrom
edm::LogVerbatim("StoreEcalCondition") << "IOV END " << iovRunEnd << "\n";
//if -1 end of time

int ii = 0;
while (fgets(line, 255, ifile)) {
std::string EBorEE;
int hashedIndex(0);
int chStatus(0);
std::stringstream aStrStream;
aStrStream << line;
aStrStream >> EBorEE >> hashedIndex >> chStatus;
// if(ii==0)
edm::LogVerbatim("StoreEcalCondition")
<< EBorEE << " hashedIndex " << hashedIndex << " status " << chStatus << "\n";

Expand Down Expand Up @@ -1147,8 +1145,6 @@ std::shared_ptr<EcalChannelStatus> StoreEcalCondition::readEcalChannelStatusFrom
}
}
}

ii++;
}

fclose(ifile);
Expand Down
2 changes: 0 additions & 2 deletions CondTools/Ecal/src/EcalDAQTowerStatusXMLTranslator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ int EcalDAQTowerStatusXMLTranslator::readXML(const std::string& filename,

DOMNode* cellnode = getChildNode(elementRoot, Cell_tag);

int chan = 0;
while (cellnode) {
int status = -1;
DetId detid = readCellId(dynamic_cast<DOMElement*>(cellnode));
Expand All @@ -57,7 +56,6 @@ int EcalDAQTowerStatusXMLTranslator::readXML(const std::string& filename,

while (cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
cellnode = cellnode->getNextSibling();
chan++;
}

delete parser;
Expand Down
2 changes: 0 additions & 2 deletions CondTools/Ecal/src/EcalDCSTowerStatusXMLTranslator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ int EcalDCSTowerStatusXMLTranslator::readXML(const std::string& filename,

DOMNode* cellnode = getChildNode(elementRoot, Cell_tag);

int chan = 0;
while (cellnode) {
int status = -1;
DetId detid = readCellId(dynamic_cast<DOMElement*>(cellnode));
Expand All @@ -58,7 +57,6 @@ int EcalDCSTowerStatusXMLTranslator::readXML(const std::string& filename,

while (cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
cellnode = cellnode->getNextSibling();
chan++;
}

delete parser;
Expand Down
3 changes: 0 additions & 3 deletions CondTools/Ecal/src/EcalLaser_weekly_Linearization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ popcon::EcalLaser_weekly_Linearization::~EcalLaser_weekly_Linearization() {
void popcon::EcalLaser_weekly_Linearization::getNewObjects() {
// int file[1] = {190708};

int iIov = 0;

std::cout << "------- Ecal -> getNewObjects\n";

unsigned long long max_since = 1;
Expand Down Expand Up @@ -139,7 +137,6 @@ void popcon::EcalLaser_weekly_Linearization::getNewObjects() {
// m_to_transfer.push_back(std::make_pair((EcalTPGLinearizationConst*)linC, file[week]));
m_to_transfer.push_back(std::make_pair(linC, fileIOV));
// end special
iIov++;
} // end loop over week
std::cout << "Ecal -> end of getNewObjects -----------\n";
}
6 changes: 1 addition & 5 deletions CondTools/Ecal/src/EcalPedestalsHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void popcon::EcalPedestalsHandler::getNewObjectsP5() {
std::map<EcalLogicID, MonPedestalsDat> dataset_mon;
econn->fetchDataSet(&dataset_mon, &mon_run_vec[kr]);
edm::LogInfo("OMDS record for run ") << irun << " is made of " << dataset_mon.size();
int nEB = 0, nEE = 0, nEBbad = 0, nEEbad = 0;
int nEB = 0, nEE = 0;
typedef std::map<EcalLogicID, MonPedestalsDat>::const_iterator CImon;
EcalLogicID ecid_xt;
MonPedestalsDat rd_ped;
Expand All @@ -245,12 +245,8 @@ void popcon::EcalPedestalsHandler::getNewObjectsP5() {
*/
if (ecid_xt.getName() == "EB_crystal_number") {
nEB++;
if (!checkPedestal(&item))
nEBbad++;
} else {
nEE++;
if (!checkPedestal(&item))
nEEbad++;
}

// here we check and count how many bad channels we have
Expand Down
3 changes: 0 additions & 3 deletions CondTools/Ecal/src/EcalPulseShapesHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ void popcon::EcalPulseShapesHandler::getNewObjects() {

// keep track of bad crystals
int nEBbad(0), nEEbad(0);
int nEBgood(0), nEEgood(0);
std::vector<EBDetId> ebgood;
std::vector<EEDetId> eegood;

Expand Down Expand Up @@ -76,7 +75,6 @@ void popcon::EcalPulseShapesHandler::getNewObjects() {
if (!checkPulseShape(&item))
nEBbad++;
else {
nEBgood++;
ebgood.push_back(ebdetid);
pulseshapes->insert(std::make_pair(ebdetid.rawId(), item));
}
Expand All @@ -85,7 +83,6 @@ void popcon::EcalPulseShapesHandler::getNewObjects() {
if (!checkPulseShape(&item))
nEEbad++;
else {
nEEgood++;
eegood.push_back(eedetid);
pulseshapes->insert(std::make_pair(eedetid.rawId(), item));
}
Expand Down
3 changes: 0 additions & 3 deletions CondTools/Ecal/src/EcalPulseSymmCovariancesHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ void popcon::EcalPulseSymmCovariancesHandler::getNewObjects() {

// keep track of bad crystals
int nEBbad(0), nEEbad(0);
int nEBgood(0), nEEgood(0);
std::vector<EBDetId> ebgood;
std::vector<EEDetId> eegood;

Expand Down Expand Up @@ -84,7 +83,6 @@ void popcon::EcalPulseSymmCovariancesHandler::getNewObjects() {
if (!checkPulseSymmCovariance(&item))
nEBbad++;
else {
nEBgood++;
ebgood.push_back(ebdetid);
pulsecovs->insert(std::make_pair(ebdetid.rawId(), item));
}
Expand All @@ -93,7 +91,6 @@ void popcon::EcalPulseSymmCovariancesHandler::getNewObjects() {
if (!checkPulseSymmCovariance(&item))
nEEbad++;
else {
nEEgood++;
eegood.push_back(eedetid);
pulsecovs->insert(std::make_pair(eedetid.rawId(), item));
}
Expand Down
7 changes: 0 additions & 7 deletions CondTools/Ecal/src/EcalTPGBadStripHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ void popcon::EcalTPGBadStripHandler::getNewObjects() {
//unsigned int rd_stripStatus;

// put at 1 the strip that are bad
int icells = 0;
int icellsFound = 0;
for (CIfeped p = dataset_TpgBadStrip.begin(); p != dataset_TpgBadStrip.end(); p++) {
rd_badStrip = *p;

Expand All @@ -205,7 +203,6 @@ void popcon::EcalTPGBadStripHandler::getNewObjects() {
stripid = my_StripEcalLogicId_EE[istrip].getLogicID();

set_the_strip = true;
++icellsFound;
break;
}
}
Expand All @@ -214,12 +211,8 @@ void popcon::EcalTPGBadStripHandler::getNewObjects() {
if (set_the_strip) {
stripStatus->setValue(stripid, (unsigned int)rd_badStrip.getStatus());
}

++icells;
}

// std::cout << " icells = " << icells << std::endl;

edm::LogInfo("EcalTPGBadStripHandler") << "Finished badStrip reading.";

Time_t snc = (Time_t)irun;
Expand Down
4 changes: 0 additions & 4 deletions CondTools/Ecal/src/EcalTPGBadTTHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ void popcon::EcalTPGBadTTHandler::getNewObjects() {
}

// now put at 1 those that are bad
int icells = 0;
for (CIfeped p = dataset_TpgBadTT.begin(); p != dataset_TpgBadTT.end(); p++) {
rd_badTT = *p;

Expand All @@ -210,7 +209,6 @@ void popcon::EcalTPGBadTTHandler::getNewObjects() {
const EcalTrigTowerDetId towid = id.tower();
towerStatus->setValue(towid.rawId(), rd_badTT.getStatus());

++icells;
} else {
// EE data

Expand Down Expand Up @@ -238,8 +236,6 @@ void popcon::EcalTPGBadTTHandler::getNewObjects() {
} else {
std::cout << " these may be the additional towers TCC/TT " << tccid << "/" << towerid << std::endl;
}

++icells;
}
}

Expand Down
3 changes: 0 additions & 3 deletions CondTools/Ecal/src/EcalTPGBadXTHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ void popcon::EcalTPGBadXTHandler::getNewObjects() {
typedef std::vector<FEConfigBadXTDat>::const_iterator CIfeped;
EcalLogicID ecid_xt;
FEConfigBadXTDat rd_badXt;
int icells = 0;

for (CIfeped p = dataset_TpgBadXT.begin(); p != dataset_TpgBadXT.end(); p++) {
rd_badXt = *p;
Expand Down Expand Up @@ -216,7 +215,6 @@ void popcon::EcalTPGBadXTHandler::getNewObjects() {
EBDetId ebdetid(sm_num, xt_num, EBDetId::SMCRYSTALMODE);

badXt->setValue(ebdetid.rawId(), rd_badXt.getStatus());
++icells;
} else {
// EE data

Expand Down Expand Up @@ -246,7 +244,6 @@ void popcon::EcalTPGBadXTHandler::getNewObjects() {
}
EEDetId eedetid(x, y, z);
badXt->setValue(eedetid.rawId(), rd_badXt.getStatus());
++icells;
}
} //end for over data

Expand Down
2 changes: 0 additions & 2 deletions CondTools/Ecal/src/EcalTPGFineGrainEBGroupHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ void popcon::EcalTPGFineGrainEBGroupHandler::getNewObjects() {
typedef std::map<EcalLogicID, FEConfigFgrDat>::const_iterator CIfefgr;
EcalLogicID ecid_xt;
FEConfigFgrDat rd_fgr;
int itowers = 0;

for (CIfefgr p = dataset_TpgFineGrainEB.begin(); p != dataset_TpgFineGrainEB.end(); p++) {
ecid_xt = p->first;
Expand Down Expand Up @@ -206,7 +205,6 @@ void popcon::EcalTPGFineGrainEBGroupHandler::getNewObjects() {
const EcalTrigTowerDetId towid = id.tower();

fgrMap->setValue(towid.rawId(), rd_fgr.getFgrGroupId());
++itowers;
}
}

Expand Down
2 changes: 0 additions & 2 deletions CondTools/Ecal/src/EcalTPGFineGrainEBIdMapHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ void popcon::EcalTPGFineGrainEBIdMapHandler::getNewObjects() {
EcalLogicID ecid_xt;
FEConfigFgrGroupDat rd_fgr;

int igroups = 0;
for (CIfefgr p = dataset_TpgFineGrainEB.begin(); p != dataset_TpgFineGrainEB.end(); p++) {
ecid_xt = p->first;
rd_fgr = p->second;
Expand All @@ -189,7 +188,6 @@ void popcon::EcalTPGFineGrainEBIdMapHandler::getNewObjects() {
// I have exchanged the values to see if it works
f.setValues(RatioL, RatioH, ThrL, ThrH, LutConfId);
fgrMap->setValue(rd_fgr.getFgrGroupId(), f);
++igroups;
}

Time_t snc = (Time_t)irun;
Expand Down
5 changes: 0 additions & 5 deletions CondTools/Ecal/src/EcalTPGFineGrainStripEEHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ void popcon::EcalTPGFineGrainStripEEHandler::getNewObjects() {
EcalLogicID ecid_xt;
FEConfigFgrEEStripDat rd_fgr;

int icells = 0;

for (CIfefgr p = dataset_TpgFineGrainStripEE.begin(); p != dataset_TpgFineGrainStripEE.end(); p++) {
ecid_xt = p->first;
rd_fgr = p->second;
Expand All @@ -206,7 +204,6 @@ void popcon::EcalTPGFineGrainStripEEHandler::getNewObjects() {

fgrStripEE->setValue(stripEBId, item);

++icells;
} else if (ecid_name == "ECAL_readout_strip") {
// EE data
// fed
Expand Down Expand Up @@ -239,8 +236,6 @@ void popcon::EcalTPGFineGrainStripEEHandler::getNewObjects() {
} else {
std::cout << " these may be the additional towers TCC/TT " << id1 << "/" << id2 << std::endl;
}

++icells;
}
}

Expand Down
3 changes: 0 additions & 3 deletions CondTools/Ecal/src/EcalTPGFineGrainTowerEEHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ void popcon::EcalTPGFineGrainTowerEEHandler::getNewObjects() {
typedef std::map<EcalLogicID, FEConfigFgrEETowerDat>::const_iterator CIfefgr;
EcalLogicID ecid_xt;
FEConfigFgrEETowerDat rd_fgr;
int itowers = 0;

for (CIfefgr p = dataset_TpgFineGrainEE.begin(); p != dataset_TpgFineGrainEE.end(); p++) {
ecid_xt = p->first;
Expand Down Expand Up @@ -198,8 +197,6 @@ void popcon::EcalTPGFineGrainTowerEEHandler::getNewObjects() {
} else {
std::cout << " these may be the additional towers TCC/TT " << tccid << "/" << towerid << std::endl;
}

++itowers;
}
}

Expand Down
3 changes: 0 additions & 3 deletions CondTools/Ecal/src/EcalTPGLinConstHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ void popcon::EcalTPGLinConstHandler::getNewObjects() {
typedef std::map<EcalLogicID, FEConfigLinDat>::const_iterator CIfelin;
EcalLogicID ecid_xt;
FEConfigLinDat rd_lin;
int icells = 0;

for (CIfelin p = dataset_TpgLin.begin(); p != dataset_TpgLin.end(); p++) {
ecid_xt = p->first;
Expand All @@ -189,7 +188,6 @@ void popcon::EcalTPGLinConstHandler::getNewObjects() {
item.shift_x12 = rd_lin.getShift12();

linC->insert(std::make_pair(ebdetid.rawId(), item));
++icells;
} else {
//EE data
int z = ecid_xt.getID1();
Expand All @@ -207,7 +205,6 @@ void popcon::EcalTPGLinConstHandler::getNewObjects() {
item.shift_x12 = rd_lin.getShift12();

linC->insert(std::make_pair(eedetid.rawId(), item));
++icells;
}
}

Expand Down
Loading

0 comments on commit 0eba1e2

Please sign in to comment.