Skip to content

Commit 74a5503

Browse files
committed
Apply code checks to Pythia8Hadronizer
1 parent c4a96e9 commit 74a5503

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc

+33-33
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet &params)
273273
if (params.exists("reweightGen")) {
274274
edm::LogInfo("Pythia8Interface") << "Start setup for reweightGen";
275275
edm::ParameterSet rgParams = params.getParameter<edm::ParameterSet>("reweightGen");
276-
fReweightUserHook.reset(
277-
new PtHatReweightUserHook(rgParams.getParameter<double>("pTRef"), rgParams.getParameter<double>("power")));
276+
fReweightUserHook = std::make_shared<PtHatReweightUserHook>(
277+
rgParams.getParameter<double>("pTRef"), rgParams.getParameter<double>("power"));
278278
edm::LogInfo("Pythia8Interface") << "End setup for reweightGen";
279279
}
280280
if (params.exists("reweightGenEmp")) {
@@ -284,29 +284,29 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet &params)
284284
std::string tuneName = "";
285285
if (rgeParams.exists("tune"))
286286
tuneName = rgeParams.getParameter<std::string>("tune");
287-
fReweightEmpUserHook.reset(new PtHatEmpReweightUserHook(tuneName));
287+
fReweightEmpUserHook = std::make_shared<PtHatEmpReweightUserHook>(tuneName);
288288
edm::LogInfo("Pythia8Interface") << "End setup for reweightGenEmp";
289289
}
290290
if (params.exists("reweightGenRap")) {
291291
edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenRap";
292292
edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenRap");
293-
fReweightRapUserHook.reset(new RapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
293+
fReweightRapUserHook = std::make_shared<RapReweightUserHook>(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
294294
rgrParams.getParameter<double>("yLabPower"),
295295
rgrParams.getParameter<std::string>("yCMSigmaFunc"),
296296
rgrParams.getParameter<double>("yCMPower"),
297297
rgrParams.getParameter<double>("pTHatMin"),
298-
rgrParams.getParameter<double>("pTHatMax")));
298+
rgrParams.getParameter<double>("pTHatMax"));
299299
edm::LogInfo("Pythia8Interface") << "End setup for reweightGenRap";
300300
}
301301
if (params.exists("reweightGenPtHatRap")) {
302302
edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenPtHatRap";
303303
edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenPtHatRap");
304-
fReweightPtHatRapUserHook.reset(new PtHatRapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
304+
fReweightPtHatRapUserHook = std::make_shared<PtHatRapReweightUserHook>(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
305305
rgrParams.getParameter<double>("yLabPower"),
306306
rgrParams.getParameter<std::string>("yCMSigmaFunc"),
307307
rgrParams.getParameter<double>("yCMPower"),
308308
rgrParams.getParameter<double>("pTHatMin"),
309-
rgrParams.getParameter<double>("pTHatMax")));
309+
rgrParams.getParameter<double>("pTHatMax"));
310310
edm::LogInfo("Pythia8Interface") << "End setup for reweightGenPtHatRap";
311311
}
312312

@@ -320,7 +320,7 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet &params)
320320
edm::ParameterSet jmParams = params.getUntrackedParameter<edm::ParameterSet>("jetMatching");
321321
std::string scheme = jmParams.getParameter<std::string>("scheme");
322322
if (scheme == "Madgraph" || scheme == "MadgraphFastJet") {
323-
fJetMatchingHook.reset(new JetMatchingHook(jmParams, &fMasterGen->info));
323+
fJetMatchingHook = std::make_shared<JetMatchingHook>(jmParams, &fMasterGen->info);
324324
}
325325
}
326326

@@ -359,7 +359,7 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet &params)
359359
EV1_nFinalMode = 0;
360360
if (params.exists("EV1_nFinalMode"))
361361
EV1_nFinalMode = params.getParameter<int>("EV1_nFinalMode");
362-
fEmissionVetoHook1.reset(new EmissionVetoHook1(EV1_nFinal,
362+
fEmissionVetoHook1 = std::make_shared<EmissionVetoHook1>(EV1_nFinal,
363363
EV1_vetoOn,
364364
EV1_maxVetoCount,
365365
EV1_pThardMode,
@@ -369,7 +369,7 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet &params)
369369
EV1_MPIvetoOn,
370370
EV1_QEDvetoMode,
371371
EV1_nFinalMode,
372-
0));
372+
0);
373373
}
374374

375375
if (params.exists("UserCustomization")) {
@@ -435,7 +435,7 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {
435435
}
436436

437437
if (!fUserHooksVector.get())
438-
fUserHooksVector.reset(new UserHooksVector);
438+
fUserHooksVector = std::make_shared<UserHooksVector>();
439439
(fUserHooksVector->hooks).clear();
440440

441441
if (fReweightUserHook.get())
@@ -460,7 +460,7 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {
460460
"are : jetMatching, emissionVeto1 \n";
461461

462462
if (!fEmissionVetoHook.get())
463-
fEmissionVetoHook.reset(new PowhegHooks());
463+
fEmissionVetoHook = std::make_shared<PowhegHooks>();
464464

465465
edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
466466
(fUserHooksVector->hooks).push_back(fEmissionVetoHook);
@@ -470,23 +470,23 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {
470470
if (PowhegRes) {
471471
edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
472472
if (!fPowhegResHook.get())
473-
fPowhegResHook.reset(new PowhegResHook());
473+
fPowhegResHook = std::make_shared<PowhegResHook>();
474474
(fUserHooksVector->hooks).push_back(fPowhegResHook);
475475
}
476476

477477
bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
478478
if (PowhegBB4L) {
479479
edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
480480
if (!fPowhegHooksBB4L.get())
481-
fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
481+
fPowhegHooksBB4L = std::make_shared<PowhegHooksBB4L>();
482482
(fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
483483
}
484484

485485
bool TopRecoilHook1 = fMasterGen->settings.flag("TopRecoilHook:doTopRecoilIn");
486486
if (TopRecoilHook1) {
487487
edm::LogInfo("Pythia8Interface") << "Turning on RecoilToTop hook from Pythia8Interface";
488488
if (!fTopRecoilHook.get())
489-
fTopRecoilHook.reset(new TopRecoilHook());
489+
fTopRecoilHook = std::make_shared<TopRecoilHook>();
490490
(fUserHooksVector->hooks).push_back(fTopRecoilHook);
491491
}
492492

@@ -501,7 +501,7 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {
501501

502502
if (internalMatching) {
503503
if (!fJetMatchingPy8InternalHook.get())
504-
fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
504+
fJetMatchingPy8InternalHook = std::make_shared<Pythia8::JetMatchingMadgraph>();
505505
(fUserHooksVector->hooks).push_back(fJetMatchingPy8InternalHook);
506506
}
507507

@@ -515,15 +515,15 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {
515515
? 2
516516
: 0);
517517
if (!fMergingHook.get())
518-
fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
518+
fMergingHook = std::make_shared<Pythia8::amcnlo_unitarised_interface>(scheme);
519519
(fUserHooksVector->hooks).push_back(fMergingHook);
520520
}
521521

522522
bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
523523
if (biasedTauDecayer) {
524524
if (!fBiasedTauDecayer.get()) {
525525
Pythia8::Info localInfo = fMasterGen->info;
526-
fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
526+
fBiasedTauDecayer = std::make_shared<BiasedTauDecayer>(&localInfo, &(fMasterGen->settings));
527527
}
528528
std::vector<int> handledParticles;
529529
handledParticles.push_back(15);
@@ -532,13 +532,13 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {
532532

533533
bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
534534
if (resonanceDecayFilter) {
535-
fResonanceDecayFilterHook.reset(new ResonanceDecayFilterHook);
535+
fResonanceDecayFilterHook = std::make_shared<ResonanceDecayFilterHook>();
536536
(fUserHooksVector->hooks).push_back(fResonanceDecayFilterHook);
537537
}
538538

539539
bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
540540
if (PTFilter) {
541-
fPTFilterHook.reset(new PTFilterHook);
541+
fPTFilterHook = std::make_shared<PTFilterHook>();
542542
(fUserHooksVector->hooks).push_back(fPTFilterHook);
543543
}
544544

@@ -580,7 +580,7 @@ bool Pythia8Hadronizer::initializeForInternalPartons() {
580580
if (useEvtGen) {
581581
edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
582582
if (!evtgenDecays.get()) {
583-
evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
583+
evtgenDecays = std::make_shared<EvtGenDecays>(fMasterGen.get(), evtgenDecFile, evtgenPdlFile);
584584
for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
585585
evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
586586
}
@@ -595,7 +595,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
595595
bool status = false, status1 = false;
596596

597597
if (!fUserHooksVector.get())
598-
fUserHooksVector.reset(new UserHooksVector);
598+
fUserHooksVector = std::make_shared<UserHooksVector>();
599599
(fUserHooksVector->hooks).clear();
600600

601601
if (fReweightUserHook.get())
@@ -627,7 +627,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
627627
"are : jetMatching, emissionVeto1 \n";
628628

629629
if (!fEmissionVetoHook.get())
630-
fEmissionVetoHook.reset(new PowhegHooks());
630+
fEmissionVetoHook = std::make_shared<PowhegHooks>();
631631

632632
edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
633633
(fUserHooksVector->hooks).push_back(fEmissionVetoHook);
@@ -637,23 +637,23 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
637637
if (PowhegRes) {
638638
edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
639639
if (!fPowhegResHook.get())
640-
fPowhegResHook.reset(new PowhegResHook());
640+
fPowhegResHook = std::make_shared<PowhegResHook>();
641641
(fUserHooksVector->hooks).push_back(fPowhegResHook);
642642
}
643643

644644
bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
645645
if (PowhegBB4L) {
646646
edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
647647
if (!fPowhegHooksBB4L.get())
648-
fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
648+
fPowhegHooksBB4L = std::make_shared<PowhegHooksBB4L>();
649649
(fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
650650
}
651651

652652
bool TopRecoilHook1 = fMasterGen->settings.flag("TopRecoilHook:doTopRecoilIn");
653653
if (TopRecoilHook1) {
654654
edm::LogInfo("Pythia8Interface") << "Turning on RecoilToTop hook from Pythia8Interface";
655655
if (!fTopRecoilHook.get())
656-
fTopRecoilHook.reset(new TopRecoilHook());
656+
fTopRecoilHook = std::make_shared<TopRecoilHook>();
657657
(fUserHooksVector->hooks).push_back(fTopRecoilHook);
658658
}
659659

@@ -668,7 +668,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
668668

669669
if (internalMatching) {
670670
if (!fJetMatchingPy8InternalHook.get())
671-
fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
671+
fJetMatchingPy8InternalHook = std::make_shared<Pythia8::JetMatchingMadgraph>();
672672
(fUserHooksVector->hooks).push_back(fJetMatchingPy8InternalHook);
673673
}
674674

@@ -682,15 +682,15 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
682682
? 2
683683
: 0);
684684
if (!fMergingHook.get())
685-
fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
685+
fMergingHook = std::make_shared<Pythia8::amcnlo_unitarised_interface>(scheme);
686686
(fUserHooksVector->hooks).push_back(fMergingHook);
687687
}
688688

689689
bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
690690
if (biasedTauDecayer) {
691691
if (!fBiasedTauDecayer.get()) {
692692
Pythia8::Info localInfo = fMasterGen->info;
693-
fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
693+
fBiasedTauDecayer = std::make_shared<BiasedTauDecayer>(&localInfo, &(fMasterGen->settings));
694694
}
695695
std::vector<int> handledParticles;
696696
handledParticles.push_back(15);
@@ -699,13 +699,13 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
699699

700700
bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
701701
if (resonanceDecayFilter) {
702-
fResonanceDecayFilterHook.reset(new ResonanceDecayFilterHook);
702+
fResonanceDecayFilterHook = std::make_shared<ResonanceDecayFilterHook>();
703703
(fUserHooksVector->hooks).push_back(fResonanceDecayFilterHook);
704704
}
705705

706706
bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
707707
if (PTFilter) {
708-
fPTFilterHook.reset(new PTFilterHook);
708+
fPTFilterHook = std::make_shared<PTFilterHook>();
709709
(fUserHooksVector->hooks).push_back(fPTFilterHook);
710710
}
711711

@@ -724,7 +724,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
724724
status = fMasterGen->init();
725725

726726
} else {
727-
lhaUP.reset(new LHAupLesHouches());
727+
lhaUP = std::make_shared<LHAupLesHouches>();
728728
lhaUP->setScalesFromLHEF(fMasterGen->settings.flag("Beams:setProductionScalesFromLHEF"));
729729
lhaUP->loadRunInfo(lheRunInfo());
730730

@@ -759,7 +759,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons() {
759759
if (useEvtGen) {
760760
edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
761761
if (!evtgenDecays.get()) {
762-
evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
762+
evtgenDecays = std::make_shared<EvtGenDecays>(fMasterGen.get(), evtgenDecFile, evtgenPdlFile);
763763
for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
764764
evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
765765
}

0 commit comments

Comments
 (0)