File indexing completed on 2025-12-16 10:37:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 nev=100
0019 window=2000
0020 skip=0
0021 seed=42
0022
0023
0024
0025
0026
0027
0028 sf=0
0029
0030 if [ "$sf" -gt 0 ]; then
0031 sig_type="dis"
0032 elif [ "$sf" -eq 0 ]; then
0033 sig_type="forced"
0034 else
0035 sig_type="minbias"
0036 fi
0037
0038
0039
0040
0041
0042
0043
0044 echo "Please select an option:"
0045 echo "1: DIS 18x275"
0046 echo "2: DIS 18x275, no SR"
0047 echo "3: minbias 18x275"
0048 echo "4: DIS 10x275, SR scaled from 18GeV"
0049 echo "5: DIS 5x100, SR scaled from 18GeV"
0050 echo "6: Backgrounds only 18x275"
0051
0052
0053 read -p "Enter option number (1-6): " option
0054 if [[ "$option" == "1" ]]; then
0055 ebeam=18
0056 pbeam=275
0057 tag=""
0058 signal="pythia8NCDIS_18x275_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc"
0059 bg_files=(
0060
0061 "root://dtn-eic.jlab.org//volatile/eic/andrii/SynradG4_HepMC_Files_SR_on_IP6/data/synrad/dataprod_rel_1.0.0/18x275/dataprod_rel_1.0.0_synrad_18x275_run001.preproc_10000repeats.hepmc3.tree.root"
0062 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electronbrems/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electronbrems_18x275_50sec.hepmc3.tree.root"
0063 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electroncoulomb/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electroncoulomb_18x275_50sec.hepmc3.tree.root"
0064 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electrontouschek/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electrontouschek_18x275_50sec.hepmc3.tree.root"
0065 "root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/275GeV/pythia8.306-1.0_ProtonBeamGas_275GeV_run001.hepmc3.tree.root"
0066 )
0067 freqs=(3300000 18.26 0.86 0.55 22.5)
0068 statuses=(2000 3000 4000 5000 6000)
0069
0070 elif [[ "$option" == "2" ]]; then
0071 ebeam=18
0072 pbeam=275
0073 tag="_noSR_"
0074 signal="pythia8NCDIS_18x275_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc"
0075 bg_files=(
0076 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electronbrems/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electronbrems_18x275_50sec.hepmc3.tree.root"
0077 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electroncoulomb/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electroncoulomb_18x275_50sec.hepmc3.tree.root"
0078 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electrontouschek/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electrontouschek_18x275_50sec.hepmc3.tree.root"
0079 "root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/275GeV/pythia8.306-1.0_ProtonBeamGas_275GeV_run001.hepmc3.tree.root"
0080 )
0081 freqs=(18.26 0.86 0.55 22.5)
0082 statuses=(3000 4000 5000 6000)
0083
0084 elif [[ "$option" == "3" ]]; then
0085 ebeam=18
0086 pbeam=275
0087 tag="_minbias_"
0088 signal="pythia_ep_noradcor_18x275_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root"
0089 bg_files=(
0090 "dataprod_rel_1.0.0_synrad_18x275_run001.preproc_10000repeats.hepmc3.tree.root"
0091 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electronbrems/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electronbrems_18x275_50sec.hepmc3.tree.root"
0092 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electroncoulomb/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electroncoulomb_18x275_50sec.hepmc3.tree.root"
0093 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electrontouschek/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electrontouschek_18x275_50sec.hepmc3.tree.root"
0094 "root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/275GeV/pythia8.306-1.0_ProtonBeamGas_275GeV_run001.hepmc3.tree.root"
0095 )
0096 freqs=(3300000 18.26 0.86 0.55 22.5)
0097 statuses=(2000 3000 4000 5000 6000)
0098
0099 elif [[ "$option" == "4" ]]; then
0100 ebeam=10
0101 pbeam=275
0102 tag="_scaled_SR_"
0103 signal="pythia8NCDIS_10x275_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc"
0104
0105 bg_files=(
0106 "root://dtn-eic.jlab.org//volatile/eic/andrii/SynradG4_HepMC_Files_SR_on_IP6/data/synrad/dataprod_rel_1.0.0/10x275/dataprod_rel_1.0.0_synrad_10x275_run001.preproc_10000repeats.hepmc3.tree.root"
0107 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electronbrems/dataprod_rel_1.0.1/10x275/dataprod_rel_1.0.1_electronbrems_10x275_50sec.hepmc3.tree.root"
0108 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electroncoulomb/dataprod_rel_1.0.1/10x275/dataprod_rel_1.0.1_electroncoulomb_10x275_50sec.hepmc3.tree.root"
0109 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electrontouschek/dataprod_rel_1.0.1/10x275/dataprod_rel_1.0.1_electrontouschek_10x275_50sec.hepmc3.tree.root"
0110 "root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/275GeV/pythia8.306-1.0_ProtonBeamGas_275GeV_run001.hepmc3.tree.root"
0111 )
0112
0113 freqs=(36608000 172.31 29.56 233.50 32.6)
0114 statuses=(2000 3000 4000 5000 6000)
0115
0116 elif [[ "$option" == "5" ]]; then
0117 ebeam=5
0118 pbeam=100
0119 tag="_scaled_SR_"
0120 signal="root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/DIS/NC/5x100/minQ2=1/pythia8NCDIS_5x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc3.tree.root"
0121 bg_files=(
0122 "root://dtn-eic.jlab.org//volatile/eic/andrii/SynradG4_HepMC_Files_SR_on_IP6/data/synrad/dataprod_rel_1.0.0/5x100/dataprod_rel_1.0.0_synrad_5x100_run001.preproc_10000repeats.hepmc3.tree.root"
0123 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electronbrems/dataprod_rel_1.0.1/5x100/dataprod_rel_1.0.1_electronbrems_5x100_50sec.hepmc3.tree.root"
0124 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electroncoulomb/dataprod_rel_1.0.1/5x100/dataprod_rel_1.0.1_electroncoulomb_5x100_50sec.hepmc3.tree.root"
0125 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electrontouschek/dataprod_rel_1.0.1/5x100/dataprod_rel_1.0.1_electrontouschek_5x100_50sec.hepmc3.tree.root"
0126 "root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/100GeV/pythia8.306-1.0_ProtonBeamGas_100GeV_run001.hepmc3.tree.root"
0127 )
0128 statuses=(2000 3000 4000 5000 6000)
0129 freqs=(36608000 328.04 116.57 1112.3 22)
0130
0131 elif [[ "$option" == "6" ]]; then
0132 ebeam=18
0133 pbeam=275
0134 sig_type="bgOnly"
0135 tag=""
0136 signal="pythia8NCDIS_18x275_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc"
0137 bg_files=(
0138
0139 "root://dtn-eic.jlab.org//volatile/eic/andrii/SynradG4_HepMC_Files_SR_on_IP6/data/synrad/dataprod_rel_1.0.0/18x275/dataprod_rel_1.0.0_synrad_18x275_run001.preproc_10000repeats.hepmc3.tree.root"
0140 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electronbrems/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electronbrems_18x275_50sec.hepmc3.tree.root"
0141 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electroncoulomb/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electroncoulomb_18x275_50sec.hepmc3.tree.root"
0142 "root://dtn-eic.jlab.org//volatile/eic/andrii/Xsuite_HepMC_Files_ESR_BeamLoss_on_ePIC/data/xsuite/electrontouschek/dataprod_rel_1.0.1/18x275/dataprod_rel_1.0.1_electrontouschek_18x275_50sec.hepmc3.tree.root"
0143 "root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/275GeV/pythia8.306-1.0_ProtonBeamGas_275GeV_run001.hepmc3.tree.root"
0144 )
0145 freqs=(3300000 18.26 0.86 0.55 22.5)
0146 statuses=(2000 3000 4000 5000 6000)
0147
0148 else
0149 echo "Invalid option selected."
0150 exit 1
0151 fi
0152
0153
0154
0155
0156 outfile=bgmerged_${sig_type}_${ebeam}x${pbeam}${tag}n${nev}.hepmc3.tree.root
0157 cmd="./SignalBackgroundMerger -N ${nev} --rngSeed ${seed} -o merged/${outfile}"
0158
0159
0160 if [[ "$option" == "6" ]]; then
0161 cmd+=" -i $signal -sf 0.01 -S $nskip -w $window"
0162 elif [ "$sf" -ge 0 ]; then
0163 cmd+=" -i $signal -sf $sf -S $nskip -w $window"
0164 else
0165 cmd+=" -i pythia_ep_noradcor_18x275_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root -sf 83 "
0166 fi
0167
0168
0169 for bg_file in "${bg_files[@]}"; do
0170
0171 filename=$(basename "$bg_file")
0172
0173
0174 if [ -f "$filename" ]; then
0175 echo "File '$filename' already exists locally."
0176 else
0177 echo "File '$filename' not found locally. Downloading..."
0178
0179 xrdcp "$bg_file" "$filename"
0180
0181
0182 if [ $? -eq 0 ]; then
0183 echo "File '$filename' downloaded successfully."
0184 else
0185 echo "Failed to download file '$filename'."
0186 exit
0187 fi
0188 fi
0189 done
0190
0191 length=${
0192
0193
0194 for ((i=0; i<length; i++)); do
0195 filename=$(basename "${bg_files[i]}")
0196 cmd+=" -b $filename ${freqs[i]} 0 ${statuses[i]} "
0197 done
0198
0199
0200 echo "Generated command:"
0201 echo "$cmd"
0202
0203
0204 mkdir log
0205 mkdir merged
0206
0207 eval "$cmd" >> log/$outfile.log
0208
0209 echo "DONE! See output under log/ and merged/."
0210 echo Please add the following flags to your npsim command:
0211 echo --physics.alternativeStableStatuses="2001 3001 4001 5001 6001" --physics.alternativeDecayStatuses="2002 3002 4002 5002 6002"
0212