Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RECONSTRUCTION] Apply code-checks/format with misc-definitions-in-headers #34050

Merged
merged 2 commits into from Jun 11, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions CommonTools/CandUtils/interface/makeCompositeCandidate.h
Expand Up @@ -18,7 +18,7 @@ namespace helpers {
private:
std::unique_ptr<reco::CompositeCandidate> cmp_;
std::unique_ptr<reco::Candidate> release() {
std::unique_ptr<reco::Candidate> ret(std::move(cmp_.get()));
std::unique_ptr<reco::Candidate> ret(cmp_.get());
cmp_.release();
return ret;
}
Expand Down Expand Up @@ -61,7 +61,7 @@ helpers::CompositeCandidateMaker makeCompositeCandidate(const reco::Candidate& c
template <typename C>
helpers::CompositeCandidateMaker makeCompositeCandidate(const typename C::const_iterator& begin,
const typename C::const_iterator& end) {
helpers::CompositeCandidateMaker cmp(std::unique_ptr<reco::CompositeCandidate>(new reco::CompositeCandidate));
helpers::CompositeCandidateMaker cmp(std::make_unique<reco::CompositeCandidate>());
for (typename C::const_iterator i = begin; i != end; ++i)
cmp.addDaughter(*i);
return cmp;
Expand All @@ -82,7 +82,7 @@ helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const re
template <typename C>
helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const typename C::const_iterator& begin,
const typename C::const_iterator& end) {
helpers::CompositeCandidateMaker cmp(std::unique_ptr<reco::CompositeCandidate>(new reco::CompositeCandidate));
helpers::CompositeCandidateMaker cmp(std::make_unique<reco::CompositeCandidate>());
for (typename C::const_iterator i = begin; i != end; ++i)
cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(*i)));
return cmp;
Expand Down
6 changes: 2 additions & 4 deletions CommonTools/CandUtils/interface/makeNamedCompositeCandidate.h
Expand Up @@ -59,8 +59,7 @@ helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidate(const typename
const typename C::const_iterator& end,
const std::vector<std::string>::const_iterator sbegin,
const std::vector<std::string>::const_iterator send) {
helpers::NamedCompositeCandidateMaker cmp(
std::unique_ptr<reco::NamedCompositeCandidate>(new reco::NamedCompositeCandidate));
helpers::NamedCompositeCandidateMaker cmp(std::make_unique<reco::NamedCompositeCandidate>());
std::vector<std::string>::const_iterator si = sbegin;
for (typename C::const_iterator i = begin; i != end && si != send; ++i, ++si)
cmp.addDaughter(*i, *si);
Expand Down Expand Up @@ -94,8 +93,7 @@ helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidateWithRefsToMaste
const typename C::const_iterator& end,
const std::vector<std::string>::const_iterator sbegin,
const std::vector<std::string>::const_iterator send) {
helpers::NamedCompositeCandidateMaker cmp(
std::unique_ptr<reco::NamedCompositeCandidate>(new reco::NamedCompositeCandidate));
helpers::NamedCompositeCandidateMaker cmp(std::make_unique<reco::NamedCompositeCandidate>());
std::vector<std::string>::const_iterator si = sbegin;
for (typename C::const_iterator i = begin; i != end && si != send; ++i, ++si)
cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(*i)), *si);
Expand Down
2 changes: 1 addition & 1 deletion CommonTools/Clustering1D/interface/Cluster1DCleaner.h
Expand Up @@ -50,7 +50,7 @@ void Cluster1DCleaner<T>::cleanCluster1Ds(const std::vector<Cluster1D<T> >& _clu
std::vector<Cluster1D<T> > clust = _clust;
theCleanedCluster1Ds.clear();
theDiscardedCluster1Ds.clear();
if (clust.size() == 0)
if (clust.empty())
return;
float oldPos = average(clust);
for (typename std::vector<Cluster1D<T> >::const_iterator ic = clust.begin(); ic != clust.end(); ic++) {
Expand Down
2 changes: 1 addition & 1 deletion CommonTools/Clustering1D/interface/DivisiveClusterizer1D.h
Expand Up @@ -183,7 +183,7 @@ std::vector<Cluster1D<T> > DivisiveClusterizer1D<T>::makeCluster1Ds(std::vector<
template <class T>
void DivisiveClusterizer1D<T>::insertTracks(std::vector<Cluster1D<T> >& clusou,
std::vector<Cluster1D<T> >& cludest) const {
if (clusou.size() == 0)
if (clusou.empty())
return;
for (typename std::vector<Cluster1D<T> >::const_iterator iclu = clusou.begin(); iclu != clusou.end(); iclu++) {
cludest.push_back(*iclu);
Expand Down
2 changes: 1 addition & 1 deletion CommonTools/ParticleFlow/plugins/TopProjector.h
Expand Up @@ -153,7 +153,7 @@ class TopProjector : public edm::stream::EDProducer<> {

TopProjector(const edm::ParameterSet&);

~TopProjector() = default;
~TopProjector() override = default;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

Expand Down
24 changes: 13 additions & 11 deletions CommonTools/RecoAlgos/interface/TrackFullCloneSelectorBase.h
Expand Up @@ -12,16 +12,18 @@
*
*/

#include <utility>
#include <vector>
#include <memory>
#include <algorithm>
#include <map>
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"

#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include <algorithm>
#include <map>
#include <memory>
#include <utility>
#include <vector>

#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
Expand Down Expand Up @@ -63,10 +65,10 @@ namespace reco {
edm::Handle<reco::TrackCollection> hSrcTrack;
evt.getByToken(hSrcTrackToken_, hSrcTrack);

selTracks_ = std::unique_ptr<reco::TrackCollection>(new reco::TrackCollection());
selTracks_ = std::make_unique<reco::TrackCollection>();
if (copyExtras_) {
selTrackExtras_ = std::unique_ptr<reco::TrackExtraCollection>(new reco::TrackExtraCollection());
selHits_ = std::unique_ptr<TrackingRecHitCollection>(new TrackingRecHitCollection());
selTrackExtras_ = std::make_unique<reco::TrackExtraCollection>();
selHits_ = std::make_unique<TrackingRecHitCollection>();
}

TrackRefProd rTracks = evt.template getRefBeforePut<TrackCollection>();
Expand Down Expand Up @@ -125,8 +127,8 @@ namespace reco {
evt.getByToken(hTTAssToken_, hTTAss);
evt.getByToken(hTrajToken_, hTraj);
edm::RefProd<std::vector<Trajectory> > TrajRefProd = evt.template getRefBeforePut<std::vector<Trajectory> >();
selTrajs_ = std::unique_ptr<std::vector<Trajectory> >(new std::vector<Trajectory>());
selTTAss_ = std::unique_ptr<TrajTrackAssociationCollection>(new TrajTrackAssociationCollection());
selTrajs_ = std::make_unique<std::vector<Trajectory> >();
selTTAss_ = std::make_unique<TrajTrackAssociationCollection>();
for (size_t i = 0, n = hTraj->size(); i < n; ++i) {
edm::Ref<std::vector<Trajectory> > trajRef(hTraj, i);
TrajTrackAssociationCollection::const_iterator match = hTTAss->find(trajRef);
Expand Down
2 changes: 1 addition & 1 deletion CommonTools/UtilAlgos/interface/TFileService.h
Expand Up @@ -61,7 +61,7 @@ class TFileService {

/// make new ROOT object
template <typename T, typename... Args>
T *make(const Args &... args) const {
T *make(const Args &...args) const {
return tFileDirectory_.make<T>(args...);
}

Expand Down
14 changes: 6 additions & 8 deletions CommonTools/Utils/interface/EtComparator.h
Expand Up @@ -34,10 +34,9 @@ struct NumericSafeLessByEt {
typedef T first_argument_type;
typedef T second_argument_type;
bool operator()(const T& a1, const T& a2) {
return fabs(a1.et() - a2.et()) > std::numeric_limits<double>::epsilon()
? a1.et() < a2.et()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() < a2.px()
: a1.pz() < a2.pz();
return fabs(a1.et() - a2.et()) > std::numeric_limits<double>::epsilon() ? a1.et() < a2.et()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() < a2.px()
: a1.pz() < a2.pz();
}
};

Expand All @@ -46,10 +45,9 @@ struct NumericSafeGreaterByEt {
typedef T first_argument_type;
typedef T second_argument_type;
bool operator()(const T& a1, const T& a2) {
return fabs(a1.et() - a2.et()) > std::numeric_limits<double>::epsilon()
? a1.et() > a2.et()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() > a2.px()
: a1.pz() > a2.pz();
return fabs(a1.et() - a2.et()) > std::numeric_limits<double>::epsilon() ? a1.et() > a2.et()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() > a2.px()
: a1.pz() > a2.pz();
}
};

Expand Down
14 changes: 6 additions & 8 deletions CommonTools/Utils/interface/PtComparator.h
Expand Up @@ -35,10 +35,9 @@ struct NumericSafeLessByPt {
typedef T first_argument_type;
typedef T second_argument_type;
bool operator()(const T& a1, const T& a2) {
return fabs(a1.pt() - a2.pt()) > std::numeric_limits<double>::epsilon()
? a1.pt() < a2.pt()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() < a2.px()
: a1.pz() < a2.pz();
return fabs(a1.pt() - a2.pt()) > std::numeric_limits<double>::epsilon() ? a1.pt() < a2.pt()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() < a2.px()
: a1.pz() < a2.pz();
}
};

Expand All @@ -47,10 +46,9 @@ struct NumericSafeGreaterByPt {
typedef T first_argument_type;
typedef T second_argument_type;
bool operator()(const T& a1, const T& a2) {
return fabs(a1.pt() - a2.pt()) > std::numeric_limits<double>::epsilon()
? a1.pt() > a2.pt()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() > a2.px()
: a1.pz() > a2.pz();
return fabs(a1.pt() - a2.pt()) > std::numeric_limits<double>::epsilon() ? a1.pt() > a2.pt()
: fabs(a1.px() - a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() > a2.px()
: a1.pz() > a2.pz();
}
};

Expand Down
2 changes: 1 addition & 1 deletion CommonTools/Utils/interface/TFileDirectory.h
Expand Up @@ -50,7 +50,7 @@ class TFileDirectory {

/// make new ROOT object
template <typename T, typename... Args>
T *make(const Args &... args) const {
T *make(const Args &...args) const {
TDirectory *d = _cd();
T *t = new T(args...);
ROOT::DirAutoAdd_t func = T::Class()->GetDirectoryAutoAdd();
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/MuonData/interface/MuonDigiCollection.h
Expand Up @@ -56,7 +56,7 @@ class DigiContainerIterator {

bool operator!=(const DigiContainerIterator& x) const { return x.base_ != base_; }

value_type operator*(void)const {
value_type operator*(void) const {
return std::make_pair(base_->first, std::make_pair(base_->second.begin(), base_->second.end()));
}

Expand Down
2 changes: 1 addition & 1 deletion DataFormats/PatCandidates/interface/PackedCandidate.h
Expand Up @@ -254,7 +254,7 @@ namespace pat {
track_(iOther.track_.exchange(nullptr)),
pdgId_(iOther.pdgId_),
qualityFlags_(iOther.qualityFlags_),
pvRefProd_(std::move(iOther.pvRefProd_)),
pvRefProd_(iOther.pvRefProd_),
pvRefKey_(iOther.pvRefKey_),
m_(iOther.m_.exchange(nullptr)),
packedHits_(iOther.packedHits_),
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/PatCandidates/interface/PackedGenParticle.h
Expand Up @@ -99,7 +99,7 @@ namespace pat {
dphi_(iOther.dphi_),
pdgId_(iOther.pdgId_),
charge_(iOther.charge_),
mother_(std::move(iOther.mother_)),
mother_(iOther.mother_),
statusFlags_(iOther.statusFlags_) {
if (iOther.p4c_) {
p4_.store(p4_.exchange(nullptr));
Expand All @@ -126,7 +126,7 @@ namespace pat {
dphi_ = iOther.dphi_;
pdgId_ = iOther.pdgId_;
charge_ = iOther.charge_;
mother_ = std::move(iOther.mother_);
mother_ = iOther.mother_;
statusFlags_ = iOther.statusFlags_;
}
return *this;
Expand Down