-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AliceO2Group:master' into etatune
- Loading branch information
Showing
50 changed files
with
859 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# This script creates a template JSON file for the configuration of the hybrid generator | ||
# The generators to be used are passed as a list of strings via the --gen flag, while the | ||
# output filename is set using --output. All the generators available in O2sim are supported. | ||
# Example: | ||
# $O2DPG_ROOT/MC/bin/o2_hybrid_gen.py --gen pythia8 boxgen external extkinO2 hepmc pythia8hf \ | ||
# --output config.json | ||
|
||
import argparse | ||
import json | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Create a JSON file from command line flags.') | ||
parser.add_argument('--gen', type=str, nargs='+', required=True, help='List of generators to be used') | ||
parser.add_argument('--output', type=str, required=True, help='Output JSON file path') | ||
|
||
args = parser.parse_args() | ||
|
||
# put in a list all the elementes in the gen flag | ||
noConfGen = ["pythia8pp", "pythia8hf", "pythia8hi", "pythia8powheg"] | ||
gens = [] | ||
for gen in args.gen: | ||
if gen == "pythia8": | ||
gens.append({ | ||
'name': 'pythia8', | ||
'config': { | ||
"config": "$O2_ROOT/share/Generators/egconfig/pythia8_inel.cfg", | ||
"hooksFileName": "", | ||
"hooksFuncName": "", | ||
"includePartonEvent": False, | ||
"particleFilter": "", | ||
"verbose": 0 | ||
} | ||
}) | ||
elif gen == "external": | ||
gens.append({ | ||
'name': 'external', | ||
'config': { | ||
"fileName": "${O2DPG_ROOT}/MC/config/PWGDQ/external/generator/GeneratorParamPromptJpsiToElectronEvtGen_pp13TeV.C", | ||
"funcName": "GeneratorParamPromptJpsiToElectronEvtGen_pp13TeV()" | ||
} | ||
}) | ||
elif gen == "extkinO2": | ||
gens.append({ | ||
'name': 'extkinO2', | ||
'config': { | ||
"skipNonTrackable": True, | ||
"continueMode": False, | ||
"roundRobin": False, | ||
"randomize": False, | ||
"rngseed": 0, | ||
"randomphi": False, | ||
"fileName": "/path/to/filename.root" | ||
} | ||
}) | ||
elif gen == "hepmc": | ||
gens.append({ | ||
"name": "hepmc", | ||
"config": { | ||
"configcmd": { | ||
"fileNames": "", | ||
"cmd": "" | ||
}, | ||
"confighepmc": { | ||
"version": 2, | ||
"eventsToSkip": 0, | ||
"fileName": "/path/to/filename.hepmc", | ||
"prune": False | ||
} | ||
} | ||
}) | ||
elif gen == "boxgen": | ||
gens.append({ | ||
"name": "boxgen", | ||
"config": { | ||
"pdg": 13, | ||
"number": 1, | ||
"eta": [ | ||
-4, | ||
-2.5 | ||
], | ||
"prange": [ | ||
0.1, | ||
5 | ||
], | ||
"phirange": [ | ||
0, | ||
360 | ||
] | ||
} | ||
}) | ||
elif gen in noConfGen: | ||
gens.append({ | ||
"name": gen, | ||
"config": "" | ||
}) | ||
else: | ||
print(f"Generator {gen} not found in the list of available generators") | ||
exit(1) | ||
|
||
# fill fractions with 1 for each generator | ||
fractions = [1] * len(gens) | ||
|
||
# Put gens and fractions in the data dictionary | ||
data = { | ||
"generators": gens, | ||
"fractions": fractions | ||
} | ||
|
||
# Write the data dictionary to a JSON file | ||
with open(args.output, 'w') as f: | ||
json.dump(data, f, indent=2) | ||
|
||
print(f"JSON file created at {args.output}") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Decay J/psi | ||
### from DECAY.DEC | ||
1.000 e+ e- PHOTOS VLL; | ||
Enddecay | ||
Decay psi(2S) | ||
1.000 J/psi pi+ pi- VVPIPI; | ||
Enddecay | ||
End |
10 changes: 10 additions & 0 deletions
10
MC/config/PWGDQ/EvtGen/DecayTablesEvtgen/X3872TOJPSIPIPI.DEC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Decay X_1(3872) | ||
#### Breit-Wigner function for the pion distribution (S-Wave approximation) | ||
1.000 J/psi pi+ pi- XJPSIRHO0PIPI_S; | ||
Enddecay | ||
Decay J/psi | ||
### from DECAY.DEC | ||
1.000 e+ e- PHOTOS VLL; | ||
Enddecay | ||
|
||
End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
MC/config/PWGDQ/ini/Generator_InjectedPromptPsi2SToJpsiPiPiMidy_TriggerGap.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### The external generator derives from GeneratorPythia8. | ||
[GeneratorExternal] | ||
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/external/generator/generator_pythia8_withInjectedPromptSignals_gaptriggered_dq.C | ||
funcName=GeneratorPythia8InjectedPromptCharmoniaGapTriggered(5,9) | ||
[GeneratorPythia8] | ||
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/pythia8/generator/pythia8_inel_triggerGap.cfg |
6 changes: 6 additions & 0 deletions
6
MC/config/PWGDQ/ini/Generator_InjectedPromptX3782Midy_TriggerGap.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### The external generator derives from GeneratorPythia8. | ||
[GeneratorExternal] | ||
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/external/generator/generator_pythia8_withInjectedPromptSignals_gaptriggered_dq.C | ||
funcName=GeneratorPythia8InjectedPromptCharmoniaGapTriggered(5,8) | ||
[GeneratorPythia8] | ||
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/pythia8/generator/pythia8_inel_triggerGap.cfg |
Oops, something went wrong.