Skip to content

Commit 127b0c4

Browse files
mpuccioalcaliva
authored andcommitted
Fix injection gap math (#1859)
* 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)
1 parent 5d3e8f8 commit 127b0c4

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

MC/config/PWGLF/pythia8/generator_pythia8_LF.C

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,7 @@ class GeneratorPythia8LF : public o2::eventgen::GeneratorPythia8
161161
LOG(info) << "Using config container ";
162162
cfg.print();
163163
if (mUseTriggering) { // Do the triggering
164-
bool doSignal = true; // Do signal or gap
165-
if (mGapBetweenInjection > 0) {
166-
if (mGapBetweenInjection == 1 && mEventCounter % 2 == 0) {
167-
doSignal = false;
168-
} else if (mEventCounter % mGapBetweenInjection + 1 != 0) {
169-
doSignal = false;
170-
}
171-
}
164+
bool doSignal{mEventCounter % (mGapBetweenInjection + 1) == 0}; // Do signal or gap
172165

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

0 commit comments

Comments
 (0)