[Halld-offline] ROOT TTree Output in SVN

Paul Mattione pmatt at jlab.org
Sat May 4 13:54:53 EDT 2013


I've checked the code for the standard ROOT TTree Output into SVN.  Also, the b1pi_hists plugin has been updated to produce the TTree output (and can be used as an example).  Documentation can be found at:

https://halldweb1.jlab.org/wiki/index.php/Analysis_TTreeFormat

/******************** BASIC USAGE ********************/

Basically, to enable TTree output for your DReaction, call (in your DReaction factory init()):

locReaction->Enable_TTreeOutput("tree_b1pi.root"); //string is output file name

Then to save the surviving particle combos for your event, call (in your plugin evnt()) (does nothing if no combos found / survived-cuts):

#include "ANALYSIS/DEventWriterROOT.h"
vector<const DEventWriterROOT*> locEventWriterROOTVector;
locEventLoop->Get(locEventWriterROOTVector); //creates the TTrees for all DReactions upon first call
locEventWriterROOTVector[0]->Fill_Trees(locEventLoop); //saves results (if any) for all output-enabled DReactions in this plugin

More detailed usage options can be found on the wiki.  

 - Paul





More information about the Halld-offline mailing list