File indexing completed on 2025-10-13 09:44:41
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
0051
0052 read -p "Enter option number (1-5): " option
0053 if [[ "$option" == "1" ]]; then
0054 ebeam=18
0055 pbeam=275
0056 tag=""
0057 signal="pythia8NCDIS_18x275_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc"
0058 bg_files=(
0059
0060 "dataprod_rel_1.0.0_synrad_18x275_run001.preproc_10000repeats.hepmc3.tree.root"
0061 "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"
0062 "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"
0063 "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"
0064 "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"
0065 )
0066 freqs=(3300000 18.26 0.86 0.55 22.5)
0067 statuses=(2000 3000 4000 5000 6000)
0068
0069 elif [[ "$option" == "2" ]]; then
0070 ebeam=18
0071 pbeam=275
0072 tag="_noSR_"
0073 signal="pythia8NCDIS_18x275_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc"
0074 bg_files=(
0075 "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"
0076 "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"
0077 "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"
0078 "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"
0079 )
0080 freqs=(18.26 0.86 0.55 22.5)
0081 statuses=(3000 4000 5000 6000)
0082
0083 elif [[ "$option" == "3" ]]; then
0084 ebeam=18
0085 pbeam=275
0086 tag="_minbias_"
0087 signal="pythia_ep_noradcor_18x275_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root"
0088 bg_files=(
0089 "dataprod_rel_1.0.0_synrad_18x275_run001.preproc_10000repeats.hepmc3.tree.root"
0090 "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"
0091 "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"
0092 "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"
0093 "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"
0094 )
0095 freqs=(3300000 18.26 0.86 0.55 22.5)
0096 statuses=(2000 3000 4000 5000 6000)
0097
0098 elif [[ "$option" == "4" ]]; then
0099 ebeam=10
0100 pbeam=275
0101 tag="_scaled_SR_"
0102 signal="pythia8NCDIS_10x275_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.hepmc"
0103
0104 bg_files=(
0105 "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"
0106 "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"
0107 "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"
0108 "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"
0109 "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"
0110 )
0111
0112 freqs=(36608000 172.31 29.56 233.50 32.6)
0113 statuses=(2000 3000 4000 5000 6000)
0114
0115 elif [[ "$option" == "5" ]]; then
0116 ebeam=5
0117 pbeam=100
0118 tag="_scaled_SR_"
0119 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"
0120 bg_files=(
0121 "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"
0122 "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"
0123 "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"
0124 "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"
0125 "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"
0126 )
0127 statuses=(2000 3000 4000 5000 6000)
0128 freqs=(36608000 328.04 116.57 1112.3 22)
0129 else
0130 echo "Invalid option selected."
0131 exit 1
0132 fi
0133
0134
0135
0136
0137 outfile=bgmerged_${sig_type}_${ebeam}x${pbeam}${tag}n${nev}.hepmc
0138 cmd="./SignalBackgroundMerger -N ${nev} --rngSeed ${seed} -o merged/${outfile}"
0139
0140
0141 if [ "$sf" -ge 0 ]; then
0142 cmd+=" -i $signal -sf $sf -S $nskip -w $window"
0143 else
0144
0145 cmd+=" -i pythia_ep_noradcor_18x275_q2_0.000000001_1.0_run1.ab.hepmc3.tree.root -sf 83 "
0146 fi
0147
0148
0149 for bg_file in "${bg_files[@]}"; do
0150
0151 filename=$(basename "$bg_file")
0152
0153
0154 if [ -f "$filename" ]; then
0155 echo "File '$filename' already exists locally."
0156 else
0157 echo "File '$filename' not found locally. Downloading..."
0158
0159 xrdcp "$bg_file" "$filename"
0160
0161
0162 if [ $? -eq 0 ]; then
0163 echo "File '$filename' downloaded successfully."
0164 else
0165 echo "Failed to download file '$filename'."
0166 exit
0167 fi
0168 fi
0169 done
0170
0171 length=${
0172
0173
0174 for ((i=0; i<length; i++)); do
0175 filename=$(basename "${bg_files[i]}")
0176 cmd+=" -b $filename ${freqs[i]} 0 ${statuses[i]} "
0177 done
0178
0179
0180 echo "Generated command:"
0181 echo "$cmd"
0182
0183
0184 mkdir log
0185 mkdir merged
0186
0187 eval "$cmd" >> log/$outfile.log
0188
0189 echo "DONE! See output under log/ and merged/."
0190 echo Please add the following flags to your npsim command:
0191 echo --physics.alternativeStableStatuses="2001 3001 4001 5001 6001" --physics.alternativeDecayStatuses="2002 3002 4002 5002 6002"
0192