Skip to content

Commit

Permalink
Merge pull request #29428 from cms-sw/code-format-reconstructio-981faa
Browse files Browse the repository at this point in the history
Running code-format for reconstructio
  • Loading branch information
cmsbuild authored Apr 9, 2020
2 parents 49acac1 + 9144d9e commit da88a92
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ TemplatedSecondaryVertexProducer<IPTI, VTX>::TemplatedSecondaryVertexProducer(co
token_fatJets = consumes<edm::View<reco::Jet> >(params.getParameter<edm::InputTag>("fatJets"));
}
edm::InputTag srcWeights = params.getParameter<edm::InputTag>("weights");
if (srcWeights.label() != "")
if (!srcWeights.label().empty())
token_weights = consumes<edm::ValueMap<float> >(srcWeights);
if (useGroomedFatJets) {
token_groomedFatJets = consumes<edm::View<reco::Jet> >(params.getParameter<edm::InputTag>("groomedFatJets"));
Expand Down
4 changes: 3 additions & 1 deletion RecoHI/HiJetAlgos/src/MultipleAlgoIterator.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <memory>

#include "RecoHI/HiJetAlgos/interface/MultipleAlgoIterator.h"
#include "DataFormats/Candidate/interface/CandidateFwd.h"
#include "DataFormats/Candidate/interface/Candidate.h"
Expand All @@ -22,7 +24,7 @@ void MultipleAlgoIterator::offsetCorrectJets() {
subtractPedestal(*fjInputs_);
const fastjet::JetDefinition& def = *fjJetDefinition_;
if (!doAreaFastjet_ && !doRhoFastjet_) {
fjClusterSeq_ = ClusterSequencePtr(new fastjet::ClusterSequence(*fjInputs_, def));
fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(*fjInputs_, def);
} else {
fjClusterSeq_ = ClusterSequencePtr(new fastjet::ClusterSequenceArea(*fjInputs_, def, *fjActiveArea_));
}
Expand Down
5 changes: 4 additions & 1 deletion RecoJets/JetProducers/plugins/CATopJetProducer.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "FWCore/Framework/interface/MakerMacros.h"
#include "RecoJets/JetProducers/plugins/CATopJetProducer.h"

#include <memory>

#include "RecoJets/JetProducers/plugins/FastjetJetProducer.h"

using namespace edm;
Expand Down Expand Up @@ -64,7 +67,7 @@ void CATopJetProducer::produce(edm::Event& e, const edm::EventSetup& c) { Fastje

void CATopJetProducer::runAlgorithm(edm::Event& iEvent, const edm::EventSetup& iSetup) {
if (!doAreaFastjet_ && !doRhoFastjet_) {
fjClusterSeq_ = ClusterSequencePtr(new fastjet::ClusterSequence(fjInputs_, *fjJetDefinition_));
fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(fjInputs_, *fjJetDefinition_);
} else if (voronoiRfact_ <= 0) {
fjClusterSeq_ =
ClusterSequencePtr(new fastjet::ClusterSequenceArea(fjInputs_, *fjJetDefinition_, *fjAreaDefinition_));
Expand Down
5 changes: 4 additions & 1 deletion RecoJets/JetProducers/plugins/CSJetProducer.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "FWCore/Framework/interface/MakerMacros.h"
#include "RecoJets/JetProducers/plugins/CSJetProducer.h"

#include <memory>

#include "FWCore/Utilities/interface/Exception.h"
#include "RecoJets/JetProducers/interface/JetSpecific.h"

Expand Down Expand Up @@ -32,7 +35,7 @@ void CSJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
void CSJetProducer::runAlgorithm(edm::Event& iEvent, edm::EventSetup const& iSetup) {
// run algorithm
if (!doAreaFastjet_ && !doRhoFastjet_) {
fjClusterSeq_ = ClusterSequencePtr(new fastjet::ClusterSequence(fjInputs_, *fjJetDefinition_));
fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(fjInputs_, *fjJetDefinition_);
} else if (voronoiRfact_ <= 0) {
fjClusterSeq_ =
ClusterSequencePtr(new fastjet::ClusterSequenceArea(fjInputs_, *fjJetDefinition_, *fjAreaDefinition_));
Expand Down
2 changes: 1 addition & 1 deletion RecoJets/JetProducers/plugins/ECFAdder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ECFAdder::ECFAdder(const edm::ParameterSet& iConfig)
}

edm::InputTag srcWeights = iConfig.getParameter<edm::InputTag>("srcWeights");
if (srcWeights.label() != "")
if (!srcWeights.label().empty())
input_weights_token_ = consumes<edm::ValueMap<float>>(srcWeights);

for (std::vector<unsigned>::const_iterator n = Njets_.begin(); n != Njets_.end(); ++n) {
Expand Down
4 changes: 2 additions & 2 deletions RecoJets/JetProducers/plugins/FastjetJetProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ FastjetJetProducer::FastjetJetProducer(const edm::ParameterSet& iConfig) : Virtu
nFilt_ = iConfig.getParameter<int>("nFilt");
useDynamicFiltering_ = iConfig.getParameter<bool>("useDynamicFiltering");
if (useDynamicFiltering_)
rFiltDynamic_ = DynamicRfiltPtr(new DynamicRfilt(rFilt_, rFiltFactor_));
rFiltDynamic_ = std::make_shared<DynamicRfilt>(rFilt_, rFiltFactor_);
rFiltFactor_ = iConfig.getParameter<double>("rFiltFactor");

useTrimming_ = iConfig.getParameter<bool>("useTrimming");
Expand Down Expand Up @@ -355,7 +355,7 @@ void FastjetJetProducer::runAlgorithm(edm::Event& iEvent, edm::EventSetup const&
*/

if (!doAreaFastjet_ && !doRhoFastjet_) {
fjClusterSeq_ = ClusterSequencePtr(new fastjet::ClusterSequence(fjInputs_, *fjJetDefinition_));
fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(fjInputs_, *fjJetDefinition_);
} else if (voronoiRfact_ <= 0) {
fjClusterSeq_ =
ClusterSequencePtr(new fastjet::ClusterSequenceArea(fjInputs_, *fjJetDefinition_, *fjAreaDefinition_));
Expand Down
4 changes: 3 additions & 1 deletion RecoJets/JetProducers/plugins/HTTTopJetProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "DataFormats/JetReco/interface/BasicJetCollection.h"
#include "HTTTopJetProducer.h"

#include <memory>

using namespace edm;
using namespace cms;
using namespace reco;
Expand Down Expand Up @@ -90,7 +92,7 @@ void HTTTopJetProducer::produce(edm::Event& e, const edm::EventSetup& c) {

void HTTTopJetProducer::runAlgorithm(edm::Event& iEvent, const edm::EventSetup& iSetup) {
if (!doAreaFastjet_ && !doRhoFastjet_) {
fjClusterSeq_ = ClusterSequencePtr(new fastjet::ClusterSequence(fjInputs_, *fjJetDefinition_));
fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(fjInputs_, *fjJetDefinition_);
} else if (voronoiRfact_ <= 0) {
fjClusterSeq_ =
ClusterSequencePtr(new fastjet::ClusterSequenceArea(fjInputs_, *fjJetDefinition_, *fjAreaDefinition_));
Expand Down
2 changes: 1 addition & 1 deletion RecoJets/JetProducers/plugins/NjettinessAdder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NjettinessAdder::NjettinessAdder(const edm::ParameterSet& iConfig)
nPass_(iConfig.getParameter<int>("nPass")),
akAxesR0_(iConfig.getParameter<double>("akAxesR0")) {
edm::InputTag srcWeights = iConfig.getParameter<edm::InputTag>("srcWeights");
if (srcWeights.label() != "")
if (!srcWeights.label().empty())
input_weights_token_ = consumes<edm::ValueMap<float>>(srcWeights);

for (std::vector<unsigned>::const_iterator n = Njets_.begin(); n != Njets_.end(); ++n) {
Expand Down
5 changes: 4 additions & 1 deletion RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

#include "FWCore/Framework/interface/MakerMacros.h"
#include "RecoJets/JetProducers/plugins/SubEventGenJetProducer.h"

#include <memory>

#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/isFinite.h"
#include "RecoJets/JetProducers/interface/JetSpecific.h"
Expand Down Expand Up @@ -128,7 +131,7 @@ void SubEventGenJetProducer::runAlgorithm(edm::Event& iEvent, edm::EventSetup co
// run algorithm
fjJets_.clear();

fjClusterSeq_ = ClusterSequencePtr(new fastjet::ClusterSequence(fjInputs_, *fjJetDefinition_));
fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(fjInputs_, *fjJetDefinition_);
fjJets_ = fastjet::sorted_by_pt(fjClusterSeq_->inclusive_jets(jetPtMin_));

using namespace reco;
Expand Down
2 changes: 1 addition & 1 deletion RecoJets/JetProducers/plugins/VirtualJetProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ VirtualJetProducer::VirtualJetProducer(const edm::ParameterSet& iConfig) {
if (srcWeights.label() == src_.label())
LogWarning("VirtualJetProducer")
<< "Particle and weights collection have the same label. You may be applying the same weights twice.\n";
if (srcWeights.label() != "")
if (!srcWeights.label().empty())
input_weights_token_ = consumes<edm::ValueMap<float>>(srcWeights);
}

Expand Down
6 changes: 4 additions & 2 deletions RecoJets/JetProducers/src/PileUpSubtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "Geometry/Records/interface/CaloGeometryRecord.h"

#include <map>
#include <memory>

using namespace std;

PileUpSubtractor::PileUpSubtractor(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC) {
Expand All @@ -28,7 +30,7 @@ PileUpSubtractor::PileUpSubtractor(const edm::ParameterSet& iConfig, edm::Consum
ghostArea = iConfig.getParameter<double>("GhostArea");

if (doAreaFastjet_ || doRhoFastjet_) {
fjActiveArea_ = ActiveAreaSpecPtr(new fastjet::ActiveAreaSpec(ghostEtaMax, activeAreaRepeats, ghostArea));
fjActiveArea_ = std::make_shared<fastjet::ActiveAreaSpec>(ghostEtaMax, activeAreaRepeats, ghostArea);
if ((ghostEtaMax < 0) || (activeAreaRepeats < 0) || (ghostArea < 0))
throw cms::Exception("doAreaFastjet or doRhoFastjet")
<< "Parameters ghostEtaMax, activeAreaRepeats or ghostArea for doAreaFastjet/doRhoFastjet are not defined."
Expand All @@ -49,7 +51,7 @@ void PileUpSubtractor::reset(std::vector<edm::Ptr<reco::Candidate> >& input,
}

void PileUpSubtractor::setDefinition(JetDefPtr const& jetDef) {
fjJetDefinition_ = JetDefPtr(new fastjet::JetDefinition(*jetDef));
fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(*jetDef);
}

void PileUpSubtractor::setupGeometryMap(edm::Event& iEvent, const edm::EventSetup& iSetup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
class LumiProducerFromBrilcalc : public edm::global::EDProducer<> {
public:
explicit LumiProducerFromBrilcalc(const edm::ParameterSet&);
~LumiProducerFromBrilcalc() = default;
~LumiProducerFromBrilcalc() override = default;

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

private:
virtual void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;

// ----------member data ---------------------------
const std::string lumiFile_;
Expand Down Expand Up @@ -82,7 +82,7 @@ LumiProducerFromBrilcalc::LumiProducerFromBrilcalc(const edm::ParameterSet& iCon

int nLS = 0;
std::string line;
while (1) {
while (true) {
std::getline(lumiFile, line);
if (lumiFile.eof() || lumiFile.fail())
break;
Expand Down
4 changes: 3 additions & 1 deletion RecoTauTag/RecoTau/src/RecoTauConstructor.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <memory>

#include "RecoTauTag/RecoTau/interface/RecoTauConstructor.h"

#include "RecoTauTag/RecoTau/interface/RecoTauCommonUtilities.h"
Expand Down Expand Up @@ -42,7 +44,7 @@ namespace reco::tau {
// RefVectors
for (auto const& colkey : collections_) {
// Build an empty list for each collection
sortedCollections_[colkey.first] = SortedListPtr(new SortedListPtr::element_type);
sortedCollections_[colkey.first] = std::make_shared<SortedListPtr::element_type>();
}

tau_->setjetRef(jet);
Expand Down

0 comments on commit da88a92

Please sign in to comment.