Simple CAF Skeleton for use in SBND CAF files
- Get a functional install of ROOT on your machine (installing a precompiled binary is fine)
- Clone https://github.com/SBNSoftware/sbnanaobj to some folder
- Clone https://github.com/Jjm321814/CAFMacroSkeleton to a different folder
- Navigate to sbnanaobj/sbnanaobj/StandardRecord
- run
mkdir MyCMake - Move the CMakeLists.txt file (from CAFMacroSkelton) to this new
MyCMakedirectory - In directory
MyCMakemake a new directory calledBuild - Edit the hardcoded paths in CMakeLists.txt. Note an easy way to get the copy-paste options is to go to the StandardRecord directory and run
find $PWD -name "*.h"orfind $PWD -name "*.cxx" - Navigate to MyCMake/Build
- run
cmake .. - run
makeThis will compile a shared library file named libsbnanaobj_StandardRecord.so, which we will import later in our ROOT macros - Back in CAFMacroSkeleton edit the path in rootlogon.C to point to your new Build directories
- Grab a root CAF file from a gpvm, and place it in the CAFMacroSkeleton folder. I have some stored at
/exp/sbnd/app/users/jmclaugh/sbndcode_v10_14_02/CAFOut(one data and one mc file). I won't keep those forever but it can work for now. - Launch a root terminal
- Run
.L /home/jacob/WorkSoftware/SBND/AddBlipToCAF/sbnanaobj/sbnanaobj/StandardRecord/MyCMake/Build/libsbnanaobj_StandardRecord.sowith the updated to your machine - Run
.x LoadInCAFVariables.cxx(<YourCAF>)The LoadInCAFVariables has a close to minimum set of includes and shows how to easily write functions to access specific parts of the run record. The best place to see whats in the standard record would be the file in sbnanaobj or a tbrowser open on the CAF file.
To write a root macro of your own, place it in a folder with a similar rootlogon.C file, and run it according to the last two steps in the above numbered instructions. That should generally work. These instructions also work with ACLiC, but there may be some complications with importing that elsewhere.