Installation - MinervaExpt/MINERvA-101-Cross-Section GitHub Wiki
Installing the MINERvA 101 Tutorial on a MINERvA GPVM
Start by connecting to a MINERvA GPVM through ssh, and try to ensure you have a clean environment. If you've previously done work on MINERvA or a different FNAL experiment, you may have to look at the .profile or .bashrc in your home are to ensure you don't have any lingering set up scripts from a different experiment.
- Prerequisites: setup ROOT and other dependencies with spack
source /cvmfs/larsoft.opensciencegrid.org/spack-v0.22.0-fermi/setup-env.sh
spack load [email protected] arch=linux-almalinux9-x86_64_v3
spack load gcc
spack load [email protected]%[email protected] arch=linux-almalinux9-x86_64_v3
export LD_LIBRARY_PATH=${ROOTSYS}/lib/root:${LD_LIBRARY_PATH} #Necessary as spack doesn't automatically set this
- Create a directory for the MAT & MINERvA101 tutorial. The MAT and other MINERvA packages which are dependencies for the tutorial will be cloned via the bootstrap build discussed below in step 4.
cd /exp/minerva/app/users/$USER/
mkdir MINERvA101_2025 && cd MINERvA101_2025
git clone https://github.com/MinervaExpt/MINERvA-101-Cross-Section.git
- Create build directory and properly unpack the parameter files (acquired through Flux File Section Below) into this directory before building.
mkdir opt && cd opt
mkdir build
mkdir etc && cd etc
tar -zxvf <Path to parameter file tarball>
Note: If you wanted to build multiple versions of the code against a fixed location for the parameter files, that can be done by changing the symlink made in MINERvA-101-Cross-Section/bootstrap/CMakeLists.txt
- Run the CMake command for the bootstrap build to get the MINERvA code packages through git, and configure the build. Then build everything with one command!
cd ../build
cmake ../../MINERvA-101-Cross-Section/bootstrap -DCMAKE_INSTALL_PREFIX=`pwd`/.. -DCMAKE_BUILD_TYPE=Release
make install
WARNING for Developers of MINERvA code (MAT/MAT-MINERvA/etc.): The bootstrap build includes these as external projects on a specific branch. To develop on a different branch, as is recommended, the change needs to be in the MINERvA-101-Cross-Section/bootstrap/CMakeLists.txt. The CMake and make commands need to be run to ensure that the builder knows that the local version is on the new branch. The branch may need to exist in the remote repository before the new CMake and make commands are run, as I believe it grabs the remote branch if the local has changed branches. This is untested.
- Finally, set up the newly built tutorial
source /exp/minerva/app/users/$USER/MINERvA101_2025/opt/bin/setup.sh
If everything built successfully and you were able to source the setup script, you should be able to just run:
runEventLoop
Without any arguments, you will get a help message about the different data and MC playlists you can use as input, confirming that the tutorial was set up correctly.
Installing the MINERvA 101 Tutorial on a general system
The process is almost exactly the same, with the exception of how the prerequisites are set up. Locations like /exp/minerva/app/users/$USER are to be replaced by $APP as stated in the "Prerequisites" tab. In particular, you need a working root installation that has been properly set up, for which you can find instructions at https://root.cern/install/. This tutorial has been tested specifically for root version 6.28.12, but should work for other similar versions as well.
The other major dependency is CMake, a powerful software build system and compiler. The easiest way to get this on a Linux system is through a package manager, but it can also be downloaded and installed directly at https://cmake.org/download/. The minimum required CMake version for this tutorial is 3.10, but it has been tested up to CMake 4 which was released in 2025.
Assuming these prerequisites are in place, you can follow the steps in the section above starting from Step 2, with your own paths to wherever you would like to install the tutorial.
Access to Flux, Reweight, and Parameter Files in The Open Data Product
These files were tracked internally in MINERvA by CVS and have remain largely stable for quite some time. The instructions in various places reference an ability to access these files through CVS or CVMFS. As part of the open data product, we provide them similarly to the data as described at minerva.fnal.gov/getdata with an ability to get them in the directory OpenData. To download the latest with XRootD, run the following command:
xrdcp root://fndca1.fnal.gov:1095/pnfs/fnal.gov/usr/minerva/persistent/OpenData/FluxAndReweightFiles/FluxAndReweightFiles_Tarred_Feb_20_2026_1145_FNALTime.tgz <copyDestination>
Check back occasionally for the latest version. The files are unlikely to change often, but we will do our best to track changes to the product on minerva.fnal.gov/opendata.
Usage
#Run an example job over XRootD on a MINERvA GPVM. All that changes are the paths, and the setup script for ROOT should be a `thisroot.sh` as discussed previously.
#These list of files are large and take awhile to run over XRootD. Exercise-A will utilize the shortened the input lists for testing, as well as discuss utilizing a local version of the input data which runs much faster and is strongly recommended where possible.
~/app/MINERvA101/opt/build$ cd ~/Documents/MINERvA101
~/Documents/MINERvA101$ source ~/app/MINERvA101/opt/bin/setupROOT6OnGPVMs.sh
~/Documents/MINERvA101$ source ~/app/MINERvA101/opt/bin/setup.sh
~/app/installExampleMINERvA101/test$ runEventLoop ~/app/installExampleMINERvA101/opt/etc/playlists/MAD_minervame1A_DATA_xrd.txt ~/app/installExampleMINERvA101/opt/etc/playlists/MAD_minervame1A_MC_xrd.txt
Dependencies (3-7 are described/built above)
- git: version control system. You probably already have this
- CMake 3.10: build system generator for lots of operating systems. You probably already have this
- ROOT 6: object-oriented toolkit for high energy physics analysis. Make sure to enable at least xrootd, kerberos, and Minuit for this tutorial. Already installed on MINERvA GPVMs
- MINERvA Analysis Toolkit (MAT): the MINERvA Analysis Toolkit and associated systematics tools
- MINERvA-specific tools (MAT-MINERvA): MINERvA-specific tools using the MAT
- UnfoldUtils: MINERvA's fork of RooUnfold with a compatibility layer for embedding systematics in histograms and MINERvA-specific systematics tweaks
- MParamFiles and MATFluxAndReweightFiles: additional reweighting, flux, and calibration parameters for MINERvA systematics.
- GENIEXSecExtract: "Secret" package in the MINERvA CVS repository used for the closure test.
FAQs
- How do I set up ROOT on the Fermilab-hosted MINERvA GPVMs? Is the ROOT version that comes with the Gaudi framework new enough? We're going to use a newer ROOT version than what the Gaudi framework uses. Set up ROOT (and CMake) on the GPVMs like this:
source /cvmfs/larsoft.opensciencegrid.org/spack-v0.22.0-fermi/setup-env.sh
spack load [email protected] arch=linux-almalinux9-x86_64_v3
spack load [email protected]%[email protected] arch=linux-almalinux9-x86_64_v3
- What directory should I put the tutorial code in? Should I run the tutorial code from the same directory? I recommend you put the tutorial code in a different directory from the one where you run it. This way, git won't try to commit your tutorial results if you catch a bug in the tutorial, and you'll be much less likely to erase your code changes by mistake if you start an exercise from scratch.
- On my personal computer, I put code in
~/app/installExampleMINERvA101and run the tutorial in~/Documents/MINERvA101_2021 - On the GPVMs, I put code in
/exp/minerva/app/users/$USER/installExampleMINERvA101and run the tutorial in/exp/minerva/data/users/$USER/MINERvA101_2021
- I got a message about Reflex missing from ROOT. Is my build OK? The following message is normal after installing each package. Reflex is a part of ROOT 5 that has been replaced in ROOT 6. This tutorial uses ROOT 6, so it doesn't need Reflex anymore.
#CMake Warning at /home/aolivier/app/root/opt/cmake/ROOTConfig.cmake:155 (message):
# ROOT component Reflex not found
#Call Stack (most recent call first):
# CMakeLists.txt:21 (find_package)
#
#
#CMake Warning at /home/aolivier/app/root/opt/cmake/ROOTConfig.cmake:155 (message):
# ROOT component Cintex not found
#Call Stack (most recent call first):
# CMakeLists.txt:21 (find_package)
#
#
#Hmm, ROOT failed to set up genreflex for some weird reason. I'll go off and try to find it myself...
#I don't need Cintex on this platform, so skipping it...