Setup the software trigger module - twongjirad/LArLiteSoftCookBook GitHub Wiki
Quick Note
There are two pieces of code to setup. The first is the software trigger algorithm, which exists in its own repository. (It will eventually become a UPS product.) The second is the larsoft modules which can call this code. These live in [larsoft]/srcs/uboonecode/Calibration/Optical.
First
Before doing anything, setup a uboonecode environment. This is optional, but recommended. It helps to get you the right versions of CMake and gcc.
Clone and build the (external) software trigger repo
At some working directory of your choosing
git clone https://github.com/twongjirad/fememulator.git
source configure_gpvm.sh (if you DID NOT setup a uboonecode environment)
source configure.sh (if you DID setup a uboonecode env. *RECOMMENDED*)
mkdir build
cd build
cmake ../CMakeList.txt
make
If things went well you'll find libSWTriggerBase.so and libFEMTrigger.so in build/lib
You might see the following problems:
- something about how stdc++11 is not a valid flag: sometimes, for whatever reason cmake will find the old gcc version on the gpvm (in /usr/bin/gcc). This is gcc 4.4. Look at the output of CMake closely to see which c++ and c compiler it identified. If this happens, one hacky solution is to go into the CMakeCache.txt and set the compilers.
set
CMAKE_C_COMPILER:FILEPATH=gcc
and
CMAKE_CXX_COMPILER:FILEPATH=g++
Once you make this change run (from the build directory)
cmake ../CMakeCache.txt
If all is well type the following to build:
make
Get the software trigger analyzer from the right branch
Note, at some point this needs to go into develop. The question of how to deal with the dependency software trigger repo has to be figured out first.
I know this works with uboonecode version: v04_26_04_05. The fastest thing is to setup an environment with this version. Setup a uboonecode environment. Then checkout the specific tagged version.
Now, bring in just the files we need. In srcs/uboone/uboonecode
cd Calibration/Optical
git checkout origin/feature/tmw_swtrigger_analyzer FEMemulator_module.cc
git checkout origin/feature/tmw_swtrigger_analyzer CMakeList.txt
git checkout origin/feature/tmw_swtrigger_analyzer fcl/run_fememulator_fromraw.fcl
git checkout origin/feature/tmw_swtrigger_analyzer fcl/run_fememulator_fromswizzled.fcl
Hmm. I am having trouble pushing these items into this branch. For now, copy the above files from:
/uboone/app/users/tmw/projects/swtrigger/larsoft/srcs/uboonecode/uboone/Calibrations/Optical
OK. now you need to modify the CMakeList.txt file so that it knows how to build and link against the software trigger repo. Open CMakeList.txt and edit the lines
set( SWTRIGGER_LIBDIRECTORY /uboone/app/users/tmw/fememulator/build/lib )
set( SWTRIGGER_INCDIRECTORY /uboone/app/users/tmw/fememulator )
Note those paths is where my copy lives.
Start the build
mrb i
Get coffee. I hope it works.
What should I run?
I usually analyze right from the binary. Look in the fcl folder and try:
lar -c fcl/run_fememulator_fromraw.fcl -s <some ubdaq file>
You can also run from a swizzled file
lar -c fcl/run_fememulator_fromswizzled.fcl
Look at this if you want to try and find a recent binary file.
Or if you want EXT unbiased events use
ub_project.stage=mergeext_unbiased
in your sam query to get swizzled unbiased, EXT events.
Prepping your build to run on the Grid
Because the software trigger code is not yet a UPS repository, one must perform an additional step in order to get your build to run on the grid.
You have to copy the libraries of the software trigger, found in [software trig dir]/build/lib into the localProducts folder.
cp $SWTRIGDIR/build/lib/* $MRB_INSTALL/uboonecode/v04_26_04_05/slf6.x86_64.e7.prof/lib
Note that your version of uboonecode might be different of course.
Finally, make sure to tar it up before sending out to the grid:
make_tar_uboone.sh larsoft.tar