Difference between revisions of "DSelector"

From GlueXWiki
Jump to: navigation, search
Line 42: Line 42:
 
root -l -b my_tree_file.root
 
root -l -b my_tree_file.root
 
.x $ROOT_ANALYSIS_HOME/Load_DSelector.C
 
.x $ROOT_ANALYSIS_HOME/Load_DSelector.C
my_tree->Process("my_selector.C+");
+
my_tree_name->Process("my_selector.C+");
 
.q
 
.q
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 54: Line 54:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
2) St
+
2) Launch ROOT, and load the DSelector library:
 
<syntaxhighlight>
 
<syntaxhighlight>
 +
root -l -b my_tree_file.root
 +
.x $ROOT_ANALYSIS_HOME/Load_DSelector.C
 +
</syntaxhighlight>
 +
 +
3) Run PROOF-Lite:
 +
 +
<syntaxhighlight>
 +
DPROOFLiteManager::Process_Tree("my_tree_file.root", "my_tree_name", "my_selector.C+", "my_outfile.root", my_num_threads); //my_num_threads = unsigned int
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 16:25, 5 April 2016

Overview

  • 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:

$ROOT_ANALYSIS_HOME

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

setenv OS_NAME $BMS_OSNAME
setenv LD_LIBRARY_PATH ${ROOT_ANALYSIS_HOME}/${OS_NAME}/lib/:$LD_LIBRARY_PATH
setenv PATH ${ROOT_ANALYSIS_HOME}/${OS_NAME}/bin/:$PATH

4) Build and install the DSelector library

cd $ROOT_ANALYSIS_HOME/DSelector
make all

5) Build and install the MakeDSelector binary

cd $ROOT_ANALYSIS_HOME/MakeDSelector
make all

Creating a DSelector

Using a DSelector

root -l -b my_tree_file.root
.x $ROOT_ANALYSIS_HOME/Load_DSelector.C
my_tree_name->Process("my_selector.C+");
.q

Using DSelector's with PROOF-Lite

1) After building the DSelector library, build the PROOF DSelector package:

cd $ROOT_ANALYSIS_HOME/MakePROOFPackage/
./build.sh

2) Launch ROOT, and load the DSelector library:

root -l -b my_tree_file.root
.x $ROOT_ANALYSIS_HOME/Load_DSelector.C

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