Skip to content

Commit

Permalink
[ALCA] [LLVM14] Apply code checks
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Nov 30, 2022
1 parent c9ca58d commit f7d87a6
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Alignment/CocoaModel/src/EntryMgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ EntryData* EntryMgr::findEntryByLongName(const ALIstring& optoName, const ALIstr
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
EntryData* EntryMgr::findEntry(const std::vector<ALIstring>& wl) {
EntryData* data = nullptr;
ALIstring optoName = wl[2];
ALIstring entryName = wl[3];
const ALIstring& optoName = wl[2];
const ALIstring& entryName = wl[3];
data = findEntryByLongName(optoName, entryName);

return data;
Expand Down
2 changes: 1 addition & 1 deletion Alignment/CocoaModel/src/Model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void Model::readSystemDescription() {
std::cerr << "!!!SYSTEM_TREE_DESCRIPTION section: object " << *((*vvscite).begin())
<< " is not hanging from object 'system' " << std::endl;
for (vvscite = OptODictionary().begin(); vvscite != OptODictionary().end(); ++vvscite) {
std::vector<ALIstring> ptemp = *vvscite;
const std::vector<ALIstring>& ptemp = *vvscite;
ALIUtils::dumpVS(ptemp, "OBJECT ", std::cerr);
}
exit(9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TkModuleGroupSelector::TkModuleGroupSelector(AlignableTracker *aliTracker,
std::vector<std::string> parameterNames = cfg.getParameterNames();
for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(); iParam != parameterNames.end();
++iParam) {
const std::string name = (*iParam);
const std::string& name = (*iParam);
if (name != "RunRange" && name != "ReferenceRun" && name != "Granularity") {
throw cms::Exception("BadConfig") << "@SUB=TkModuleGroupSelector::TkModuleGroupSelector:"
<< " Unknown parameter name '" << name << "' in PSet. Maybe a typo?";
Expand Down Expand Up @@ -107,7 +107,7 @@ void TkModuleGroupSelector::verifyParameterNames(const edm::ParameterSet &pset,
std::vector<std::string> parameterNames = pset.getParameterNames();
for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(); iParam != parameterNames.end();
++iParam) {
const std::string name = (*iParam);
const std::string& name = (*iParam);
if (name != "levels" && name != "RunRange" && name != "split" && name != "ReferenceRun") {
throw cms::Exception("BadConfig") << "@SUB=TkModuleGroupSelector::verifyParameterNames:"
<< " Unknown parameter name '" << name << "' in PSet number " << psetnr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ void AlignmentMonitorMuonResiduals::event(const edm::Event &iEvent,
std::vector<TrajectoryMeasurement> measurements = traj->measurements();

for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end(); ++im) {
const TrajectoryMeasurement meas = *im;
const TrajectoryMeasurement& meas = *im;
const TransientTrackingRecHit *hit = &(*meas.recHit());
const DetId id = hit->geographicalId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void AlignmentMonitorTemplate::event(const edm::Event& iEvent,

std::vector<TrajectoryMeasurement> measurements = traj->measurements();
for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end(); ++im) {
const TrajectoryMeasurement meas = *im;
const TrajectoryMeasurement& meas = *im;
const TransientTrackingRecHit* hit = &(*meas.recHit());
const DetId id = hit->geographicalId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ AlgebraicMatrix CompositeAlignmentParameters::derivativesLegacy(const std::vecto
int ipos = 1;
AlgebraicMatrix selderiv(nparam, 2);
for (std::vector<AlgebraicMatrix>::const_iterator imat = vecderiv.begin(); imat != vecderiv.end(); ++imat) {
AlgebraicMatrix thisselderiv = (*imat);
const AlgebraicMatrix& thisselderiv = (*imat);
int npar = thisselderiv.num_row();
selderiv.sub(ipos, 1, thisselderiv);
ipos += npar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void AlignmentMuonHIPTrajectorySelector::produce(edm::Event& iEvent, const edm::
double tracker_dof = 0.;
for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end();
++im) {
const TrajectoryMeasurement meas = *im;
const TrajectoryMeasurement& meas = *im;
auto hit = &(*meas.recHit());
const DetId id = hit->geographicalId();

Expand Down Expand Up @@ -193,7 +193,7 @@ void AlignmentMuonHIPTrajectorySelector::produce(edm::Event& iEvent, const edm::

for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end();
++im) {
const TrajectoryMeasurement meas = *im;
const TrajectoryMeasurement& meas = *im;
auto hit = &(*meas.recHit());
const DetId id = hit->geographicalId();

Expand Down
2 changes: 1 addition & 1 deletion Alignment/LaserAlignment/plugins/TkLasBeamFitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void TkLasBeamFitter::getLasBeams(TkFittedLasBeam &beam, vector<TrajectoryStateO
for (TkLasBeam::const_iterator iHit = beam.begin(); iHit < beam.end(); ++iHit) {
// iHit is a SiStripLaserRecHit2D

const SiStripLaserRecHit2D hit(*iHit);
const SiStripLaserRecHit2D& hit(*iHit);

this->getLasHits(beam, hit, gd, globHit, hitsAtTecPlus);
sumZ += globHit.back().z();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ void MillePedeAlignmentAlgorithm::run(const edm::EventSetup &setup, const EventI
const auto tracksPerTraj = theTrajectoryFactory->tracksPerTrajectory();
for (auto iRefTraj = trajectories.cbegin(), iRefTrajE = trajectories.cend(); iRefTraj != iRefTrajE;
++iRefTraj, ++refTrajCount) {
RefTrajColl::value_type refTrajPtr = *iRefTraj;
const RefTrajColl::value_type& refTrajPtr = *iRefTraj;
if (theMonitor)
theMonitor->fillRefTrajectory(refTrajPtr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ MuonResidualsFromTrack::MuonResidualsFromTrack(edm::ESHandle<TransientTrackingRe
if (m_debug)
std::cout << " TrajectoryMeasurement #" << nTrajMeasurement << std::endl;

TrajectoryMeasurement trajMeasurement = *iTrajMeasurement;
const TrajectoryMeasurement& trajMeasurement = *iTrajMeasurement;

TrajectoryStateOnSurface tsos =
m_tsoscomb(trajMeasurement.forwardPredictedState(), trajMeasurement.backwardPredictedState());
Expand Down
2 changes: 1 addition & 1 deletion Alignment/OfflineValidation/plugins/EopElecTreeWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ void EopElecTreeWriter::analyze(const edm::Event& iEvent, const edm::EventSetup&
edm::LogError("EopElecTreeWriter") << "Error: no primary vertex found!";
return;
}
reco::Vertex vert = vertex.front();
const reco::Vertex& vert = vertex.front();
h_nEventsWithVertex->Fill(0.5);

// getting calorimeter geometry
Expand Down
2 changes: 1 addition & 1 deletion Alignment/OfflineValidation/plugins/JetHTAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void JetHTAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe

int counter = 0;
for (reco::VertexCollection::const_iterator pvIt = pvtx.begin(); pvIt != pvtx.end(); pvIt++) {
reco::Vertex iPV = *pvIt;
const reco::Vertex& iPV = *pvIt;
counter++;

if (iPV.isFake())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void SplitVertexResolution::analyze(const edm::Event& iEvent, const edm::EventSe
int goodcounter = 0;

for (auto pvIt = pvtx.cbegin(); pvIt != pvtx.cend(); ++pvIt) {
reco::Vertex iPV = *pvIt;
const reco::Vertex& iPV = *pvIt;
counter++;
if (iPV.isFake())
continue;
Expand Down
2 changes: 1 addition & 1 deletion CalibFormats/SiPixelObjects/src/PixelCalibConfiguration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ std::set<unsigned int> PixelCalibConfiguration::getTKFECCrates(
const std::set<std::string> portCards = portcardmap->portcards(*imodule);
for (std::set<std::string>::const_iterator portCards_itr = portCards.begin(); portCards_itr != portCards.end();
++portCards_itr) {
const std::string portcardname = *portCards_itr;
const std::string& portcardname = *portCards_itr;
std::map<std::string, PixelPortCardConfig*>::const_iterator portcardconfig_itr =
mapNamePortCard.find(portcardname);
assert(portcardconfig_itr != mapNamePortCard.end());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@ void SelectedElectronFEDListProducer<TEle, TCand>::produce(edm::Event& iEvent, c
//cycle on subdets
for (uint32_t idet = 0; idet < SiStripRegionCabling::ALLSUBDETS; idet++) { //cicle between 1 and 4
//get vector of layers whin subdet of region
const SiStripRegionCabling::WedgeCabling regSubdetLayers = regSubdets[idet]; // at most 10 layers
const SiStripRegionCabling::WedgeCabling& regSubdetLayers = regSubdets[idet]; // at most 10 layers
for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
//get map of vectors of feds withing the layer of subdet of region
const SiStripRegionCabling::ElementCabling fedVectorMap =
const SiStripRegionCabling::ElementCabling& fedVectorMap =
regSubdetLayers[ilayer]; // vector of the fed
SiStripRegionCabling::ElementCabling::const_iterator itFedMap = fedVectorMap.begin();
for (; itFedMap != fedVectorMap.end(); itFedMap++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ void SiStripRegFEDSelector::produce(edm::StreamID, edm::Event& iEvent, const edm
//cycle on subdets
for (uint32_t idet = 0; idet < SiStripRegionCabling::ALLSUBDETS; idet++) {
//get vector of layers within subdet of region
const SiStripRegionCabling::WedgeCabling regSubdetLayers = regSubdets[idet];
const SiStripRegionCabling::WedgeCabling& regSubdetLayers = regSubdets[idet];
for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
//get map of vectors of feds withing the layer of subdet of region
const SiStripRegionCabling::ElementCabling fedVectorMap = regSubdetLayers[ilayer];
const SiStripRegionCabling::ElementCabling& fedVectorMap = regSubdetLayers[ilayer];
SiStripRegionCabling::ElementCabling::const_iterator it = fedVectorMap.begin();
for (; it != fedVectorMap.end(); it++) {
for (uint32_t op = 0; op < (it->second).size(); op++) {
Expand Down
2 changes: 1 addition & 1 deletion Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ void IsolatedTracksNxN::analyze(const edm::Event &iEvent, const edm::EventSetup
if (!((*recVtxs)[ind].isFake())) {
reco::Vertex::trackRef_iterator vtxTrack = (*recVtxs)[ind].tracks_begin();
for (vtxTrack = (*recVtxs)[ind].tracks_begin(); vtxTrack != (*recVtxs)[ind].tracks_end(); vtxTrack++) {
const edm::RefToBase<reco::Track> pvtxTrack = (*vtxTrack);
const edm::RefToBase<reco::Track>& pvtxTrack = (*vtxTrack);
if (pTrack == pvtxTrack.get()) {
pVtxTkId = ind;
break;
Expand Down

0 comments on commit f7d87a6

Please sign in to comment.