SBNCode Introduction 9 9 - PetrilloAtWork/sbncode GitHub Wiki
h1. SBNCode Introduction 9/9
h3. Setup
First, we are going to get the sbncode mrb product and build it:
# setup scripts for the three experiments
source /cvmfs/uboone.opensciencegrid.org/products/setup
source /cvmfs/sbnd.opensciencegrid.org/products/sbnd/setup
source /cvmfs/icarus.opensciencegrid.org/products/icarus/setup_icarus.sh
# setup your environment
source localProducts_larsoft_v08_30_01_e17_prof/setup
mrbsetenv
Next, we are going to build the sbnanalysis/ area. This area contains the sbnanalysis framework, which allows for writing SBN selections, with art root files as input and a standard ROOT file as output:
# first navigate to the correct directory
cd srcs/sbncode/sbnanalysis/
# setup the sbnanalysis build area
mkdir build
cd build
cmake ..
# make everything
# NOTE: if you have any dependencies of sbncode in your local mrb area,
# you will have to run “mrbslp” before running this command
make install
# setup the sbnanlysis environment -- required to do before running the “sbn” command
source bin/setup_sbnanalysis.sh
Now we are going to take a look at an example selection -- see the directory sbnalaysis/ana/ExampleAnalysis/. This directory contains code for an selection: ExampleSelection.cxx.
To run this module over a prepared MC file, run (from the ExampleAnalysis/ directory):
sbn -m ExampleAnalysis_ExampleSelection -c ExampleConfig.fcl /sbnd/app/users/gputnam/sbndcode/srcs/icaruscode/fcl/gen/test/overlay/g4/prodoverlay_corsika_proton_icarus_GenGenieCorsika-20190913T191010_20190913T194954-G4.root
The input file is an ART root MC file with genie (MCtruth) and G4 (MCParticle) information. This selection will produce output with the sbncode TTree and a custom histogram.