[Halld-offline] ROOT TTree Output in SVN
Paul Mattione
pmatt at jlab.org
Sun May 5 11:57:32 EDT 2013
I just checked in a change to the interface for writing out the TTrees to make it safer when running with multiple plugins. It's now:
locEventWriterROOTVector[0]->Fill_Trees(locEventLoop, "b1pi_hists");
where the string is the factory tag of the DReaction factory in your plugin. This way multiple, simultaneously-running plugins won't each save all of the results, which would have caused the trees to have duplicate entries.
- Paul
On May 4, 2013, at 1:54 PM, Paul Mattione wrote:
> 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
>
>
> _______________________________________________
> Halld-offline mailing list
> Halld-offline at jlab.org
> https://mailman.jlab.org/mailman/listinfo/halld-offline
More information about the Halld-offline
mailing list