Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DataFormats/JetReco/src/CaloJet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ CaloTowerPtr CaloJet::getCaloConstituent(unsigned fIndex) const {

std::vector<CaloTowerPtr> CaloJet::getCaloConstituents() const {
std::vector<CaloTowerPtr> result;
result.reserve(numberOfDaughters());
for (unsigned i = 0; i < numberOfDaughters(); i++)
result.push_back(getCaloConstituent(i));
return result;
Expand Down Expand Up @@ -115,6 +116,7 @@ std::string CaloJet::print() const {
std::vector<CaloTowerDetId> CaloJet::getTowerIndices() const {
std::vector<CaloTowerDetId> result;
std::vector<CaloTowerPtr> towers = getCaloConstituents();
result.reserve(towers.size());
for (unsigned i = 0; i < towers.size(); ++i) {
result.push_back(towers[i]->id());
}
Expand Down
1 change: 1 addition & 0 deletions DataFormats/JetReco/src/GenJet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const GenParticle* GenJet::getGenConstituent(unsigned fIndex) const {

std::vector<const GenParticle*> GenJet::getGenConstituents() const {
std::vector<const GenParticle*> result;
result.reserve(numberOfDaughters());
for (unsigned i = 0; i < numberOfDaughters(); i++)
result.push_back(getGenConstituent(i));
return result;
Expand Down
1 change: 1 addition & 0 deletions DataFormats/JetReco/src/PFJet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ reco::PFCandidatePtr PFJet::getPFConstituent(unsigned fIndex) const {

std::vector<reco::PFCandidatePtr> PFJet::getPFConstituents() const {
std::vector<PFCandidatePtr> result;
result.reserve(numberOfDaughters());
for (unsigned i = 0; i < numberOfDaughters(); i++)
result.push_back(getPFConstituent(i));
return result;
Expand Down
1 change: 1 addition & 0 deletions DataFormats/JetReco/src/TrackJet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ edm::Ptr<reco::Track> reco::TrackJet::track(size_t i) const {

std::vector<edm::Ptr<reco::Track> > reco::TrackJet::tracks() const {
std::vector<edm::Ptr<reco::Track> > result;
result.reserve(numberOfDaughters());
for (unsigned i = 0; i < numberOfDaughters(); i++)
result.push_back(track(i));
return result;
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/ParticleFlowCandidate/src/PFCandidate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ ostream& reco::operator<<(ostream& out, const PFCandidate& c) {

out << ", blocks/iele: ";

PFCandidate::ElementsInBlocks eleInBlocks = c.elementsInBlocks();
const PFCandidate::ElementsInBlocks& eleInBlocks = c.elementsInBlocks();
for (unsigned i = 0; i < eleInBlocks.size(); i++) {
PFBlockRef blockRef = eleInBlocks[i].first;
unsigned indexInBlock = eleInBlocks[i].second;
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/TauReco/src/PFTauDecayMode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace reco {
std::vector<const Candidate*> PFTauDecayMode::chargedPionCandidates() const {
size_type numberOfChargedPions = chargedPions_.numberOfDaughters();
std::vector<const Candidate*> output;
output.reserve(numberOfChargedPions);
for (size_type iterCand = 0; iterCand < numberOfChargedPions; ++iterCand)
output.push_back(chargedPions_.daughter(iterCand));
return output;
Expand All @@ -53,6 +54,7 @@ namespace reco {
std::vector<const Candidate*> PFTauDecayMode::neutralPionCandidates() const {
size_type numberOfChargedPions = piZeroes_.numberOfDaughters();
std::vector<const Candidate*> output;
output.reserve(numberOfChargedPions);
for (size_type iterCand = 0; iterCand < numberOfChargedPions; ++iterCand)
output.push_back(piZeroes_.daughter(iterCand));
return output;
Expand Down
2 changes: 1 addition & 1 deletion EventFilter/CSCRawToDigi/src/CSCCFEBData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ CSCCFEBData::CSCCFEBData(unsigned number, bool sixteenSamples, uint16_t format_v
}

void CSCCFEBData::add(const CSCStripDigi &digi, int layer) {
std::vector<int> scaCounts = digi.getADCCounts();
const std::vector<int> &scaCounts = digi.getADCCounts();
for (unsigned itime = 0; itime < theNumberOfSamples; ++itime) {
unsigned channel = (digi.getStrip() - 1) % 16 + 1;
unsigned value = scaCounts[itime] & 0xFFF; // 12-bit
Expand Down
1 change: 1 addition & 0 deletions JetMETCorrections/Modules/plugins/JetResolutionDemo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ void JetResolutionDemo::analyze(const edm::Event& iEvent, const edm::EventSetup&
}

std::vector<float> res;
res.reserve(40);
for (std::size_t i = 0; i < 40; i++) {
res.push_back(i * 0.005);
}
Expand Down
1 change: 1 addition & 0 deletions MagneticField/GeomBuilder/src/bLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ MagBLayer* bLayer::buildMagBLayer() const {

// If we have several sectors, create the MagBSector
std::vector<MagBSector*> mSectors;
mSectors.reserve(sectors.size());
for (unsigned int i = 0; i < sectors.size(); ++i) {
mSectors.push_back(sectors[i].buildMagBSector());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ void TemplatedSecondaryVertexProducer<IPTI, VTX>::produce(edm::Event &event, con

std::vector<double> dR2toSubjets;

dR2toSubjets.reserve(subjetIndices.at(i).size());
for (size_t sj = 0; sj < subjetIndices.at(i).size(); ++sj)
dR2toSubjets.push_back(Geom::deltaR2(p.rapidity(),
p.phi_std(),
Expand Down Expand Up @@ -671,6 +672,7 @@ void TemplatedSecondaryVertexProducer<IPTI, VTX>::produce(edm::Event &event, con

std::vector<double> dR2toSubjets;

dR2toSubjets.reserve(subjetIndices.at(i).size());
for (size_t sj = 0; sj < subjetIndices.at(i).size(); ++sj)
dR2toSubjets.push_back(Geom::deltaR2(p.rapidity(),
p.phi_std(),
Expand Down
4 changes: 2 additions & 2 deletions RecoEcal/EgammaClusterAlgos/src/HybridClusterAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void HybridClusterAlgo::mainSearch(const EcalRecHitCollection* hits, const CaloS
int nhits = 0;
for (int j = 0; j < int(dominoEnergy.size()); ++j) {
if (OwnerShip[j] == i) {
std::vector<EcalRecHit> temp = dominoCells[j];
const std::vector<EcalRecHit>& temp = dominoCells[j];
for (int k = 0; k < int(temp.size()); ++k) {
dets.push_back(std::pair<DetId, float>(temp[k].id(), 1.)); // by default energy fractions are 1
if (temp[k].id() == itID)
Expand Down Expand Up @@ -471,7 +471,7 @@ reco::SuperClusterCollection HybridClusterAlgo::makeSuperClusters(const reco::Ca
//supercluster. This could be somehow more efficient.

for (int i = 0; i < int(thiscoll.size()); ++i) {
reco::BasicCluster thisclus = thiscoll[i]; //The Cluster in question.
const reco::BasicCluster& thisclus = thiscoll[i]; //The Cluster in question.
for (int j = 0; j < int(clustersCollection.size()); ++j) {
//Find the appropriate cluster from the list of references
reco::BasicCluster cluster_p = *clustersCollection[j];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ float EcalBasicClusterLocalContCorrection::operator()(const reco::BasicCluster &

//search which crystal is closest to the cluster position and call it crystalseed:
//std::vector<DetId> crystals_vector = *scRef.getHitsByDetId(); //deprecated
std::vector<std::pair<DetId, float> > crystals_vector = basicCluster.hitsAndFractions();
const std::vector<std::pair<DetId, float> > &crystals_vector = basicCluster.hitsAndFractions();
float dphimin = 999.;
float detamin = 999.;
int ietaclosest = 0;
Expand Down
4 changes: 2 additions & 2 deletions RecoEcal/EgammaClusterProducers/src/EcalDigiSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void EcalDigiSelector::produce(edm::Event& evt, const edm::EventSetup& es) {
std::vector<DetId> saveTheseDetIds;
//pick out the detids for the 3x3 in each of the selected superclusters
for (int loop = 0; loop < int(saveBarrelSuperClusters.size()); loop++) {
SuperCluster clus1 = saveBarrelSuperClusters[loop];
const SuperCluster& clus1 = saveBarrelSuperClusters[loop];
const CaloClusterPtr& bcref = clus1.seed();
const BasicCluster* bc = bcref.get();
//Get the maximum detid
Expand Down Expand Up @@ -206,7 +206,7 @@ void EcalDigiSelector::produce(edm::Event& evt, const edm::EventSetup& es) {
std::set<DetId> saveTheseDetIds;
//pick out the digis for the 3x3 in each of the selected superclusters
for (int loop = 0; loop < int(saveEndcapSuperClusters.size()); loop++) {
SuperCluster clus1 = saveEndcapSuperClusters[loop];
const SuperCluster& clus1 = saveEndcapSuperClusters[loop];
const CaloClusterPtr& bcref = clus1.seed();
const BasicCluster* bc = bcref.get();
//Get the maximum detid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void UncleanSCRecoveryProducer::produce(edm::StreamID, edm::Event& evt, const ed
// the new collection
LogTrace("EcalCleaning") << "The new SC clean collection with size " << superClusters.size();
for (unsigned int i = 0; i < superClusters.size(); ++i) {
const reco::SuperCluster nsc = superClusters[i];
const reco::SuperCluster& nsc = superClusters[i];
LogTrace("EcalCleaning") << " >>> newSC #" << i << "; Energy: " << nsc.energy() << " eta: " << nsc.eta()
<< " isClean=" << nsc.isInClean() << " isUnclean=" << nsc.isInUnclean()
<< " sc seed detid: " << nsc.seed()->seed().rawId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void UnifiedSCCollectionProducer::produce(edm::Event& evt, const edm::EventSetup
}
LogTrace("UnifiedSC") << "The new SC unclean only collection with size " << superClustersUncleanOnly.size();
for (int i = 0; i < (int)superClustersUncleanOnly.size(); ++i) {
const reco::SuperCluster nsc = superClustersUncleanOnly[i];
const reco::SuperCluster& nsc = superClustersUncleanOnly[i];
LogTrace("UnifiedSC") << " >>> newSC #" << i << "; Energy: " << nsc.energy() << " eta: " << nsc.eta()
<< " isClean=" << nsc.isInClean() << " isUnclean=" << nsc.isInUnclean()
<< " sc seed detid: " << nsc.seed()->seed().rawId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ float EcalClusterCrackCorrection::getValue(const reco::CaloCluster &seedbclus) c

//search which crystal is closest to the cluster position and call it crystalseed:
//std::vector<DetId> crystals_vector = seedbclus.getHitsByDetId(); //deprecated
std::vector<std::pair<DetId, float> > crystals_vector = seedbclus.hitsAndFractions();
const std::vector<std::pair<DetId, float> > &crystals_vector = seedbclus.hitsAndFractions();
float dphimin = 999.;
float detamin = 999.;
int ietaclosest = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void LowPtGsfElectronSeedValueMapsProducer::produce(edm::Event& event, const edm

// Iterate through GsfTracks, extract BDT output, and store result in ValueMap for each model
std::vector<std::vector<float> > output;
output.reserve(names_.size());
for (unsigned int iname = 0; iname < names_.size(); ++iname) {
output.push_back(std::vector<float>(gsfTracks->size(), -999.));
}
Expand Down
2 changes: 1 addition & 1 deletion RecoEgamma/EgammaIsolationAlgos/src/ElectronTkIsolation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ std::pair<int, double> ElectronTkIsolation::getIso(const reco::Track* tmpTrack)
int counter = 0;
double ptSum = 0.;
//Take the electron track
math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum();
const math::XYZVector& tmpElectronMomentumAtVtx = (*tmpTrack).momentum();
double tmpElectronEtaAtVertex = (*tmpTrack).eta();

for (reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin(); itrTr != (*trackCollection_).end();
Expand Down
2 changes: 1 addition & 1 deletion RecoEgamma/EgammaPhotonAlgos/src/ConversionVertexFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ConversionVertexFinder::~ConversionVertexFinder() {
}

bool ConversionVertexFinder::run(const std::vector<reco::TransientTrack>& _pair, reco::Vertex& the_vertex) {
std::vector<reco::TransientTrack> pair = _pair;
const std::vector<reco::TransientTrack>& pair = _pair;
bool found = false;

if (pair.size() < 2)
Expand Down
2 changes: 2 additions & 0 deletions RecoEgamma/EgammaPhotonProducers/src/ConversionTrackMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ void ConversionTrackMerger::produce(edm::Event& e, const edm::EventSetup& es) {
int i;

std::vector<int> selected1;
selected1.reserve(tC1.size());
for (unsigned int i = 0; i < tC1.size(); ++i) {
selected1.push_back(1);
}
std::vector<int> selected2;
selected2.reserve(tC2.size());
for (unsigned int i = 0; i < tC2.size(); ++i) {
selected2.push_back(1);
}
Expand Down
4 changes: 2 additions & 2 deletions RecoEgamma/EgammaTools/src/EcalClusterLocal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace egammaTools {
double depth = X0 * (T0 + log(bclus.energy()));

//find max energy crystal
std::vector<std::pair<DetId, float> > crystals_vector = bclus.hitsAndFractions();
const std::vector<std::pair<DetId, float> > &crystals_vector = bclus.hitsAndFractions();
float drmin = 999.;
EBDetId crystalseed;
//printf("starting loop over crystals, etot = %5f:\n",bclus.energy());
Expand Down Expand Up @@ -115,7 +115,7 @@ namespace egammaTools {
double depth = X0 * (T0 + log(bclus.energy()));

//find max energy crystal
std::vector<std::pair<DetId, float> > crystals_vector = bclus.hitsAndFractions();
const std::vector<std::pair<DetId, float> > &crystals_vector = bclus.hitsAndFractions();
float drmin = 999.;
EEDetId crystalseed;
//printf("starting loop over crystals, etot = %5f:\n",bclus.energy());
Expand Down
1 change: 1 addition & 0 deletions RecoHGCal/TICL/plugins/TICLDumper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ class TracksterDumperHelper {
}

std::vector<float> id_probs;
id_probs.reserve(8);
for (size_t i = 0; i < 8; i++)
id_probs.push_back(trackster_iterator->id_probabilities(i));
trackster_id_probabilities.push_back(id_probs);
Expand Down
1 change: 1 addition & 0 deletions RecoHGCal/TICL/plugins/TracksterLinkingbySkeletons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ void TracksterLinkingbySkeletons::linkTracksters(
std::vector<int> isRootTracksters(tracksters.size(), 1);

std::vector<ticl::Node> allNodes;
allNodes.reserve(tracksters.size());
for (size_t it = 0; it < tracksters.size(); ++it) {
allNodes.emplace_back(it);
}
Expand Down
1 change: 1 addition & 0 deletions RecoHI/HiJetAlgos/plugins/HiPuRhoProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ void HiPuRhoProducer::putRho(edm::Event& iEvent, const edm::EventSetup& iSetup)
std::size_t size = etaEdgeLow_.size();

std::vector<std::pair<std::size_t, double>> order;
order.reserve(size);
for (std::size_t i = 0; i < size; ++i) {
order.emplace_back(i, etaEdgeLow_[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion RecoJets/JetAlgorithms/src/CATopJetAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void CATopJetAlgorithm::run(const vector<fastjet::PseudoJet>& cell_particles,
if (verbose_)
cout << "\nJet " << i << endl;
i++;
fastjet::PseudoJet localJet = *jetIt;
const fastjet::PseudoJet& localJet = *jetIt;

// Get the 4-vector for this jet
p4_hardJets.push_back(math::XYZTLorentzVector(localJet.px(), localJet.py(), localJet.pz(), localJet.e()));
Expand Down
4 changes: 2 additions & 2 deletions RecoJets/JetAlgorithms/src/CATopJetHelper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ reco::CATopJetProperties CATopJetHelper::operator()(reco::Jet const& ihardJet) c
// Now look at the subjets that were formed
for (int isub = 0; isub < 2; ++isub) {
// Get this subjet
reco::Jet::Constituent icandJet = subjets[isub];
const reco::Jet::Constituent& icandJet = subjets[isub];

// Now look at the "other" subjets than this one, form the minimum invariant mass
// pairing, as well as the "closest" combination to the W mass
for (int jsub = isub + 1; jsub < 3; ++jsub) {
// Get the second subjet
reco::Jet::Constituent jcandJet = subjets[jsub];
const reco::Jet::Constituent& jcandJet = subjets[jsub];

reco::Candidate::LorentzVector wCand = icandJet->p4() + jcandJet->p4();

Expand Down
1 change: 1 addition & 0 deletions RecoJets/JetProducers/src/JetMatchingTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ const reco::CandidateCollection* JetMatchingTools::getGenParticlesCollection() {
std::vector<const CaloTower*> JetMatchingTools::getConstituents(const reco::CaloJet& fJet) {
std::vector<const CaloTower*> result;
std::vector<CaloTowerPtr> constituents = fJet.getCaloConstituents();
result.reserve(constituents.size());
for (unsigned i = 0; i < constituents.size(); ++i)
result.push_back(&*(constituents[i]));
return result;
Expand Down
6 changes: 3 additions & 3 deletions RecoJets/JetProducers/src/PileupJPTJetIdAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace cms {
std::cout << "================ jetEta = " << (*jet).eta() << std::endl;
}

const edm::RefToBase<reco::Jet> jptjetRef = jet->getCaloJetRef();
const edm::RefToBase<reco::Jet>& jptjetRef = jet->getCaloJetRef();
reco::CaloJet const* rawcalojet = dynamic_cast<reco::CaloJet const*>(&*jptjetRef);

int ncalotowers = 0.;
Expand Down Expand Up @@ -196,7 +196,7 @@ namespace cms {
double detatr1 = 0.;
double dphidetatr = 0.;

const reco::TrackRefVector pioninin = (*jet).getPionsInVertexInCalo();
const reco::TrackRefVector& pioninin = (*jet).getPionsInVertexInCalo();

for (reco::TrackRefVector::const_iterator it = pioninin.begin(); it != pioninin.end(); it++) {
if ((*it)->pt() > 0.5 && ((*it)->ptError() / (*it)->pt()) < 0.05) {
Expand All @@ -221,7 +221,7 @@ namespace cms {
}
} // pioninin

const reco::TrackRefVector pioninout = (*jet).getPionsInVertexOutCalo();
const reco::TrackRefVector& pioninout = (*jet).getPionsInVertexOutCalo();

for (reco::TrackRefVector::const_iterator it = pioninout.begin(); it != pioninout.end(); it++) {
if ((*it)->pt() > 0.5 && ((*it)->ptError() / (*it)->pt()) < 0.05) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ void CaloTowersCreationAlgo::rescaleTowers(const CaloTowerCollection& ctc, CaloT
theTowerTopology->lastHORing());

std::vector<DetId> contains;
contains.reserve(ctcItr->constituentsSize());
for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
contains.push_back(ctcItr->constituent(iConst));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ void EcalUncalibRecHitWorkerMultiFit::run(const edm::Event& evt,
} else if (timealgo_ == weightsMethod) {
// weights method on the PU subtracted pulse shape
std::vector<double> amplitudes;
amplitudes.reserve(activeBX.size());
for (unsigned int ibx = 0; ibx < activeBX.size(); ++ibx)
amplitudes.push_back(uncalibRecHit.outOfTimeAmplitude(ibx));

Expand Down
1 change: 1 addition & 0 deletions RecoLocalCalo/HcalLaserReco/src/HcalLaserUnpacker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void HcalLaserUnpacker::unpack(const FEDRawData& raw, HcalLaserDigi& digi) const

// first, we do the QADC
std::vector<uint16_t> qadcvals;
qadcvals.reserve(qdctdc->n_qdc_hits);
for (unsigned int i = 0; i < qdctdc->n_qdc_hits; i++) {
qadcvals.push_back(qdctdc->qdc_values[i] & 0xFFF);
}
Expand Down
2 changes: 1 addition & 1 deletion RecoLocalMuon/CSCEfficiency/src/CSCEfficiency.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ TrajectoryStateOnSurface CSCEfficiency::propagate(FreeTrajectoryState &ftsStart,
//
bool CSCEfficiency::applyTrigger(edm::Handle<edm::TriggerResults> &hltR, const edm::TriggerNames &triggerNames) {
bool triggerPassed = true;
std::vector<std::string> hlNames = triggerNames.triggerNames();
const std::vector<std::string> &hlNames = triggerNames.triggerNames();
pointToTriggers.clear();
for (size_t imyT = 0; imyT < myTriggers.size(); ++imyT) {
for (size_t iT = 0; iT < hlNames.size(); ++iT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ DTRecSegment4D* DTCombinatorialPatternReco4D::segmentSpecialZed(const DTRecSegme

// pick up a hit "in the middle", where the single hit will be put.
int nHits = hits.size();
DTRecHit1D middle = hits[static_cast<int>(nHits / 2.)];
const DTRecHit1D& middle = hits[static_cast<int>(nHits / 2.)];

// Need to extrapolate pos to the middle layer z
LocalPoint posInSL = zedSeg->localPosition();
Expand Down
2 changes: 1 addition & 1 deletion RecoLuminosity/LumiProducer/plugins/CMSRunSummary2DB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace lumi {
std::string fillnum = record[0];
if (fillnum == result.fillnumber) {
result.fillscheme = record[1];
std::string ncollidingbunchesStr = record[2];
const std::string& ncollidingbunchesStr = record[2];
result.ncollidingbunches = str2int(ncollidingbunchesStr);
break;
}
Expand Down
1 change: 1 addition & 0 deletions RecoMET/METPUSubtraction/src/PFMETAlgorithmMVA.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const GBRForest* PFMETAlgorithmMVA::loadMVAfromFile(const edm::FileInPath& input
}

std::vector<std::string> variableNames;
variableNames.reserve(lVec->size());
for (unsigned int i = 0; i < lVec->size(); ++i) {
variableNames.push_back(updateVariableNames(lVec->at(i)));
}
Expand Down
6 changes: 3 additions & 3 deletions RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1410,9 +1410,9 @@ void MuonIdProducer::fillMuonIsolation(edm::Event& iEvent,
return;
}

reco::IsoDeposit depEcal = caloDeps.at(0);
reco::IsoDeposit depHcal = caloDeps.at(1);
reco::IsoDeposit depHo = caloDeps.at(2);
const reco::IsoDeposit& depEcal = caloDeps.at(0);
const reco::IsoDeposit& depHcal = caloDeps.at(1);
const reco::IsoDeposit& depHo = caloDeps.at(2);

//no need to copy outside if we don't write them
if (writeIsoDeposits_) {
Expand Down
Loading