Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions MC/config/common/external/generator/GeneratorHGPythia8.C
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ class GeneratorHGPythia8 : public GeneratorPythia8
}
mDensity[0].reset(makeNucleonDensity(mA, "HGPythia8A"));
mDensity[1].reset(makeNucleonDensity(mB, "HGPythia8B"));
// Build the cumulative tables of the 1D densities here: TF1::GetRandom integrates on its first call,
// and the default integrator is created through Cling, which is not thread safe.
// In hybrid mode Init() runs on the main thread while events are generated on TBB workers.
for (auto& density : mDensity) {
if (density && !dynamic_cast<TF2*>(density.get())) {
density->GetRandom(mRandom.get());
}
}
for (int j = 0; j < 2; ++j) {
mX[j].resize(j == 0 ? mA : mB);
mY[j].resize(j == 0 ? mA : mB);
Expand Down
Loading