diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_epl_100GeV-101103.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_elec_100GeV-101103.json similarity index 66% rename from Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_epl_100GeV-101103.json rename to Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_elec_100GeV-101103.json index 4b540f260b55a33fe744c32bea39b505f9fbc397..76297a72313ed0c9fb7f36e95cc2312c4249c605 100644 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_epl_100GeV-101103.json +++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_elec_100GeV-101103.json @@ -1,13 +1,13 @@ { - "file_length": 500, + "file_length": 250, "mass": 0.511, "maxE": 100.0, "minE": 100.0, - "pid": -11, + "pid": [-11, 11], "radius": 100.0, "run": 101103, "sampler": "const", "segment": 0, - "short": "MDC_PG_epl_100GeV", + "short": "MDC_PG_elec_100GeV", "zpos": -1000.0 } diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_epl_logE-101101.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_elec_logE-101101.json similarity index 77% rename from Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_epl_logE-101101.json rename to Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_elec_logE-101101.json index 95fd9fa706c2cd385859df1d00beefaa9e802571..d2e0ab8e3c6ef9186f3efc1c6edde50d36295d62 100644 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_epl_logE-101101.json +++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_elec_logE-101101.json @@ -3,11 +3,11 @@ "mass": 0.511, "maxE": 1000.0, "minE": 10.0, - "pid": -11, + "pid": [-11, 11], "radius": 100.0, "run": 101101, "sampler": "log", "segment": 0, - "short": "MDC_PG_epl_logE", + "short": "MDC_PG_elec_logE", "zpos": -1000.0 } diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_emi_100GeV-101104.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_emi_100GeV-101104.json deleted file mode 100644 index 434153301a8580ef241b7186c448003f67016f01..0000000000000000000000000000000000000000 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_emi_100GeV-101104.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "file_length": 500, - "mass": 0.511, - "maxE": 100.0, - "minE": 100.0, - "pid": 11, - "radius": 100.0, - "run": 101104, - "sampler": "const", - "segment": 0, - "short": "MDC_PG_emi_100GeV", - "zpos": -1000.0 -} diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_emi_logE-101102.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_emi_logE-101102.json deleted file mode 100644 index 56410bd94a49de9dab87b529b3eb5db1f2976591..0000000000000000000000000000000000000000 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_emi_logE-101102.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "file_length": 200, - "mass": 0.511, - "maxE": 1000.0, - "minE": 10.0, - "pid": 11, - "radius": 100.0, - "run": 101102, - "sampler": "log", - "segment": 0, - "short": "MDC_PG_emi_logE", - "zpos": -1000.0 -} diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_gam_100GeV-102201.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_gam_100GeV-102201.json index 04ddbb05ec2e43348693ea0a16203c921f0ac2de..dd04adada82c8feb155f9c911955014a9e7e7039 100644 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_gam_100GeV-102201.json +++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_gam_100GeV-102201.json @@ -1,5 +1,5 @@ { - "file_length": 500, + "file_length": 250, "mass": 0.0, "maxE": 100.0, "minE": 100.0, diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_mumi_logE-101302.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_mumi_logE-101302.json deleted file mode 100644 index 1387658b5efee880662a42560523f1ebff81e68f..0000000000000000000000000000000000000000 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_mumi_logE-101302.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "file_length": 2000, - "mass": 105.66, - "maxE": 2000.0, - "minE": 10.0, - "pid": 13, - "radius": 100.0, - "run": 101302, - "sampler": "log", - "segment": 0, - "short": "MDC_PG_mumi_logE", - "zpos": null -} diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_mupl_logE-101301.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_logE-101301.json similarity index 76% rename from Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_mupl_logE-101301.json rename to Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_logE-101301.json index dda3d48ab90dbb3e963ac81996e26ad0864b2a7b..1e638eed3a4d6fc6117594f210db846c3244a633 100644 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_mupl_logE-101301.json +++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_logE-101301.json @@ -3,11 +3,11 @@ "mass": 105.66, "maxE": 2000.0, "minE": 10.0, - "pid": -13, + "pid": [-13, 13], "radius": 100.0, "run": 101301, "sampler": "log", "segment": 0, - "short": "MDC_PG_mupl_logE", + "short": "MDC_PG_muon_logE", "zpos": null } diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pimi_100GeV-121102.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pimi_100GeV-121102.json deleted file mode 100644 index cd8abc7eba3cbfbf56570fe320b8222b829bb190..0000000000000000000000000000000000000000 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pimi_100GeV-121102.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "file_length": 500, - "mass": 139.6, - "maxE": 100.0, - "minE": 100.0, - "pid": -211, - "radius": 100.0, - "run": 121102, - "sampler": "const", - "segment": 0, - "short": "MDC_PG_pimi_100GeV", - "zpos": -1000.0 -} diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pipl_100GeV-121101.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_100GeV-121101.json similarity index 75% rename from Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pipl_100GeV-121101.json rename to Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_100GeV-121101.json index 9874ba205e3142a184bffd54d793c407b621b03f..e40ea323a2b5e79165e8826f263f43e5d6c7c97c 100644 --- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pipl_100GeV-121101.json +++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_100GeV-121101.json @@ -3,11 +3,11 @@ "mass": 139.6, "maxE": 100.0, "minE": 100.0, - "pid": 211, + "pid": [211, -211], "radius": 100.0, "run": 121101, "sampler": "const", "segment": 0, - "short": "MDC_PG_pipl_100GeV", + "short": "MDC_PG_pion_100GeV", "zpos": -1000.0 } diff --git a/Control/CalypsoExample/Generation/python/faserMDC_pgparser.py b/Control/CalypsoExample/Generation/python/faserMDC_pgparser.py index 7c41638ea2c603bebafea3ba3a72d62ea2cb2eed..255275cb9b16be81a82fbfe6a9a01956e6d0bd0e 100644 --- a/Control/CalypsoExample/Generation/python/faserMDC_pgparser.py +++ b/Control/CalypsoExample/Generation/python/faserMDC_pgparser.py @@ -26,8 +26,8 @@ def faserMDC_pgparser(): parser.add_argument("--tag", default=None, help="Generator tag (g0000)") - parser.add_argument("--pid", default=13, type=int, - help="Specify PDG ID of particle (note plus/minus different)") + parser.add_argument("--pid", default=[-13, 13], type=int, nargs='*', + help="Specify PDG ID of particle (note plus/minus different) or list (e.g.: --pid -13 13)") parser.add_argument("--mass", default=105.66, type=float, help="Specify particle mass (in MeV)") parser.add_argument("--radius", default=100., type=float, diff --git a/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py b/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py index fe827c0fdea36cd271a579c29a2f7b47776a7bf5..60da030fb60f591cb6dd1c4d04efe50e201bb4d0 100755 --- a/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py +++ b/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py @@ -83,10 +83,14 @@ if __name__ == '__main__': from AthenaCommon.SystemOfUnits import GeV, TeV, cm, m from AthenaCommon.PhysicalConstants import pi + print(f"Using pid: {args.pid}") + + # Note args.pid is a list + # For ParticleGun to accept this, we need to turn it into a set... import ParticleGun as PG ConfigFlags.Sim.Gun = { "Generator" : "SingleParticle", - "pid" : args.pid, "mass" : args.mass, + "pid" : set(args.pid), "mass" : args.mass, "theta" : PG.GaussianSampler(0, args.angle, oneside = True), "phi" : [0, 2*pi], "radius" : args.radius, "randomSeed" : args.outfile } diff --git a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh index 1aa00c891ed46604d5ba294e6ea180c2ba00163a..638da7243a5bc8bf2bf7023556ab7d7fee67a916 100755 --- a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh +++ b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh @@ -60,11 +60,24 @@ config_file=$(basename "$config_path") defaultIFS=$IFS IFS='.' read config_file_stem ext <<< "$config_file" +# +# Try to find the run number +IFS='-' +# Read the split words into an array based on delimeter +read faser short run_number <<< "$config_file_stem" +# # Set the IFS delimeter back or else echo doesn't work... IFS=$defaultIFS # +# Check if we found a number, use full config name if not +output_directory="$working_directory/${run_number}" +re='^[0-9]+$' +if ! [[ $run_number =~ $re ]] ; then + # Not a number... + output_directory="$working_directory/${config_file_stem}" +fi +# # Make output directory if needed -output_directory="$working_directory/${config_file_stem}" mkdir -p "$output_directory" # # This magic redirects everything in this script to our log file