Skip to content

Commit c8fdddb

Browse files
authored
Reduce Pythia8 verbosity on Hyperloop (#15731)
1 parent 44f9245 commit c8fdddb

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Generators/include/Generators/GeneratorPythia8.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,12 @@ class GeneratorPythia8 : public Generator
263263
/// performs seeding of the random state of Pythia (called from Init)
264264
void seedGenerator();
265265

266+
// Hyperloop flag
267+
const bool mIsHyperloop = std::getenv("IS_HYPERLOOP") && std::atoi(std::getenv("IS_HYPERLOOP"));
268+
266269
/** Pythia8 **/
267-
Pythia8::Pythia mPythia; //!
270+
// Show banner only when not running in Hyperloop
271+
Pythia8::Pythia mPythia{/*Default*/ "../share/Pythia8/xmldoc", /*banner*/ !mIsHyperloop}; //!
268272

269273
/** @{
270274
* @name Configurations */

Generators/src/GeneratorPythia8.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ GeneratorPythia8::GeneratorPythia8(Pythia8GenConfig const& config) : Generator("
6666
mInterface = reinterpret_cast<void*>(&mPythia);
6767
mInterfaceName = "pythia8";
6868

69+
// Decrease Pythia8 verbosity when running in Hyperloop
70+
if (mIsHyperloop) {
71+
LOG(info) << "Simulation running in Hyperloop => reducing Pythia8 logs";
72+
mPythia.readString("Print:quiet on");
73+
}
74+
6975
LOG(info) << "Instance \'Pythia8\' generator with following parameters";
7076
LOG(info) << "config: " << config.config;
7177
LOG(info) << "hooksFileName: " << config.hooksFileName;

0 commit comments

Comments
 (0)