diff --git a/sbndcode/LArSoftConfigurations/gen/genie_sbnd.fcl b/sbndcode/LArSoftConfigurations/gen/genie_sbnd.fcl index 7cd0e4787..61672d575 100644 --- a/sbndcode/LArSoftConfigurations/gen/genie_sbnd.fcl +++ b/sbndcode/LArSoftConfigurations/gen/genie_sbnd.fcl @@ -376,7 +376,7 @@ sbnd_genie_simple_rockbox: { # As we are changing the FV we need to recalculate the maximum path lengths # This file was generated by running with: # GeomScan: "flux: 10000 1.1 1" - GeomScan: "file: GENIE/sbnd_rock_maxpathlength_fluxI_gdmlv02_00.xml" + GeomScan: "file: GENIE/sbnd_rock_maxpathlength_fluxL_gdmlv02_03.xml" } diff --git a/sbndcode/LArSoftConfigurations/gen/make_genie_geomscan_file_sbnd.fcl b/sbndcode/LArSoftConfigurations/gen/make_genie_geomscan_file_sbnd.fcl new file mode 100644 index 000000000..b0835f847 --- /dev/null +++ b/sbndcode/LArSoftConfigurations/gen/make_genie_geomscan_file_sbnd.fcl @@ -0,0 +1,21 @@ +# This FHiCL file generates the geomscal file needed for GENIE rockbox. +# Author: Marco Del Tutto (mdeltutt@fnal.gov) +# +# Run with: +# +# bash> lar -c make_genie_geomscan_file_sbnd.fcl -n 1 +# +# This will generate a file called "maxpathlength.xml". Rename this file +# to include the current flux config and gdml version. For example, +# for flux config L and gdml v02_03, assign it the following name: +# +# bash> mv maxpathlength.xml sbnd_rock_maxpathlength_fluxL_gdmlv02_03.xml +# +# Lastly, this file needs to live in sbnd_data. Specifically, in +# sbnd_data/GENIE/. Ask the currect release manager to copy your +# file in sbnd_data/GENIE/ and tag a new sbnd_data version. + +#include "prodgenie_corsika_proton_rockbox_sbnd.fcl" + +physics.producers.generator.GeomScan: "flux: 10000 1.1 1" + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a731aec44..763dee8cc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,6 +8,7 @@ cet_enable_asserts() add_subdirectory(Geometry) add_subdirectory(LArSoftConfigurations) add_subdirectory(JobConfigurations) +add_subdirectory(GENIE) #add_subdirectory(CRT) add_subdirectory(fcl) diff --git a/test/GENIE/CMakeLists.txt b/test/GENIE/CMakeLists.txt new file mode 100644 index 000000000..3489662f0 --- /dev/null +++ b/test/GENIE/CMakeLists.txt @@ -0,0 +1,6 @@ +cet_test(CheckGENIEGeomScan HANDBUILT + TEST_EXEC python + TEST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}/check_genie_geom_scan.py + DATAFILES check_genie_geom_scan.py +) + diff --git a/test/GENIE/check_genie_geom_scan.py b/test/GENIE/check_genie_geom_scan.py new file mode 100644 index 000000000..d86231085 --- /dev/null +++ b/test/GENIE/check_genie_geom_scan.py @@ -0,0 +1,40 @@ +import fhicl + +pset = fhicl.make_pset('prodgenie_corsika_proton_rockbox_sbnd.fcl') + +# +# Extract flux and GDML used to make the GeomScan file +# +pset_geom_scan = pset['physics']['producers']['generator']['GeomScan'] + +geom_scan_flux_config = pset_geom_scan.split('flux')[1][0] +geom_scan_gdml_version = pset_geom_scan.split('gdml')[1][:6] + +print('Using GeomScan file:', pset_geom_scan) +print('\t -> using flux configuration:', geom_scan_flux_config) +print('\t -> using gdml version:', geom_scan_gdml_version) + + +# +# Extract flux and GDML set in services and GENIE +# +pset_gdml = pset['services']['Geometry']['GDML'] +pset_flux = pset['physics']['producers']['generator']['FluxSearchPaths'] + +flux_config = pset_flux.split('config')[1][0] +gdml_version = pset_gdml.split('sbnd_')[1][:6] + +print('Using:') +print('\t -> gdml version:', gdml_version) +print('\t -> flux configuration:', flux_config) + +# +# Check that the two are the same, if not, need to regenerate the GeomScan file +# +message = 'Please regenerate the GeomScan file. Instructions are in fcl file make_genie_geomscan_file_sbnd.fcl.' + +assert geom_scan_flux_config == flux_config, f"Have you updated/changed the flux files? {message}" + +assert geom_scan_gdml_version == gdml_version, f"Have you updated/changed the GDML file? {message}" + + diff --git a/ups/product_deps b/ups/product_deps index 1cb92bee6..fe5301e4c 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -256,7 +256,8 @@ product version qual flags sbncode v10_04_06_01 - cetmodules v3_24_01 - only_for_build sbnd_data v01_29_00 - optional -sbndutil v10_04_06_01 - optional +sbndutil v10_04_06_01 - optional +fhiclpy v4_03_05 - end_product_list #################################### @@ -311,11 +312,11 @@ end_product_list # case it is optional. # #################################### -qualifier sbncode sbndutil sbnd_data notes -c14:debug c14:debug c14:debug -nq- -c14:prof c14:prof c14:prof -nq- -e26:debug e26:debug e26:debug -nq- -e26:prof e26:prof e26:prof -nq- +qualifier sbncode sbndutil sbnd_data fhiclpy notes +c14:debug c14:debug c14:debug -nq- c14:debug +c14:prof c14:prof c14:prof -nq- c14:prof +e26:debug e26:debug e26:debug -nq- e26:debug +e26:prof e26:prof e26:prof -nq- e26:prof end_qualifier_list ####################################