Skip to content

Commit

Permalink
Merge pull request #40611 from aandvalenzuela/reco-clang-warnings
Browse files Browse the repository at this point in the history
[RECONSTRUCTION][CLANG] Fix clang llvm14 warnings
  • Loading branch information
cmsbuild committed Feb 7, 2023
2 parents 464b909 + 26664b3 commit b6ecba4
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CommonTools/RecoAlgos/interface/KDTreeLinkerAlgo.h
Expand Up @@ -226,7 +226,7 @@ void KDTreeLinkerAlgo<DATA, DIM>::recSearch(int current, const KDTreeBox<DIM> &t
bool isInside = true;
for (unsigned i = 0; i < DIM; ++i) {
float dimCurr = nodePool_.dims[i][current];
isInside &= (dimCurr >= trackBox.dimmin[i]) & (dimCurr <= trackBox.dimmax[i]);
isInside &= (dimCurr >= trackBox.dimmin[i]) && (dimCurr <= trackBox.dimmax[i]);
}
if (isInside) {
closestNeighbour->push_back(nodePool_.data[current]);
Expand Down
5 changes: 0 additions & 5 deletions RecoHI/HiJetAlgos/plugins/HiFJRhoProducer.cc
Expand Up @@ -143,15 +143,10 @@ void HiFJRhoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
double etaMax = mapEtaRangesOut->at(ieta + 1) - radius;

int naccCur = 0;
double rhoCurSum = 0.;
double rhomCurSum = 0.;
for (int i = 0; i < nacc; i++) {
if (etaVec[i] >= etaMin && etaVec[i] < etaMax) {
rhoVecCur.push_back(rhoVec[i]);
rhomVecCur.push_back(rhomVec[i]);

rhoCurSum += rhoVec[i];
rhomCurSum += rhomVec[i];
++naccCur;
} //eta selection
} //accepted jet loop
Expand Down
3 changes: 1 addition & 2 deletions RecoJets/JetProducers/src/MVAJetPuId.cc
Expand Up @@ -223,7 +223,7 @@ PileupJetIdentifier MVAJetPuId::computeIdVariables(const reco::Jet *jet,

reco::TrackRef impactTrack;
float jetPt = jet->pt() / jec; // use uncorrected pt for shape variables
float sumPt = 0., sumPt2 = 0., sumTkPt = 0., sumPtCh = 0, sumPtNe = 0;
float sumPt = 0., sumPt2 = 0., sumPtCh = 0, sumPtNe = 0;
float sum_deta = 0;
float sum_dphi = 0;
float sum_deta2 = 0;
Expand Down Expand Up @@ -299,7 +299,6 @@ PileupJetIdentifier MVAJetPuId::computeIdVariables(const reco::Jet *jet,

if (icand->trackRef().isNonnull() && icand->trackRef().isAvailable()) {
float tkpt = icand->trackRef()->pt();
sumTkPt += tkpt;
bool inVtx0 =
find(vtx->tracks_begin(), vtx->tracks_end(), reco::TrackBaseRef(icand->trackRef())) != vtx->tracks_end();
bool inAnyOther = false;
Expand Down
Expand Up @@ -316,8 +316,8 @@ void PulseShapeFitOOTPileupCorrection::phase1Apply(const HBHEChannelInfo &channe
double noiseADCArr[hcal::constants::maxSamples] = {};
double noiseArrSq[hcal::constants::maxSamples] = {};
double noisePHArr[hcal::constants::maxSamples] = {};
double tsTOT = 0, tstrig = 0; // in fC
double tsTOTen = 0; // in GeV
double tstrig = 0; // in fC
double tsTOTen = 0; // in GeV

// go over the time slices
for (unsigned int ip = 0; ip < cssize; ++ip) {
Expand Down Expand Up @@ -355,7 +355,6 @@ void PulseShapeFitOOTPileupCorrection::phase1Apply(const HBHEChannelInfo &channe
channelData.tsPedestalWidth(ip) * channelData.tsPedestalWidth(ip) +
noisePHArr[ip] * noisePHArr[ip];

tsTOT += charge - ped;
tsTOTen += energy - peden;
if (ip == soi || ip == soi + 1) {
tstrig += charge - ped;
Expand Down
8 changes: 2 additions & 6 deletions RecoLocalCalo/HcalRecAlgos/src/ZdcSimpleRecAlgo.cc
Expand Up @@ -48,7 +48,6 @@ namespace ZdcSimpleRecAlgoImpl {
double ta = 0;
double fc_ampl = 0;
double lowGEnergy = 0;
double lowGfc_ampl = 0;
double TempLGAmp = 0;
// TS increment for regular energy to lowGainEnergy
// Signal in higher TS (effective "low Gain") has a fraction of the whole signal
Expand Down Expand Up @@ -78,9 +77,8 @@ namespace ZdcSimpleRecAlgoImpl {
for (int iLG = (ifirst + lowGainOffset); iLG < tool.size() && iLG < topLowGain; iLG++) {
int capid = digi[iLG].capid();
TempLGAmp = (tool[iLG] - calibs.pedestal(capid)); // pedestal subtraction
lowGfc_ampl += TempLGAmp;
TempLGAmp *= calibs.respcorrgain(capid); // fC --> GeV
TempLGAmp *= lowGainFrac; // TS (signalRegion) --> TS (lowGainRegion)
TempLGAmp *= calibs.respcorrgain(capid); // fC --> GeV
TempLGAmp *= lowGainFrac; // TS (signalRegion) --> TS (lowGainRegion)
lowGEnergy += TempLGAmp;
}
double time = -9999;
Expand Down Expand Up @@ -154,7 +152,6 @@ namespace ZdcSimpleRecAlgoImpl {
double ta = 0;
double fc_ampl = 0;
double lowGEnergy = 0;
double lowGfc_ampl = 0;
double TempLGAmp = 0;
// TS increment for regular energy to lowGainEnergy
// Signal in higher TS (effective "low Gain") has a fraction of the whole signal
Expand Down Expand Up @@ -205,7 +202,6 @@ namespace ZdcSimpleRecAlgoImpl {
continue;
int capid = digi[CurrentTS].capid();
TempLGAmp = tool[CurrentTS] - noise;
lowGfc_ampl += TempLGAmp;
TempLGAmp *= calibs.respcorrgain(capid); // fC --> GeV
TempLGAmp *= lowGainFrac; // TS (signalRegion) --> TS (lowGainRegion)
lowGEnergy += TempLGAmp;
Expand Down
2 changes: 0 additions & 2 deletions RecoLocalMuon/DTSegment/src/DTSegmentUpdator.cc
Expand Up @@ -521,14 +521,12 @@ void DTSegmentUpdator::rejectBadHits(DTChamberRecSegment2D* phiSeg) const {
float Sx = 0.;
float Sy = 0.;
float Sx2 = 0.;
float Sy2 = 0.;
float Sxy = 0.;

for (size_t i = 0; i < N; ++i) {
Sx += x.at(i);
Sy += y.at(i);
Sx2 += x.at(i) * x.at(i);
Sy2 += y.at(i) * y.at(i);
Sxy += x.at(i) * y.at(i);
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ SiPixelDigisClustersFromSoAT<TrackerTraits>::SiPixelDigisClustersFromSoAT(const
clusterThresholds_{iConfig.getParameter<int>("clusterThreshold_layer1"),
iConfig.getParameter<int>("clusterThreshold_otherLayers")},
produceDigis_(iConfig.getParameter<bool>("produceDigis")),
storeDigis_(iConfig.getParameter<bool>("produceDigis") & iConfig.getParameter<bool>("storeDigis")) {
storeDigis_(iConfig.getParameter<bool>("produceDigis") && iConfig.getParameter<bool>("storeDigis")) {
if (produceDigis_)
digiPutToken_ = produces<edm::DetSetVector<PixelDigi>>();
}
Expand Down
2 changes: 1 addition & 1 deletion RecoLocalTracker/SiPixelRecHits/src/PixelCPEBase.cc
Expand Up @@ -246,7 +246,7 @@ void PixelCPEBase::setTheClu(DetParam const& theDetParam, ClusterParam& theClust
//if(theClusterParam.theCluster->pixelADC()[i] == 0) { hasBadPixels_ = true; break;}
//}

theClusterParam.spansTwoROCs_ = theDetParam.theRecTopol->containsBigPixelInX(minInX, maxInX) |
theClusterParam.spansTwoROCs_ = theDetParam.theRecTopol->containsBigPixelInX(minInX, maxInX) ||
theDetParam.theRecTopol->containsBigPixelInY(minInY, maxInY);
}

Expand Down
Expand Up @@ -157,7 +157,7 @@ void Basic2DGenericPFlowPositionCalc::calculateAndSetPositionActual(reco::PFClus
hits[i] = {p, (*p).energy(), float(hf.fraction())};
}

bool resGiven = bool(_timeResolutionCalcBarrel) & bool(_timeResolutionCalcEndcap);
bool resGiven = bool(_timeResolutionCalcBarrel) && bool(_timeResolutionCalcEndcap);
LHit mySeed = {};
for (auto const& rhf : hits) {
const reco::PFRecHit& refhit = *rhf.hit;
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/CkfPattern/plugins/TrajectorySegmentBuilder.cc
Expand Up @@ -382,7 +382,7 @@ void TrajectorySegmentBuilder::updateWithInvalidHit(TempTrajectory& traj,
auto const& measurements = gr.measurements();
for (auto im = measurements.rbegin(); im != measurements.rend(); ++im) {
auto const& hit = im->recHitR();
if ((hit.getType() == TrackingRecHit::valid) | (hit.getType() == TrackingRecHit::missing))
if ((hit.getType() == TrackingRecHit::valid) || (hit.getType() == TrackingRecHit::missing))
continue;
//
// check, if the extrapolation traverses the Det or
Expand Down
Expand Up @@ -19,7 +19,7 @@ namespace {
mva(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
: forestLabel_(cfg.getParameter<std::string>("GBRForestLabel")),
dbFileName_(cfg.getParameter<std::string>("GBRForestFileName")),
useForestFromDB_((!forestLabel_.empty()) & dbFileName_.empty()) {
useForestFromDB_((!forestLabel_.empty()) && dbFileName_.empty()) {
if (useForestFromDB_) {
forestToken_ = iC.esConsumes(edm::ESInputTag("", forestLabel_));
}
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/MeasurementDet/plugins/doubleMatch.icc
Expand Up @@ -126,7 +126,7 @@ void TkGluedMeasurementDet::doubleMatch(const TrajectoryStateOnSurface& ts,
return;
}

if ((!monoHits.empty()) & (!stereoHits.empty())) {
if ((!monoHits.empty()) && (!stereoHits.empty())) {
const GluedGeomDet* gluedDet = &specificGeomDet();
LocalVector trdir = (ts.isValid() ? ts.localDirection() : surface().toLocal(position() - GlobalPoint(0, 0, 0)));

Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/TkSeedingLayers/src/SeedingLayerSetsBuilder.cc
Expand Up @@ -296,7 +296,7 @@ void SeedingLayerSetsBuilder::updateEventSetup(const edm::EventSetup& es) {
// We want to evaluate both in the first invocation (to properly
// initialize ESWatcher), and this way we avoid one branch compared
// to || (should be tiny effect)
if (!(geometryWatcher_.check(es) | trhWatcher_.check(es)))
if (!(geometryWatcher_.check(es) || trhWatcher_.check(es)))
return;

const GeometricSearchTracker& tracker = es.getData(trackerToken_);
Expand Down
Expand Up @@ -93,7 +93,7 @@ class Traj2TrackHits {
auto const &hit = *(*itm).recHit()->hit();
if ((removeNoDet) & ((*itm).recHitR().det() == nullptr))
continue;
if (trackerHitRTTI::isUndef(hit) | trackerHitRTTI::isNotFromCluster(hit) | (hit.dimension() != 2)) {
if (trackerHitRTTI::isUndef(hit) || trackerHitRTTI::isNotFromCluster(hit) || (hit.dimension() != 2)) {
hits.push_back(hit.clone());
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion TrackingTools/GsfTools/interface/CloseComponentsMerger.icc
Expand Up @@ -73,7 +73,7 @@ MultiGaussianState<N> CloseComponentsMerger<N>::merge(const MultiState& mgs) con
comp.push_back(ori[toMerge.top()]);
comp.push_back(ori[ii]);
active[ii] = false;
while ((!toMerge.empty()) & (!active[toMerge.top()])) {
while ((!toMerge.empty()) && (!active[toMerge.top()])) {
toMerge.pop();
}
--nComp;
Expand Down

0 comments on commit b6ecba4

Please sign in to comment.