Difference between revisions of "FSRoot"

From GlueXWiki
Jump to: navigation, search
 
(12 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
There are two steps:
+
==There are two steps:==
  
  
(1) Use FlattenForFSRoot ([https://github.com/JeffersonLab/hd_utilities/tree/master/FlattenForFSRoot/flatten.cc hd_utilities/FlattenForFSRoot/flatten]) to generate flat trees from the standard analysis trees.   
+
1Use FlattenForFSRoot ([https://github.com/JeffersonLab/hd_utilities/tree/master/FlattenForFSRoot hd_utilities/FlattenForFSRoot]) to generate flat trees from the standard analysis trees.   
  
>  flatten -i [input analysis file name] -o [output FSRoot file name]
+
  >  flatten -in [input file with analysis tree] -out [output file with flat tree]
  
Run flatten with no flags to see further run options.   This should work for data, reconstructed MC, and thrown MC.   
+
* Run flatten with no flags to see further run options.
 +
* This should work for data, reconstructed MC, and thrown MC.   
 +
* See [https://github.com/JeffersonLab/hd_utilities/blob/master/FlattenForFSRoot/Documentation/GlueXFSRootFormat.pdf FlattenForFSRoot/Documentation/GlueXFSRootFormat.pdf] for more information.
  
See [https://github.com/JeffersonLab/hd_utilities/tree/master/FlattenForFSRoot/Documentation the FlattenForFSRoot/Documentation directory] for more information.
 
  
  
(2) Use FSRoot (available at [https://github.com/remitche66/FSRoot https://github.com/remitche66/FSRoot]) to make histograms from the flat trees.   
+
2Use FSRoot (available at [https://github.com/remitche66/FSRoot https://github.com/remitche66/FSRoot]) to make histograms from the flat trees.   
  
See the [https://github.com/remitche66/FSRoot/tree/master/Documentation FSRoot/Documentation] directory for documentation.
+
* See [https://github.com/remitche66/FSRoot/blob/master/Documentation/FSRoot.pdf FSRoot/Documentation/FSRoot.pdf] for documentation.
 +
 
 +
== Here is a working example: ==
 +
 
 +
1. Flatten an analysis tree:
 +
 
 +
  > flatten -in /u/home/remitche/FSRootExample/analysis.root -out flat.root
 +
 
 +
* where analysis.root was created by running /u/home/remitche/FSRootExample/MC.run
 +
* which generates MC based on the config file /u/home/remitche/FSRootExample/MC.config
 +
* which simulates the process gamma p --> eta' p --> eta pi+ pi- p --> (pi+ pi- pi0) pi+ pi- p using genr8 with the input file  /u/home/remitche/FSRootExample/MC.genr8
 +
 
 +
2a. Make a plot of the eta' mass using a cut on the chi^2/dof:
 +
 
 +
  root>  FSHistogram::getTH1F("flat.root","ntFSGlueX_100_221","MASS(2,3,4,5,6)","(80,0.8,1.2)","Chi2DOF<10.0")->Draw()
 +
 
 +
* where particles 2-6 are the five pions from the eta' decay
 +
 
 +
2b.  Skim the tree to a new file using a cut on the chi^2/dof:
 +
 
 +
  root>  FSTree::skimTree("flat.root","ntFSGlueX_100_221","flat.skim.root","Chi2DOF<10.0")

Latest revision as of 15:02, 25 February 2022

FSRoot is an alternative to DSelectors that uses flat trees.


There are two steps:

1. Use FlattenForFSRoot (hd_utilities/FlattenForFSRoot) to generate flat trees from the standard analysis trees.

 >  flatten -in [input file with analysis tree] -out [output file with flat tree]


2. Use FSRoot (available at https://github.com/remitche66/FSRoot) to make histograms from the flat trees.

Here is a working example:

1. Flatten an analysis tree:

 > flatten -in /u/home/remitche/FSRootExample/analysis.root -out flat.root
  • where analysis.root was created by running /u/home/remitche/FSRootExample/MC.run
  • which generates MC based on the config file /u/home/remitche/FSRootExample/MC.config
  • which simulates the process gamma p --> eta' p --> eta pi+ pi- p --> (pi+ pi- pi0) pi+ pi- p using genr8 with the input file /u/home/remitche/FSRootExample/MC.genr8

2a. Make a plot of the eta' mass using a cut on the chi^2/dof:

 root>  FSHistogram::getTH1F("flat.root","ntFSGlueX_100_221","MASS(2,3,4,5,6)","(80,0.8,1.2)","Chi2DOF<10.0")->Draw()
  • where particles 2-6 are the five pions from the eta' decay

2b. Skim the tree to a new file using a cut on the chi^2/dof:

 root>  FSTree::skimTree("flat.root","ntFSGlueX_100_221","flat.skim.root","Chi2DOF<10.0")