Fast MC Basics (last updated: 06 November 2015)¶
You will need a kerberos principal, a Fermilab services account, an lbne account, and to setup a grid certificate.
General FNAL info: https://cdcvs.fnal.gov/redmine/projects/ifront/wiki/Getting_Started
LBNE specific info: https://cdcvs.fnal.gov/redmine/projects/ifront/wiki/Getting_Started_on_GPCF
Kerberos setup: http://fermilinux.fnal.gov/documentation/security/kerberos-overview/
Please email Eileen Berman or Tom Junk with any issues.
More info on LBNE computing at FNAL in Eileen's talk from the March 2013 Collaboration meeting:
You will also need to be added to the project as a developer. Please email the list (dune-fastmc at fnal.gov) or Daniel Cherdack (daniel.cherdack AT colostate.edu).
Check the 'Overview' tab (first item in the above menu) first though, I may have already added you.
You can also join the Fast MC email list: (dune-fastmc at fnal.gov)
What is the Fast MC?¶
A summary of what we are trying to accomplish ... coming soon!
Quick summary of the processing structure.¶
Given flux file(s) run GENIE to produce standard GENIE output.
Take GENIE output and produce flat TTree fastmc output.
[Take fastmc output and produce specialized selection based on items in the TTree.]
Take fastmc output and produce GLOBES formatted input files.
Take GLOBES input files and run GLOBES to get spectra and likelihoods.
Interpret and report results.
Some physics needs will require restarting at the beginning, others can be studies using default processed files from an early stage and only rerunning the later stages.
Setting up the Fast MC software package (at FNAL):¶
- The Fast MC code is stored in a subversion repository. The trunk is for development and may not be stable. Use at your own risk. Tagged releases have been validated and are available for studies. There are currently no tagged releases (forecast is for first tag in Nov. 2015), so consider checking out trunk revision 303 or earlier until the current version is validated. The current stable-ish branch is v-genie-2100-rc1, but no guarantees on accuracy of results, or even that everything will run without crashing.
- Navigate to the directory where you would like to put you Fast MC package. The best location is in your directory on /lbne/app/users:
$ cd directory
- Use SVN to checkout the whole repository:
$ svn checkout svn+ssh://email@example.com/cvs/projects/fast_mc/
Alternatively you can just checkout the trunk, branch or tag you want to use and manage parallel installations manually using:
$ svn checkout svn+ssh://firstname.lastname@example.org/cvs/projects/fast_mc/<branches or tags>/<branch or tag name> ./
or for the trunk,
$ svn checkout [-r revision] svn+ssh://email@example.com/cvs/projects/fast_mc/trunk ./
The dot-slash at the end of it checks the contents out to the current directory.
Anonymous checkout can be used if you are not on the "Fast MC redmine project", but would still like to checkout and use the code. You will not be able to commit.
$ svn co http://cdcvs.fnal.gov/subversion/fast_mc
- A file named fast_mc will appear in your directory. The trunk/ folder will contain the development version of the code, while branch and tags will contain branched and tagged release (currently empty). Move into the trunk directory:
$ cd fast_mc/trunk/
- If you are trying to use the FastMC somewhere other than Fermilab, read FastMC at your institution before doing the next step
- Use the setup script to setup you environment:
$ source setup_FastMC.shThis will setup the correct ROOT and GENIE versions, along with their required software. Warning: make sure you run the setup script from a new terminal, and do not switch between software projects. The env var $FMC_INPUTS points to a folder that contains all of the GENIE files that are used as inputs for the Fast MC. Please feel free to add files to this directory, but try to follow the naming conventions used. The env var $FMC_OUTPUTS points to a dir to store the output of your runs. A directory is automatically created in this folder for each user, so you can use whatever output filenames you like, and we can all easily find each others runs. The bin/ dir will also be added to your PATH so that the executable(s) generated by the package will be available.
- Build the Fast MC package with:
- Run the Fast MC (more details here Generating Fast MC Files):
$ gntpc_FastMC -i $FMC_INPUTS/<folder_name>/<input_file.root> -o $FMC_OUTPUTS/<output_file.root> -c LAr_1 -r Default > $FMC_LOGS/<log_file.txt>where:
- <folder_name> is the name of a directory in $FMC_INPUTS that holds the GENIE files you would like to work with. In general you will likely use the "nominal" directory that contains the nominal beam flux.
- <input_file.root> is a GENIE file found in the folder $FMC_INPUTS/<folder_name>,
- <output_file.root> is the name you give to the output Fast MC file and,
- LAr_1 is a detector response configuration contained in the file config/FastMC_DetParams.xml.
- Default is the default run configuration setup in the config/FastMC_RunParams.xml, which flux files used, sets the systematics calculated, and several other options
- Other input options include:
- '-n <n_entries>' which specifies the number of entries from the input GENIE file you would like to use; default is 'all events',
- '-b <entry>' to specify the entry you would like to begin with; default is '0',
- '-x' Skip all reweights
you would like to use; default is 'Default' which is all available systematics.
- This works well for testing and generating files for very specific small studies. In general you will want to use the submission scripts to generate large samples for each beam (FHC/RHC) and each neutrino species (numu, nue, appearance nue, numubar, etc). This procedure is discussed here: Generating Fast MC Files
- Using the Fast MC output to generate energy spectra plots is outlined here: Generating Energy Spectra Plots
- Using the Output to Generate GLOBES input files is described here: Working with GLoBES
- More to follow on what to do with the you Fast MC files ... hopefully, some of it by you :^)
- If you would like to setup the software on you local machine you will have to setup ROOT and GENIE first, edit the setup script, and setup the required directory structure implied by the environmental variables.
The Fast MC Directory Structure¶
When you setup the Fast MC using the source setup_FastMC.sh it will setup several env vars to help you navigate the Fast MC files. The first time you run is it will also make several personal directories within the file structure. Why? Because the full physics analysis chain is a multi-step process each with input and output files. It is quite useful to are standardize the locations so the software knows where to find input files and where to write output files. In this framework Users don't have to deconstruct or modify scripting to do simple variations of the default processing, they can just use the standardized env vars. It also helps the developers maintain scripts that push processing to the grid.
There are three main areas in the Fast MC directory structure. The first is the repository files which should be setup in your personal directory in /lbne/app/users/ (contact Tom Junk if you do not have an area in /lbne/app/users/). This area contains files that you download from the repository, and files that you generate that you would like to commit. The most important file is gNtpConv_FastMC.cxx, which is the code used to generate Fast MC files from GENIE files. There is also a Makefile which compiles gNtpConv_FastMC.cxx and creates the gntpc_FastMC executable and saves it to the bin/ folder. There is also the config/ folder that stores all that external data files used by the Fast MC, and the XML configuration files read in by gntpc_FastMC and other scripts at runtime. These are also used to setup the detector configuration, and determine which systematic weights will be included.
Lastly there is a $FMC_HOME/scripts/ directory. This contains folders that hold scripts used to generate and utilize Fast MC files and their various inputs and outputs. These include $FMC_GENIE, $FMC_GENENGSPEC, and $FMC_GLBS, which house scripts to submit GENIE and Fast MC jobs to the grid, generate energy spectra, and generate and use GLoBES inputs from the Fast MC. Most of these scripts are discussed in other sections. Each user will also have a personal directory inside the scripts folder ($FMC_SCRIPTS=$FMC_HOME/scripts/$USER). This should be used to house any scripts that you develop to work with the Fast MC. Once you are happy with them, please add them to the repository, so the rest of us can use them. If you create a script that you think is of general use to everyone else, feel free to move it to one of the other directories inside $FMC_HOME/scripts/, or create a new directory inside $FMC_HOME/scripts/ if an appropriate location does not already exist. Conversely, if you would like to customize one of the scripts in the public areas, please copy it to your personal scripts directory.
The second area is /lbne/app/users/lblpwg_tools/. This is where all the external software resides. The code bases are in $SOFTWARE and the include files, compiled executables, and libraries are located in $INSTALLATION. This includes our own versions of ROOT, GENIE, and GLoBES.
The third area, /lbne/data/users/lblpwg_tools/FastMC_Data/, is for storage of data files. There are directories for Fast MC input, like flux_files/ ($FMC_FLUX_FILES) for flux files, data/ ($FMC_INPUTS) for GENIE files, personal directories for outputs ($FMC_OUTPUTS), and logs ($FMC_LOGS). In general the inputs are all shared, and so there are no personal directories in them. The outputs and logs like the scripts/ dir, have personal sub directories for you to store your own personal sets of Fast MC files, GLoBES inputs, and log files. The setup script should automatically setup these directories, and the env vars to point to them. It is often necessary for a user to want to segregate output in a non-default location, maybe to support multiple variations of processing, the input and output for Fast MC files can be set in the run configuration (more details on that here: Fast MC Run Configurations)
A ~/public_html directory can to setup to create a web accessible directory. Thus, your home directory is also used by some scripts to make various .root and .png files easily accessible on the web. These are scripts used to generate energy spectra, and GLoBES inputs. The files that are put in your ~/public_html directory can be accessed here:
You cannot access any folders or files in your ~/public_html directory without linking to them in index.html file. This should be automatically generated for you by the scripts that place files there.
Fast MC ntuple contents:¶
The Fast MC is based off the GENIE gst flat tree structure. The files contain all of the variable included in the standard gst format, along with "reconstructed" versions of many variables and other information you might expect to come out of a reconstruction. A full description of the ntuple contents can be found in the comments in the code, and eventually here: Fast MC ntuples
Physics and Detector Inputs and Assumptions
Generating Fast MC Files
Fast MC Run Configurations and Toggling Systematics
Fast MC ntuples
Flux File Documentation
Working with ND Fast MC
Nominal Flux Normalizations
Generating Energy Spectra Plots
Working with GLoBES
Checking the energy unbiasing factor
To-do task list for improvements