From GlueXWiki
Revision as of 13:55, 7 April 2016 by Pmatt (Talk | contribs) (Instructions)

Jump to: navigation, search


  • Inherits from TSelector: Can be used with TTree::Process(), PROOF.

Improvements over TSelectors

Setting up the software & environment

1) Go to the directory where you want the source code to go. Checkout the software here:

svn co https://halldsvn.jlab.org/repos/trunk/home/pmatt/RootAnalysis/

2) Set the path to the checked-out RootAnalysis directory to be the variable:


3) After sourcing your standard GlueX environment file, set the following environment variables:


4) Build and install the DSelector library

make all

5) Build and install the MakeDSelector binary

make all

Creating a DSelector

1) Run the MakeDSelector program to make a DSelector for your TTree. Run it with no arguments for usage instructions.


2) Note that unlike typical TSelectors, DSelectors don't have hard-coded array sizes. This means that they don't need to be regenerated each time you get more data.

3) When customizing your DSelector be very careful to read ALL of the pre-generated comments. They are there for a reason.

4) Write code similar to the pre-generated code, and everything will work fine.

Using a DSelector

  • Example:
root -l -b my_tree_file.root

Using DSelector's with PROOF-Lite


  • PROOF is ROOT's solution for running over a TChain multi-threaded.
  • PROOF is for distributed computed, whereas PROOF-Lite is for running multi-threaded on your local machine.
    • Note that each thread has it's own copy of ROOT histograms, and then they are merged together at the end. So, watch your memory usage, because it multiplies.
  • The DSelector is automatically setup to work either with or without PROOF (or PROOF-Lite).


1) After each time the DSelector library is built, (re-)build the PROOF DSelector package:


2) Launch ROOT, and load the DSelector library:

  • Note: PROOF-Lite will launch a GUI, so run ROOT with -b if you don't want it. It's useful for viewing log files though.
root -l

3) Run PROOF-Lite:

DPROOFLiteManager::Process_Tree("my_tree_file.root", "my_tree_name", "my_selector.C+", "my_outfile.root", my_num_threads); //my_num_threads = unsigned int