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
22 changes: 17 additions & 5 deletions MC/bin/o2_hybrid_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def main():
args = parser.parse_args()

# Check if the mode is valid
mode = "sequential"
if args.mode not in ["sequential", "parallel"]:
print(f"Mode {args.mode} not valid. Please use 'seq' or 'par'")
valid_modes = ["sequential", "parallel"]
mode = args.mode if args.mode in valid_modes else "sequential"
if args.mode and args.mode not in valid_modes:
print(f"Mode {args.mode} not valid. Please use 'sequential' or 'parallel'")
print("Setting sequential mode as default")
else:
print(f"Running in {args.mode} mode")
mode = args.mode
print(f"Running in {mode} mode")

# put in a list all the elementes in the gen flag
noConfGen = ["pythia8pp", "pythia8hf", "pythia8hi", "pythia8powheg"]
Expand Down Expand Up @@ -63,6 +63,18 @@ def main():
"iniFile": ""
}
})
elif gen == "evtpool":
gens.append({
'name': 'evtpool',
'config': {
"eventPoolPath": "/path/to/filename.root",
"skipNonTrackable": True,
"roundRobin": False,
"randomize": True,
"rngseed": 0,
"randomphi": False,
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fine for now. In future, we could deduce these fields dynamically using the ROOT dictionaries. Python can surely simply iterate over the class fields.

elif gen == "extkinO2":
gens.append({
'name': 'extkinO2',
Expand Down
Loading