Skip to content

Commit

Permalink
Fix injection gap math (#1859)
Browse files Browse the repository at this point in the history
* Fix injection gap math

The change introduced in #1431 had the side effect that no signal events were present in recent productions using this generator, as for operator precedence one could never satisfy the condition of the if regulating the generation of signal events.

* Further simplify the code

(cherry picked from commit c23cfd2)
  • Loading branch information
mpuccio authored and alcaliva committed Jan 22, 2025
1 parent 653109a commit ebc2122
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions MC/config/PWGLF/pythia8/generator_pythia8_LF.C
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,7 @@ class GeneratorPythia8LF : public o2::eventgen::GeneratorPythia8
LOG(info) << "Using config container ";
cfg.print();
if (mUseTriggering) { // Do the triggering
bool doSignal = true; // Do signal or gap
if (mGapBetweenInjection > 0) {
if (mGapBetweenInjection == 1 && mEventCounter % 2 == 0) {
doSignal = false;
} else if (mEventCounter % mGapBetweenInjection + 1 != 0) {
doSignal = false;
}
}
bool doSignal{mEventCounter % (mGapBetweenInjection + 1) == 0}; // Do signal or gap

if (doSignal) {
LOG(info) << "Generating triggered signal event for particle";
Expand Down

0 comments on commit ebc2122

Please sign in to comment.