Skip to content

Commit

Permalink
[RECONSTRUCTION] [clang] Fix warnings reported by clang-16
Browse files Browse the repository at this point in the history
  • Loading branch information
aandvalenzuela committed May 4, 2023
1 parent 21ff8f0 commit 5df4242
Show file tree
Hide file tree
Showing 42 changed files with 15 additions and 155 deletions.
2 changes: 0 additions & 2 deletions RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,6 @@ std::vector<float> EcalClusterToolsT<noZS>::roundnessSelectedBarrelRecHits(
double inertia00 = 0.;
double inertia01 = 0.; // = inertia10 b/c matrix should be symmetric
double inertia11 = 0.;
int i = 0;
for (std::vector<std::pair<const EcalRecHit *, float>>::const_iterator rhf_ptr = RH_ptrs_fracs.begin();
rhf_ptr != RH_ptrs_fracs.end();
rhf_ptr++) {
Expand Down Expand Up @@ -1792,7 +1791,6 @@ std::vector<float> EcalClusterToolsT<noZS>::roundnessSelectedBarrelRecHits(
inertia00 += weight * iphi_rh_to_center * iphi_rh_to_center;
inertia01 -= weight * iphi_rh_to_center * ieta_rh_to_center;
inertia11 += weight * ieta_rh_to_center * ieta_rh_to_center;
i++;
}

inertia[0][0] = inertia00;
Expand Down
5 changes: 0 additions & 5 deletions RecoEcal/EgammaCoreTools/src/EcalClusterPUCleaningTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ reco::SuperCluster EcalClusterPUCleaningTools::CleanedSuperCluster(float xi,
// this should be replaced by the 5x5 around the seed; a good approx of how E_seed is defined
float seedBCEnergy = (scluster.seed())->energy();
float eSeed = 0.35; // standard eSeed in EB ; see CMS IN-2010/008
int numBcRemoved = 0;

double ClusterE = 0; //Sum of cluster energies for supercluster.
//Holders for position of this supercluster.
Expand All @@ -66,10 +65,6 @@ reco::SuperCluster EcalClusterPUCleaningTools::CleanedSuperCluster(float xi,
sqrt(eSeed * eSeed + xi * xi * seedBCEnergy * seedBCEnergy / cosh((*bcIt)->eta()) / cosh((*bcIt)->eta()))) {
;
} // the sum only of the BC's that pass the Esee selection
else {
numBcRemoved++;
continue;
} // count how many basic cluster get removed by the cleaning

// if BC passes dynamic selection, include it in the 'cleaned' supercluster
thissc.push_back((*bcIt));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ std::pair<int, float> EgammaHLTTrackIsolation::findIsoTracksWithoutEle(GlobalVec
const reco::TrackCollection* isoTracks) {
// Check that reconstructed tracks fit within cone boundaries,
// (Note: tracks will not always stay within boundaries)
int iele = 0;
int ntrack = 0;
float ptSum = 0.;
std::vector<float> etaele;
Expand All @@ -159,11 +158,9 @@ std::pair<int, float> EgammaHLTTrackIsolation::findIsoTracksWithoutEle(GlobalVec

// Store ALL electrons eta and phi
for (reco::ElectronCollection::const_iterator iElectron = allEle->begin(); iElectron != allEle->end(); iElectron++) {
iele++;
reco::TrackRef anothereletrackref = iElectron->track();
etaele.push_back(anothereletrackref->momentum().eta());
phiele.push_back(anothereletrackref->momentum().phi());
// std::cout << "Electron " << iele << ": phi = " << anothereletrackref->momentum().phi() << ", eta = " << anothereletrackref->momentum().eta() << std::endl;
}

for (reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr) {
Expand Down
4 changes: 2 additions & 2 deletions RecoEgamma/EgammaMCTools/src/ElectronMCTruthFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ std::vector<ElectronMCTruth> ElectronMCTruthFinder::find(const std::vector<SimTr

//std::cout << " Loop over all particles " << std::endl;

int npv = 0;
//int npv = 0;
for (std::vector<SimTrack>::const_iterator iSimTk = theSimTracks.begin(); iSimTk != theSimTracks.end(); ++iSimTk) {
if ((*iSimTk).noVertex())
continue;
Expand All @@ -75,7 +75,7 @@ std::vector<ElectronMCTruth> ElectronMCTruthFinder::find(const std::vector<SimTr

//std::cout << " Particle type " << (*iSimTk).type() << " Sim Track ID " << (*iSimTk).trackId() << " momentum " << (*iSimTk).momentum() << " vertex position " << vertex.position() << " vertex ID " << vertexId << std::endl;
if ((*iSimTk).vertIndex() == iPV) {
npv++;
//npv++;
if (std::abs((*iSimTk).type()) == 11) {
//std::cout << " Found a primary electron with ID " << (*iSimTk).trackId() << " momentum " << (*iSimTk).momentum() << std::endl;
electronTracks.push_back(*iSimTk);
Expand Down
2 changes: 0 additions & 2 deletions RecoEgamma/EgammaPhotonAlgos/src/InOutConversionSeedFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,9 @@ void InOutConversionSeedFinder::findSeeds(const TrajectoryStateOnSurface& starti

} else {
//Loop over compatible hits
int mea = 0;
for (std::vector<TrajectoryMeasurement>::iterator tmItr = theFirstMeasurements_.begin();
tmItr != theFirstMeasurements_.end();
++tmItr) {
mea++;

if (tmItr->recHit()->isValid()) {
// Make a new helix as in fillClusterSeeds() but using the hit position
Expand Down
2 changes: 0 additions & 2 deletions RecoEgamma/EgammaPhotonProducers/src/ConversionTrackMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ void ConversionTrackMerger::produce(edm::Event& e, const edm::EventSetup& es) {
for (unsigned ih = 0; ih < nh1; ++ih) {
const TrackingRecHit* it = iHits[ih];
if (it->isValid()) {
int jj = -1;
for (unsigned jh = 0; jh < nh2; ++jh) {
const TrackingRecHit* jt = jHits[jh];
jj++;
if (jt->isValid()) {
if (it->sharesInput(jt, TrackingRecHit::some)) {
noverlap++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ void ConvertedPhotonProducer::buildCollections(
t_generalTrk = transientTrackBuilder_->build(generalTrkHandle);

// Loop over SC in the barrel and reconstruct converted photons
int myCands = 0;
reco::CaloClusterPtrVector scPtrVec;
for (auto const& aClus : scHandle->ptrs()) {
// preselection based in Et and H/E cut
Expand Down Expand Up @@ -362,9 +361,7 @@ void ConvertedPhotonProducer::buildCollections(
math::XYZVector momentum = direction.unit() * aClus->energy();
const reco::Particle::LorentzVector p4(momentum.x(), momentum.y(), momentum.z(), aClus->energy());

int nFound = 0;
if (!allPairs.empty()) {
nFound = 0;

for (auto iPair = allPairs.begin(); iPair != allPairs.end(); ++iPair) {
scPtrVec.clear();
Expand All @@ -375,7 +372,6 @@ void ConvertedPhotonProducer::buildCollections(
continue;

scPtrVec.push_back(aClus);
nFound++;

std::vector<math::XYZPointF> trkPositionAtEcal = theEcalImpactPositionFinder.find(iPair->first, bcHandle);
std::vector<reco::CaloClusterPtr> matchingBC = theEcalImpactPositionFinder.matchingBC();
Expand Down Expand Up @@ -455,7 +451,6 @@ void ConvertedPhotonProducer::buildCollections(
newCandidate.setMVAout(like);
outputConvPhotonCollection.push_back(newCandidate);

myCands++;
//LogDebug("ConvertedPhotonProducer") << " ConvertedPhotonProducer Put the ConvertedPhotonCollection a candidate in the Barrel " << "\n";

} else {
Expand Down
3 changes: 0 additions & 3 deletions RecoJets/JetPlusTracks/plugins/JetPlusTrackCorrector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,6 @@ void JetPlusTrackCorrector::rebuildJta(const reco::Jet& fJet,
TrackRefs tracks = tracksthis;
tracksthis.clear();

int tr = 0;

double jetEta = fJet.eta();
double jetPhi = fJet.phi();
double jetEtIn = 1.0 / fJet.et();
Expand All @@ -1203,7 +1201,6 @@ void JetPlusTrackCorrector::rebuildJta(const reco::Jet& fJet,
scalethis = 1. * jetEtIn;
if (jetSplitMerge_ == 2)
scalethis = dR2this * jetEtIn;
tr++;
int flag = 1;
for (JetBaseRefIterator ii = theJets.begin(); ii != theJets.end(); ii++) {
if (&(**ii) == &fJet) {
Expand Down
2 changes: 0 additions & 2 deletions RecoJets/JetPlusTracks/plugins/JetPlusTrackProducerAA.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,11 @@ reco::TrackRefVector JetPlusTrackProducerAA::calculateBGtracksJet(
} //tracks

//=====> Propagate BG tracks to calo
int nValid = 0;
for (std::vector<reco::TrackExtrapolation>::const_iterator xtrpBegin = extrapolations_h->begin(),
xtrpEnd = extrapolations_h->end(),
ixtrp = xtrpBegin;
ixtrp != xtrpEnd;
++ixtrp) {
nValid++;

reco::TrackRefVector::iterator it = find(trBgOutOfVertex.begin(), trBgOutOfVertex.end(), (*ixtrp).track());

Expand Down
14 changes: 0 additions & 14 deletions RecoLocalMuon/CSCSegment/src/CSCSegAlgoRU.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,22 +679,17 @@ void CSCSegAlgoRU::baseline(AlgoState& aState, int n_seg_min) const {
// Optimal point rejection method
//-----------------------------------------------------
float minSum = 1000;
int i1b = 0;
int i2b = 0;
int iworst = -1;
int bad_layer = -1;
ChamberHitContainer::const_iterator rh_to_be_deleted_1;
ChamberHitContainer::const_iterator rh_to_be_deleted_2;
if ((chi2_str) > aState.chi2_str_ * aState.chi2D_iadd) { ///(nhits-2)
for (ChamberHitContainer::const_iterator i1 = aState.proto_segment.begin(); i1 != aState.proto_segment.end();
++i1) {
++i1b;
const CSCRecHit2D* i1_1 = *i1;
CSCDetId idRH1 = i1_1->cscDetId();
int z1 = idRH1.layer();
i2b = i1b;
for (ChamberHitContainer::const_iterator i2 = i1 + 1; i2 != aState.proto_segment.end(); ++i2) {
++i2b;
const CSCRecHit2D* i2_1 = *i2;
CSCDetId idRH2 = i2_1->cscDetId();
int z2 = idRH2.layer();
Expand All @@ -705,13 +700,11 @@ void CSCSegAlgoRU::baseline(AlgoState& aState, int n_seg_min) const {
if (ir == i1 || ir == i2)
continue;
float dsum = 0;
int hit_nr = 0;
const CSCRecHit2D* ir_1 = *ir;
CSCDetId idRH = ir_1->cscDetId();
int worst_layer = idRH.layer();
for (ChamberHitContainer::const_iterator i = aState.proto_segment.begin(); i != aState.proto_segment.end();
++i) {
++hit_nr;
const CSCRecHit2D* i_1 = *i;
if (i == i1 || i == i2 || i == ir)
continue;
Expand Down Expand Up @@ -740,17 +733,12 @@ void CSCSegAlgoRU::baseline(AlgoState& aState, int n_seg_min) const {
if (iworst > -1 && (nhits - 1) > n_seg_min && (chi2_str) > aState.chi2_str_ * aState.chi2D_iadd) { ///(nhits-3)
iworst = -1;
float minSum = 1000;
int i1b = 0;
int i2b = 0;
for (ChamberHitContainer::const_iterator i1 = aState.proto_segment.begin(); i1 != aState.proto_segment.end();
++i1) {
++i1b;
const CSCRecHit2D* i1_1 = *i1;
CSCDetId idRH1 = i1_1->cscDetId();
int z1 = idRH1.layer();
i2b = i1b;
for (ChamberHitContainer::const_iterator i2 = i1 + 1; i2 != aState.proto_segment.end(); ++i2) {
++i2b;
const CSCRecHit2D* i2_1 = *i2;
CSCDetId idRH2 = i2_1->cscDetId();
int z2 = idRH2.layer();
Expand All @@ -771,13 +759,11 @@ void CSCSegAlgoRU::baseline(AlgoState& aState, int n_seg_min) const {
if (ir2 == i1 || ir2 == i2 || ir2 == ir)
continue;
float dsum = 0;
int hit_nr = 0;
const CSCRecHit2D* ir2_1 = *ir2;
CSCDetId idRH = ir2_1->cscDetId();
int worst_layer2 = idRH.layer();
for (ChamberHitContainer::const_iterator i = aState.proto_segment.begin(); i != aState.proto_segment.end();
++i) {
++hit_nr;
const CSCRecHit2D* i_1 = *i;
if (i == i1 || i == i2 || i == ir || i == ir2)
continue;
Expand Down
8 changes: 0 additions & 8 deletions RecoLocalMuon/CSCValidation/src/CSCValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,10 @@ void CSCValidation::doRecHits(edm::Handle<CSCRecHit2DCollection> recHits, edm::E
// ---------------------
// Loop over rechits
// ---------------------
int iHit = 0;

// Build iterator for rechits and loop :
CSCRecHit2DCollection::const_iterator dRHIter;
for (dRHIter = recHits->begin(); dRHIter != recHits->end(); dRHIter++) {
iHit++;

// Find chamber with rechits in CSC
CSCDetId idrec = (CSCDetId)(*dRHIter).cscDetId();
Expand Down Expand Up @@ -1113,9 +1111,7 @@ void CSCValidation::doSegments(edm::Handle<CSCSegmentCollection> cscSegments, ed
// -----------------------
// loop over segments
// -----------------------
int iSegment = 0;
for (CSCSegmentCollection::const_iterator dSiter = cscSegments->begin(); dSiter != cscSegments->end(); dSiter++) {
iSegment++;
//
CSCDetId id = (CSCDetId)(*dSiter).cscDetId();
int kEndcap = id.endcap();
Expand Down Expand Up @@ -1208,11 +1204,9 @@ void CSCValidation::doResolution(edm::Handle<CSCSegmentCollection> cscSegments,
// try to get the CSC recHits that contribute to this segment.
std::vector<CSCRecHit2D> theseRecHits = (*dSiter).specificRecHits();
int nRH = (*dSiter).nRecHits();
int jRH = 0;
CLHEP::HepMatrix sp(6, 1);
CLHEP::HepMatrix se(6, 1);
for (std::vector<CSCRecHit2D>::const_iterator iRH = theseRecHits.begin(); iRH != theseRecHits.end(); iRH++) {
jRH++;
CSCDetId idRH = (CSCDetId)(*iRH).cscDetId();
int kRing = idRH.ring();
int kStation = idRH.station();
Expand Down Expand Up @@ -3002,9 +2996,7 @@ void CSCValidation::doTimeMonitoring(edm::Handle<CSCRecHit2DCollection> recHits,
// -----------------------
// loop over segments
// -----------------------
int iSegment = 0;
for (CSCSegmentCollection::const_iterator dSiter = cscSegments->begin(); dSiter != cscSegments->end(); dSiter++) {
iSegment++;

CSCDetId id = (CSCDetId)(*dSiter).cscDetId();
LocalPoint localPos = (*dSiter).localPosition();
Expand Down
2 changes: 0 additions & 2 deletions RecoLocalMuon/DTSegment/src/DTSegmentUpdator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ bool DTSegmentUpdator::fit(DTSegmentCand* seg, bool allow3par, const bool fitdeb
vector<float> sigy;
vector<int> lfit;
vector<double> dist;
int i = 0;

x.reserve(8);
y.reserve(8);
Expand All @@ -250,7 +249,6 @@ bool DTSegmentUpdator::fit(DTSegmentCand* seg, bool allow3par, const bool fitdeb
sigy.push_back(sqrt((*iter).first->localPositionError().xx()));
x.push_back(pos.z());
y.push_back(pos.x());
i++;
}

LocalPoint pos;
Expand Down
3 changes: 0 additions & 3 deletions RecoLocalMuon/RPCRecHit/plugins/CSCSegtoRPC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ std::unique_ptr<RPCRecHitCollection> CSCSegtoRPC::thePoints(const CSCSegmentColl
std::map<CSCDetId, int> CSCSegmentsCounter;
CSCSegmentCollection::const_iterator segment;

int segmentsInThisEventInTheEndcap = 0;

for (segment = allCSCSegments->begin(); segment != allCSCSegments->end(); ++segment) {
CSCSegmentsCounter[segment->cscDetId()]++;
segmentsInThisEventInTheEndcap++;
}

float myTime = -9999.;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,10 @@ template <typename T>
void SiPixelClusterProducer::run(const T& input,
const edm::ESHandle<TrackerGeometry>& geom,
edmNew::DetSetVector<SiPixelCluster>& output) {
int numberOfDetUnits = 0;
int numberOfClusters = 0;

// Iterate on detector units
for (auto const& dsv : input) {
++numberOfDetUnits;

// LogDebug takes very long time, get rid off.
//LogDebug("SiStripClusterizer") << "[SiPixelClusterProducer::run] DetID" << dsv.id;
Expand Down Expand Up @@ -201,9 +199,6 @@ void SiPixelClusterProducer::run(const T& input,
}
} // end of DetUnit loop

//LogDebug ("SiPixelClusterProducer") << " Executing "
// << clusterMode_ << " resulted in " << numberOfClusters
// << " SiPixelClusters in " << numberOfDetUnits << " DetUnits.";
}

#include "FWCore/PluginManager/interface/ModuleDef.h"
Expand Down
2 changes: 0 additions & 2 deletions RecoLocalTracker/SiPixelClusterizer/test/ReadPixClusters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ void ReadPixClusters::analyze(const edm::Event &e, const edm::EventSetup &es) {
horbit->Fill(float(orbit));

countEvents++;
int numberOfDetUnits = 0;
int numberOfClusters = 0;
int numberOfPixels = 0;
int numberOfDetUnits1 = 0;
Expand Down Expand Up @@ -435,7 +434,6 @@ void ReadPixClusters::analyze(const edm::Event &e, const edm::EventSetup &es) {

if (detType != 1)
continue; // look only at pixels
++numberOfDetUnits;

//const GeomDetUnit * genericDet = geom->idToDet(detId);
//const PixelGeomDetUnit * pixDet =
Expand Down
4 changes: 0 additions & 4 deletions RecoLocalTracker/SiPixelClusterizer/test/TestWithTracks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,9 @@ void TestWithTracks::analyze(const edm::Event &e, const edm::EventSetup &es) {
//int numOfPixelsPerLay3 = 0;

int numOfClusPerTrk4 = 0;
int numOfClustersPerLay4 = 0;
//int numOfPixelsPerLay4 = 0;

int numOfClusPerTrk5 = 0;
int numOfClustersPerLay5 = 0;
//int numOfPixelsPerLay5 = 0;

int numOfClustersPerDisk1 = 0;
Expand Down Expand Up @@ -1085,7 +1083,6 @@ void TestWithTracks::analyze(const edm::Event &e, const edm::EventSetup &es) {

} else if (disk == 1) {
numOfClusPerTrk4++;
numOfClustersPerLay4++;
//numOfPixelsPerLay4 += size;

hcharge4->Fill(charge);
Expand All @@ -1102,7 +1099,6 @@ void TestWithTracks::analyze(const edm::Event &e, const edm::EventSetup &es) {

} else if (disk == 2) {
numOfClusPerTrk5++;
numOfClustersPerLay5++;
//numOfPixelsPerLay5 += size;

hcharge5->Fill(charge);
Expand Down
2 changes: 0 additions & 2 deletions RecoLocalTracker/SiPixelRecHits/test/ReadPixelRecHit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ void ReadPixelRecHit::analyze(const edm::Event &e, const edm::EventSetup &es) {
SiPixelRecHitCollection::const_iterator recHitIdIterator = (recHitColl.product())->begin();
SiPixelRecHitCollection::const_iterator recHitIdIteratorEnd = (recHitColl.product())->end();

int numberOfDetUnits = 0;
int numOfRecHits = 0;

int numberOfDetUnits1 = 0;
Expand Down Expand Up @@ -350,7 +349,6 @@ void ReadPixelRecHit::analyze(const edm::Event &e, const edm::EventSetup &es) {

unsigned int layer = 0, disk = 0, ladder = 0, zindex = 0, blade = 0, panel = 0, side = 0;
if (subid == 1) { // Subdet it, pix barrel=1
++numberOfDetUnits;

PXBDetId pdetId = PXBDetId(detId);
//unsigned int detTypeP=pdetId.det(); unused
Expand Down
Loading

0 comments on commit 5df4242

Please sign in to comment.