Skip to content

Commit

Permalink
Included trigger in template generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jackal1-66 committed Jan 16, 2025
1 parent a77ed47 commit 88d7f2e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions MC/bin/o2_hybrid_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def main():
parser.add_argument('--gen', type=str, nargs='+', help='List of generators to be used')
parser.add_argument('--iniFile', type=str, nargs='+', help='List of external generators configured with ini files')
parser.add_argument('--mode', type=str, help='Run generator in sequential or parallel mode for quicker event generation (multi-threading)')
parser.add_argument('--trigger', type=str, help='Specify the trigger mode for the hybrid generator (and, or). OFF by default')
parser.add_argument('--output', type=str, required=True, help='Output JSON file path')
parser.add_argument('--clone', type=int, help='Number of clones to make of the generator list')

Expand All @@ -69,6 +70,15 @@ def main():
else:
print(f"Running in {mode} mode")

# Check if the trigger mode is set
trigger_modes = ["and", "or"]
trigger = args.trigger if args.trigger in trigger_modes else ""
if trigger:
print(f"Set trigger mode to '{trigger}'")
elif args.trigger and args.trigger != "off":
print(f"Trigger mode {args.trigger} not valid. Please use [and,or,off]")
print("Trigger mode turned OFF")

# put in a list all the elementes in the gen flag
noConfGen = ["pythia8pp", "pythia8hf", "pythia8hi", "pythia8powheg"]
gens = []
Expand Down Expand Up @@ -131,6 +141,7 @@ def main():
# Put gens and fractions in the data dictionary
data = {
"mode": mode,
"trigger": trigger if trigger else "off",
"generators": gens,
"fractions": fractions
}
Expand Down

0 comments on commit 88d7f2e

Please sign in to comment.