Skip to content

Commit c43094a

Browse files
authored
Merge pull request #46992 from smuzaffar/generators-code-checks1
[GENERATORS] Apply code checks/format
2 parents e944ebc + 719b5e6 commit c43094a

File tree

14 files changed

+72
-67
lines changed

14 files changed

+72
-67
lines changed

GeneratorInterface/CepGenInterface/src/CepGenEventGenerator.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <CepGen/Process/Process.h>
2121
#include <CepGenAddOns/HepMC2Wrapper/HepMC2EventInterface.h>
2222

23+
#include <memory>
24+
2325
using namespace gen;
2426

2527
CepGenEventGenerator::CepGenEventGenerator(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC)
@@ -85,7 +87,7 @@ bool CepGenEventGenerator::initializeForInternalPartons() {
8587
}
8688

8789
bool CepGenEventGenerator::generatePartonsAndHadronize() {
88-
event().reset(new HepMC::CepGenEvent(gen_->next()));
90+
event() = std::make_unique<HepMC::CepGenEvent>(gen_->next());
8991
event()->set_cross_section(xsec_);
9092
event()->weights().push_back(1.);
9193
return true;

GeneratorInterface/Herwig7Interface/src/Herwig7Interface.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void Herwig7Interface::initRepository(const edm::ParameterSet &pset) {
9999
else
100100
runModeTemp.erase(0, pos + 1);
101101

102-
HwUI_.reset(new Herwig::HerwigUIProvider(pset, dumpConfig_, Herwig::RunMode::READ));
102+
HwUI_ = std::make_shared<Herwig::HerwigUIProvider>(pset, dumpConfig_, Herwig::RunMode::READ);
103103
edm::LogInfo("Herwig7Interface") << "HerwigUIProvider object with run mode " << HwUI_->runMode() << " created.\n";
104104

105105
// Chose run mode

GeneratorInterface/LHEInterface/src/LH5Reader.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ namespace lhef {
233233
// Use temporary process info block to define const HEPRUP
234234
const HEPRUP heprup(tmprup);
235235

236-
curRunInfo.reset(new LHERunInfo(heprup));
236+
curRunInfo = std::make_shared<LHERunInfo>(heprup);
237237
// Run info has now been set when a new file is encountered
238238
}
239239
// Handler should be modified to have these capabilities
@@ -277,7 +277,7 @@ namespace lhef {
277277
// Use temporary event to construct const HEPEUP;
278278
const HEPEUP hepeup(tmp);
279279

280-
lheevent.reset(new LHEEvent(curRunInfo, hepeup));
280+
lheevent = std::make_shared<LHEEvent>(curRunInfo, hepeup);
281281
// Might have to add this capability later
282282
/* const XMLHandler::wgt_info &info = handler->weightsinevent;
283283
for (size_t i = 0; i < info.size(); ++i) {

GeneratorInterface/LHEInterface/src/LHEReader.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ namespace lhef {
489489
data.str(handler->buffer);
490490
handler->buffer.clear();
491491

492-
curRunInfo.reset(new LHERunInfo(data));
492+
curRunInfo = std::make_shared<LHERunInfo>(data);
493493

494494
std::for_each(handler->headers.begin(),
495495
handler->headers.end(),
@@ -521,7 +521,7 @@ namespace lhef {
521521
handler->buffer.clear();
522522

523523
std::shared_ptr<LHEEvent> lheevent;
524-
lheevent.reset(new LHEEvent(curRunInfo, data));
524+
lheevent = std::make_shared<LHEEvent>(curRunInfo, data);
525525
const XMLHandler::wgt_info &info = handler->weightsinevent;
526526
for (size_t i = 0; i < info.size(); ++i) {
527527
double num = -1.0;

GeneratorInterface/Pythia6Interface/src/PtYDistributor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PtYDistributor::PtYDistributor(const edm::FileInPath& fip,
2222
int ybins = 50)
2323
: ptmax_(ptmax), ptmin_(ptmin), ymax_(ymax), ymin_(ymin), ptbins_(ptbins), ybins_(ybins) {
2424
// edm::FileInPath f1(input);
25-
std::string fDataFile = fip.fullPath();
25+
const std::string& fDataFile = fip.fullPath();
2626

2727
std::cout << " File from " << fDataFile << std::endl;
2828
TFile f(fDataFile.c_str(), "READ");

GeneratorInterface/Pythia6Interface/src/Pythia6Service.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void Pythia6Service::setCSAParams() {
175175
for (size_t i = 0; i < SETCSAPARBUFSIZE; ++i)
176176
buf[i] = ' ';
177177
// Skip empty parameters.
178-
if (iter->length() <= 0)
178+
if (iter->empty())
179179
continue;
180180
// Limit the size of the string to something which fits the buffer.
181181
size_t maxSize = iter->length() > (SETCSAPARBUFSIZE - 2) ? (SETCSAPARBUFSIZE - 2) : iter->length();
@@ -251,7 +251,7 @@ void Pythia6Service::setSLHAParams() {
251251
//std::cout << " start, end = " << start << " " << end << std::endl;
252252
std::string shortfile = iter->substr(start, end - start + 1);
253253
FileInPath f1(shortfile);
254-
std::string file = f1.fullPath();
254+
const std::string& file = f1.fullPath();
255255

256256
/*
257257
//

GeneratorInterface/Pythia8Interface/plugins/Pythia8HepMC3Hadronizer.cc

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ Pythia8HepMC3Hadronizer::Pythia8HepMC3Hadronizer(const edm::ParameterSet &params
218218
if (params.exists("reweightGen")) {
219219
edm::LogInfo("Pythia8Interface") << "Start setup for reweightGen";
220220
edm::ParameterSet rgParams = params.getParameter<edm::ParameterSet>("reweightGen");
221-
fReweightUserHook.reset(
222-
new PtHatReweightUserHook(rgParams.getParameter<double>("pTRef"), rgParams.getParameter<double>("power")));
221+
fReweightUserHook = std::make_shared<PtHatReweightUserHook>(rgParams.getParameter<double>("pTRef"),
222+
rgParams.getParameter<double>("power"));
223223
edm::LogInfo("Pythia8Interface") << "End setup for reweightGen";
224224
}
225225
if (params.exists("reweightGenEmp")) {
@@ -229,29 +229,30 @@ Pythia8HepMC3Hadronizer::Pythia8HepMC3Hadronizer(const edm::ParameterSet &params
229229
std::string tuneName = "";
230230
if (rgeParams.exists("tune"))
231231
tuneName = rgeParams.getParameter<std::string>("tune");
232-
fReweightEmpUserHook.reset(new PtHatEmpReweightUserHook(tuneName));
232+
fReweightEmpUserHook = std::make_shared<PtHatEmpReweightUserHook>(tuneName);
233233
edm::LogInfo("Pythia8Interface") << "End setup for reweightGenEmp";
234234
}
235235
if (params.exists("reweightGenRap")) {
236236
edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenRap";
237237
edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenRap");
238-
fReweightRapUserHook.reset(new RapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
239-
rgrParams.getParameter<double>("yLabPower"),
240-
rgrParams.getParameter<std::string>("yCMSigmaFunc"),
241-
rgrParams.getParameter<double>("yCMPower"),
242-
rgrParams.getParameter<double>("pTHatMin"),
243-
rgrParams.getParameter<double>("pTHatMax")));
238+
fReweightRapUserHook = std::make_shared<RapReweightUserHook>(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
239+
rgrParams.getParameter<double>("yLabPower"),
240+
rgrParams.getParameter<std::string>("yCMSigmaFunc"),
241+
rgrParams.getParameter<double>("yCMPower"),
242+
rgrParams.getParameter<double>("pTHatMin"),
243+
rgrParams.getParameter<double>("pTHatMax"));
244244
edm::LogInfo("Pythia8Interface") << "End setup for reweightGenRap";
245245
}
246246
if (params.exists("reweightGenPtHatRap")) {
247247
edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenPtHatRap";
248248
edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenPtHatRap");
249-
fReweightPtHatRapUserHook.reset(new PtHatRapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
250-
rgrParams.getParameter<double>("yLabPower"),
251-
rgrParams.getParameter<std::string>("yCMSigmaFunc"),
252-
rgrParams.getParameter<double>("yCMPower"),
253-
rgrParams.getParameter<double>("pTHatMin"),
254-
rgrParams.getParameter<double>("pTHatMax")));
249+
fReweightPtHatRapUserHook =
250+
std::make_shared<PtHatRapReweightUserHook>(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
251+
rgrParams.getParameter<double>("yLabPower"),
252+
rgrParams.getParameter<std::string>("yCMSigmaFunc"),
253+
rgrParams.getParameter<double>("yCMPower"),
254+
rgrParams.getParameter<double>("pTHatMin"),
255+
rgrParams.getParameter<double>("pTHatMax"));
255256
edm::LogInfo("Pythia8Interface") << "End setup for reweightGenPtHatRap";
256257
}
257258

@@ -265,7 +266,7 @@ Pythia8HepMC3Hadronizer::Pythia8HepMC3Hadronizer(const edm::ParameterSet &params
265266
edm::ParameterSet jmParams = params.getUntrackedParameter<edm::ParameterSet>("jetMatching");
266267
std::string scheme = jmParams.getParameter<std::string>("scheme");
267268
if (scheme == "Madgraph" || scheme == "MadgraphFastJet") {
268-
fJetMatchingHook.reset(new JetMatchingHook(jmParams, &fMasterGen->info));
269+
fJetMatchingHook = std::make_shared<JetMatchingHook>(jmParams, &fMasterGen->info);
269270
}
270271
}
271272

@@ -304,17 +305,17 @@ Pythia8HepMC3Hadronizer::Pythia8HepMC3Hadronizer(const edm::ParameterSet &params
304305
EV1_nFinalMode = 0;
305306
if (params.exists("EV1_nFinalMode"))
306307
EV1_nFinalMode = params.getParameter<int>("EV1_nFinalMode");
307-
fEmissionVetoHook1.reset(new EmissionVetoHook1(EV1_nFinal,
308-
EV1_vetoOn,
309-
EV1_maxVetoCount,
310-
EV1_pThardMode,
311-
EV1_pTempMode,
312-
EV1_emittedMode,
313-
EV1_pTdefMode,
314-
EV1_MPIvetoOn,
315-
EV1_QEDvetoMode,
316-
EV1_nFinalMode,
317-
0));
308+
fEmissionVetoHook1 = std::make_shared<EmissionVetoHook1>(EV1_nFinal,
309+
EV1_vetoOn,
310+
EV1_maxVetoCount,
311+
EV1_pThardMode,
312+
EV1_pTempMode,
313+
EV1_emittedMode,
314+
EV1_pTdefMode,
315+
EV1_MPIvetoOn,
316+
EV1_QEDvetoMode,
317+
EV1_nFinalMode,
318+
0);
318319
}
319320

320321
if (params.exists("UserCustomization")) {
@@ -364,7 +365,7 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
364365
}
365366

366367
if (!fUserHooksVector.get())
367-
fUserHooksVector.reset(new UserHooksVector);
368+
fUserHooksVector = std::make_shared<UserHooksVector>();
368369
(fUserHooksVector->hooks).clear();
369370

370371
if (fReweightUserHook.get())
@@ -389,7 +390,7 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
389390
"are : jetMatching, emissionVeto1 \n";
390391

391392
if (!fEmissionVetoHook.get())
392-
fEmissionVetoHook.reset(new PowhegHooks());
393+
fEmissionVetoHook = std::make_shared<PowhegHooks>();
393394

394395
edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
395396
(fUserHooksVector->hooks).push_back(fEmissionVetoHook);
@@ -399,15 +400,15 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
399400
if (PowhegRes) {
400401
edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
401402
if (!fPowhegResHook.get())
402-
fPowhegResHook.reset(new PowhegResHook());
403+
fPowhegResHook = std::make_shared<PowhegResHook>();
403404
(fUserHooksVector->hooks).push_back(fPowhegResHook);
404405
}
405406

406407
bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
407408
if (PowhegBB4L) {
408409
edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
409410
if (!fPowhegHooksBB4L.get())
410-
fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
411+
fPowhegHooksBB4L = std::make_shared<PowhegHooksBB4L>();
411412
(fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
412413
}
413414

@@ -422,7 +423,7 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
422423

423424
if (internalMatching) {
424425
if (!fJetMatchingPy8InternalHook.get())
425-
fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
426+
fJetMatchingPy8InternalHook = std::make_shared<Pythia8::JetMatchingMadgraph>();
426427
(fUserHooksVector->hooks).push_back(fJetMatchingPy8InternalHook);
427428
}
428429

@@ -436,15 +437,15 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
436437
? 2
437438
: 0);
438439
if (!fMergingHook.get())
439-
fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
440+
fMergingHook = std::make_shared<Pythia8::amcnlo_unitarised_interface>(scheme);
440441
(fUserHooksVector->hooks).push_back(fMergingHook);
441442
}
442443

443444
bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
444445
if (biasedTauDecayer) {
445446
if (!fBiasedTauDecayer.get()) {
446447
Pythia8::Info localInfo = fMasterGen->info;
447-
fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
448+
fBiasedTauDecayer = std::make_shared<BiasedTauDecayer>(&localInfo, &(fMasterGen->settings));
448449
}
449450
std::vector<int> handledParticles;
450451
handledParticles.push_back(15);
@@ -453,13 +454,13 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
453454

454455
bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
455456
if (resonanceDecayFilter) {
456-
fResonanceDecayFilterHook.reset(new ResonanceDecayFilterHook);
457+
fResonanceDecayFilterHook = std::make_shared<ResonanceDecayFilterHook>();
457458
(fUserHooksVector->hooks).push_back(fResonanceDecayFilterHook);
458459
}
459460

460461
bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
461462
if (PTFilter) {
462-
fPTFilterHook.reset(new PTFilterHook);
463+
fPTFilterHook = std::make_shared<PTFilterHook>();
463464
(fUserHooksVector->hooks).push_back(fPTFilterHook);
464465
}
465466

@@ -501,7 +502,7 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
501502
if (useEvtGen) {
502503
edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
503504
if (!evtgenDecays.get()) {
504-
evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
505+
evtgenDecays = std::make_shared<EvtGenDecays>(fMasterGen.get(), evtgenDecFile, evtgenPdlFile);
505506
for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
506507
evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
507508
}
@@ -516,7 +517,7 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
516517
bool status = false, status1 = false;
517518

518519
if (!fUserHooksVector.get())
519-
fUserHooksVector.reset(new UserHooksVector);
520+
fUserHooksVector = std::make_shared<UserHooksVector>();
520521
(fUserHooksVector->hooks).clear();
521522

522523
if (fReweightUserHook.get())
@@ -548,7 +549,7 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
548549
"are : jetMatching, emissionVeto1 \n";
549550

550551
if (!fEmissionVetoHook.get())
551-
fEmissionVetoHook.reset(new PowhegHooks());
552+
fEmissionVetoHook = std::make_shared<PowhegHooks>();
552553

553554
edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
554555
(fUserHooksVector->hooks).push_back(fEmissionVetoHook);
@@ -558,15 +559,15 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
558559
if (PowhegRes) {
559560
edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
560561
if (!fPowhegResHook.get())
561-
fPowhegResHook.reset(new PowhegResHook());
562+
fPowhegResHook = std::make_shared<PowhegResHook>();
562563
(fUserHooksVector->hooks).push_back(fPowhegResHook);
563564
}
564565

565566
bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
566567
if (PowhegBB4L) {
567568
edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
568569
if (!fPowhegHooksBB4L.get())
569-
fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
570+
fPowhegHooksBB4L = std::make_shared<PowhegHooksBB4L>();
570571
(fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
571572
}
572573

@@ -581,7 +582,7 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
581582

582583
if (internalMatching) {
583584
if (!fJetMatchingPy8InternalHook.get())
584-
fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
585+
fJetMatchingPy8InternalHook = std::make_shared<Pythia8::JetMatchingMadgraph>();
585586
(fUserHooksVector->hooks).push_back(fJetMatchingPy8InternalHook);
586587
}
587588

@@ -595,15 +596,15 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
595596
? 2
596597
: 0);
597598
if (!fMergingHook.get())
598-
fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
599+
fMergingHook = std::make_shared<Pythia8::amcnlo_unitarised_interface>(scheme);
599600
(fUserHooksVector->hooks).push_back(fMergingHook);
600601
}
601602

602603
bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
603604
if (biasedTauDecayer) {
604605
if (!fBiasedTauDecayer.get()) {
605606
Pythia8::Info localInfo = fMasterGen->info;
606-
fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
607+
fBiasedTauDecayer = std::make_shared<BiasedTauDecayer>(&localInfo, &(fMasterGen->settings));
607608
}
608609
std::vector<int> handledParticles;
609610
handledParticles.push_back(15);
@@ -612,13 +613,13 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
612613

613614
bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
614615
if (resonanceDecayFilter) {
615-
fResonanceDecayFilterHook.reset(new ResonanceDecayFilterHook);
616+
fResonanceDecayFilterHook = std::make_shared<ResonanceDecayFilterHook>();
616617
(fUserHooksVector->hooks).push_back(fResonanceDecayFilterHook);
617618
}
618619

619620
bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
620621
if (PTFilter) {
621-
fPTFilterHook.reset(new PTFilterHook);
622+
fPTFilterHook = std::make_shared<PTFilterHook>();
622623
(fUserHooksVector->hooks).push_back(fPTFilterHook);
623624
}
624625

@@ -637,7 +638,7 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
637638
status = fMasterGen->init();
638639

639640
} else {
640-
lhaUP.reset(new LHAupLesHouches());
641+
lhaUP = std::make_shared<LHAupLesHouches>();
641642
lhaUP->setScalesFromLHEF(fMasterGen->settings.flag("Beams:setProductionScalesFromLHEF"));
642643
lhaUP->loadRunInfo(lheRunInfo());
643644

@@ -672,7 +673,7 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
672673
if (useEvtGen) {
673674
edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
674675
if (!evtgenDecays.get()) {
675-
evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
676+
evtgenDecays = std::make_shared<EvtGenDecays>(fMasterGen.get(), evtgenDecFile, evtgenPdlFile);
676677
for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
677678
evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
678679
}

GeneratorInterface/Pythia8Interface/src/Py8GunBase.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <memory>
2+
13
#include "GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h"
24
#include "FWCore/MessageLogger/interface/MessageLogger.h"
35
#include "FWCore/Concurrency/interface/SharedResourceNames.h"
@@ -45,7 +47,7 @@ namespace gen {
4547

4648
if (useEvtGen) {
4749
edm::LogInfo("Pythia8Interface") << "Creating and initializing pythia8 EvtGen plugin";
48-
evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
50+
evtgenDecays = std::make_shared<EvtGenDecays>(fMasterGen.get(), evtgenDecFile, evtgenPdlFile);
4951
for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
5052
evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
5153
}

GeneratorInterface/RivetInterface/plugins/GenParticles2HepMCConverter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void GenParticles2HepMCConverter::produce(edm::Event& event, const edm::EventSet
9999

100100
hepmc_event.weights() = genEventInfoHandle->weights();
101101
// add dummy weight if necessary
102-
if (hepmc_event.weights().size() == 0) {
102+
if (hepmc_event.weights().empty()) {
103103
hepmc_event.weights().push_back(1.);
104104
}
105105

0 commit comments

Comments
 (0)