Skip to content

Commit 69a7aba

Browse files
authored
Merge pull request #43786 from mseidel42/P8RndmEnginePtr
Adaptions for Pythia 8.311
2 parents 6b15a09 + 8e2467b commit 69a7aba

File tree

12 files changed

+30
-25
lines changed

12 files changed

+30
-25
lines changed

FastSimulation/ParticleDecay/interface/PythiaDecays.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class RawParticle;
1212

1313
namespace gen {
1414
class P8RndmEngine;
15-
}
15+
typedef std::shared_ptr<P8RndmEngine> P8RndmEnginePtr;
16+
} // namespace gen
1617

1718
namespace CLHEP {
1819
class HepRandomEngine;
@@ -34,6 +35,6 @@ class PythiaDecays {
3435
private:
3536
DaughterParticleList theList;
3637
std::unique_ptr<Pythia8::Pythia> decayer;
37-
std::unique_ptr<gen::P8RndmEngine> p8RndmEngine;
38+
gen::P8RndmEnginePtr p8RndmEngine;
3839
};
3940
#endif

FastSimulation/ParticleDecay/src/PythiaDecays.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
PythiaDecays::PythiaDecays() {
1313
// inspired by method Pythia8Hadronizer::residualDecay() in GeneratorInterface/Pythia8Interface/src/Py8GunBase.cc
1414
decayer = std::make_unique<Pythia8::Pythia>();
15-
p8RndmEngine = std::make_unique<gen::P8RndmEngine>();
16-
decayer->setRndmEnginePtr(p8RndmEngine.get());
15+
p8RndmEngine = std::make_shared<gen::P8RndmEngine>();
16+
decayer->setRndmEnginePtr(p8RndmEngine);
1717
decayer->settings.flag("ProcessLevel:all", false);
1818
decayer->settings.flag("PartonLevel:FSRinResonances", false);
1919
decayer->settings.flag("ProcessLevel:resonanceDecays", false);

FastSimulation/SimplifiedGeometryPropagator/interface/Decayer.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
namespace gen {
1616
class P8RndmEngine;
17-
}
17+
typedef std::shared_ptr<P8RndmEngine> P8RndmEnginePtr;
18+
} // namespace gen
1819

1920
namespace CLHEP {
2021
class HepRandomEngine;
@@ -50,8 +51,8 @@ namespace fastsim {
5051
CLHEP::HepRandomEngine& engine) const;
5152

5253
private:
53-
std::unique_ptr<Pythia8::Pythia> pythia_; //!< Instance of pythia
54-
std::unique_ptr<gen::P8RndmEngine> pythiaRandomEngine_; //!< Instance of pythia Random Engine
54+
std::unique_ptr<Pythia8::Pythia> pythia_; //!< Instance of pythia
55+
gen::P8RndmEnginePtr pythiaRandomEngine_; //!< Instance of pythia Random Engine
5556
};
5657
} // namespace fastsim
5758
#endif

FastSimulation/SimplifiedGeometryPropagator/src/Decayer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
fastsim::Decayer::~Decayer() { ; }
1111

1212
fastsim::Decayer::Decayer() : pythia_(new Pythia8::Pythia()), pythiaRandomEngine_(new gen::P8RndmEngine()) {
13-
pythia_->setRndmEnginePtr(pythiaRandomEngine_.get());
13+
pythia_->setRndmEnginePtr(pythiaRandomEngine_);
1414
pythia_->settings.flag("ProcessLevel:all", false);
1515
pythia_->settings.flag("PartonLevel:FSRinResonances", false);
1616
pythia_->settings.flag("ProcessLevel:resonanceDecays", false);

GeneratorInterface/Pythia8Interface/interface/P8RndmEngine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ namespace gen {
3838

3939
CLHEP::HepRandomEngine* randomEngine_;
4040
};
41+
typedef std::shared_ptr<P8RndmEngine> P8RndmEnginePtr;
4142
} // namespace gen
4243
#endif

GeneratorInterface/Pythia8Interface/interface/Py8HMC3InterfaceBase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ namespace gen {
3737
virtual void statistics();
3838
virtual const char* classname() const = 0;
3939

40-
void p8SetRandomEngine(CLHEP::HepRandomEngine* v) { p8RndmEngine_.setRandomEngine(v); }
41-
P8RndmEngine& randomEngine() { return p8RndmEngine_; }
40+
void p8SetRandomEngine(CLHEP::HepRandomEngine* v) { p8RndmEngine_->setRandomEngine(v); }
41+
P8RndmEngine& randomEngine() { return *p8RndmEngine_; }
4242

4343
protected:
4444
std::unique_ptr<Pythia8::Pythia> fMasterGen;
@@ -62,7 +62,7 @@ namespace gen {
6262
std::string slhafile_;
6363

6464
private:
65-
P8RndmEngine p8RndmEngine_;
65+
P8RndmEnginePtr p8RndmEngine_;
6666
};
6767
} // namespace gen
6868
#endif

GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ namespace gen {
4040
virtual void statistics();
4141
virtual const char* classname() const = 0;
4242

43-
void p8SetRandomEngine(CLHEP::HepRandomEngine* v) { p8RndmEngine_.setRandomEngine(v); }
44-
P8RndmEngine& randomEngine() { return p8RndmEngine_; }
43+
void p8SetRandomEngine(CLHEP::HepRandomEngine* v) { p8RndmEngine_->setRandomEngine(v); }
44+
P8RndmEngine& randomEngine() { return *p8RndmEngine_; }
4545

4646
protected:
4747
std::unique_ptr<Pythia8::Pythia> fMasterGen;
@@ -67,7 +67,7 @@ namespace gen {
6767
std::string slhafile_;
6868

6969
private:
70-
P8RndmEngine p8RndmEngine_;
70+
std::shared_ptr<P8RndmEngine> p8RndmEngine_;
7171
};
7272
} // namespace gen
7373
#endif

GeneratorInterface/Pythia8Interface/plugins/PowhegHooksBB4L.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ namespace Pythia8 {
184184
iRes = e[iRes].mother1();
185185
}
186186
if (iRes == 0) {
187-
infoPtr->errorMsg(
188-
"Warning in PowhegHooksBB4L::doVetoFSREmission: emission in resonance not from the top quark or from the "
189-
"W boson, not vetoing");
187+
loggerPtr->errorMsg("PowhegHooksBB4L::doVetoFSREmission",
188+
"Emission in resonance not from the top quark or from the "
189+
"W boson, not vetoing");
190190
return doVetoFSR(false, 0);
191191
}
192192
int iResId = e[iRes].id();
@@ -241,7 +241,7 @@ namespace Pythia8 {
241241
<< scale << endl;
242242
return doVetoFSR(scale > wmresscale, scale);
243243
} else {
244-
infoPtr->errorMsg("Error in PowhegHooksBB4L::doVetoFSREmission: unimplemented case");
244+
loggerPtr->errorMsg("PowhegHooksBB4L::doVetoFSREmissio", "Unimplemented case");
245245
exit(-1);
246246
}
247247
}

GeneratorInterface/Pythia8Interface/plugins/SuepDecay.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ bool SuepDecay::initAfterBeams() {
99
mDark_ = particleDataPtr->m0(idDark_);
1010
bool medDecay = particleDataPtr->mayDecay(idMediator_);
1111
if (!medDecay) {
12-
infoPtr->errorMsg("Error in SuepDecay::initAfterBeams: mediator decay should be enabled");
12+
loggerPtr->errorMsg("SuepDecay::initAfterBeams", "mediator decay should be enabled");
1313
return false;
1414
}
1515

GeneratorInterface/Pythia8Interface/src/Py8HMC3InterfaceBase.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ namespace gen {
109109
fMasterGen->settings.addFlag("POWHEG:bb4l:FSREmission:pTpythiaVeto", false);
110110
fMasterGen->settings.addParm("POWHEG:bb4l:pTminVeto", 10.0, true, true, 0.0, 10.);
111111

112-
fMasterGen->setRndmEnginePtr(&p8RndmEngine_);
113-
fDecayer->setRndmEnginePtr(&p8RndmEngine_);
112+
fMasterGen->setRndmEnginePtr(p8RndmEngine_);
113+
fDecayer->setRndmEnginePtr(p8RndmEngine_);
114114

115115
fMasterGen->readString("Next:numberShowEvent = 0");
116116
fDecayer->readString("Next:numberShowEvent = 0");

0 commit comments

Comments
 (0)