Skip to content

Commit

Permalink
adding option to pass total cross section file directly. no need for …
Browse files Browse the repository at this point in the history
…complicated xsec file names.
  • Loading branch information
jtenavidal committed Mar 22, 2023
1 parent 380c03e commit 8d6c4ca
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/scripts/production/python/eAScatteringGridSubmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
op.add_option("--genie-topdir", dest="GENIE", default=os.getenv('GENIE'), help = "GENIE topdir: %default")
op.add_option("--jobs-topdir", dest="JOBSTD", default=os.getenv('PWD'), help="Top level dir for the job files (default: %default)")
op.add_option("--source-prod-dir", dest="MotherDir", default='', help="Jobs topdir used as a source for missing xsec splines.")
op.add_option("--total-xsec", dest="XSEC", default='', help="Total cross section file to use for event production")
op.add_option("--config-dir", dest="CONF", default='', help="Path to GENIE config dir")
op.add_option("--probe-list", dest="PROBELIST", default='11', help = "Comma separated list of lepton flavour (neutrino and electrons are handled). Default: %default.")
op.add_option("--nu-tgt-list", dest="NUTGTLIST", default='all', help = "Comma separated list of Targets. Default: %default.")
Expand Down Expand Up @@ -138,6 +139,12 @@
vAdir = opts.JOBSTD+'/'+version+'-'+opts.PROD+'_'+opts.CYCLE+'-xsec_vA/'
vAsplines = vAdir+'total_xsec.xml'

if opts.XSEC :
if os.path.isfile(opts.XSEC) == False :
print(" Input XSec file doesn't exist ")
exit()
vAsplines = opts.XSEC

# configure setup
if opts.GRID == 'FNAL' :
setup_file = opts.GENIE+'/src/scripts/production/python/setup_FNAL.sh'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def eScatteringGenCommands( e_list = "11",tgt_list="1000060120", EBeam_list="2",
if not os.path.exists(jobs_dir) :
os.mkdir(jobs_dir)


# Electron list
final_e_list = []
if e_list != 'all':
Expand Down Expand Up @@ -67,10 +66,12 @@ def eScatteringGenCommands( e_list = "11",tgt_list="1000060120", EBeam_list="2",
if not isinstance(nsubruns, int) :
nsubruns = 1+int(nsubruns)

xsec_filename = os.path.basename(xspl_file)

if grid_system == 'FNAL' :
input_xsec = "\$CONDOR_DIR_INPUT/total_xsec.xml"
input_xsec = "\$CONDOR_DIR_INPUT/"+xsec_filename
else :
input_xsec = free_nuc_dir+"/total_xsec.xml"
input_xsec = free_nuc_dir+xsec_filename

command_list = []
for e in final_e_list :
Expand Down
7 changes: 7 additions & 0 deletions src/scripts/production/python/vAScatteringGridSubmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
op.add_option("--genie-topdir", dest="GENIE", default=os.getenv('GENIE'), help = "GENIE topdir: %default")
op.add_option("--jobs-topdir", dest="JOBSTD", default=os.getenv('PWD'), help="Top level dir for the job files (default: %default)")
op.add_option("--source-prod-dir", dest="MotherDir", default='', help="Jobs topdir used as a source for missing xsec splines.")
op.add_option("--total-xsec", dest="XSEC", default='', help="Total cross section file to use for event production")
op.add_option("--config-dir", dest="CONF", default='', help="Path to GENIE config dir")
op.add_option("--probe-list", dest="PROBELIST", default='14', help = "Comma separated list of lepton flavour (neutrino and electrons are handled). Default: %default.")
op.add_option("--nu-tgt-list", dest="NUTGTLIST", default='all', help = "Comma separated list of Targets. Default: %default.")
Expand Down Expand Up @@ -144,6 +145,12 @@
vAdir = opts.JOBSTD+'/'+version+'-'+opts.PROD+'_'+opts.CYCLE+'-xsec_vA/'
vAsplines = vAdir+'total_xsec.xml'

if opts.XSEC :
if os.path.isfile(opts.XSEC) == False :
print(" Input XSec file doesn't exist ")
exit()
vAsplines = opts.XSEC

# configure setup
if opts.GRID == 'FNAL' :
setup_file = opts.GENIE+'/src/scripts/production/python/setup_FNAL.sh'
Expand Down

0 comments on commit 8d6c4ca

Please sign in to comment.