Skip to content

System Wide Root Output Framework

Thomas King edited this page Jul 8, 2020 · 4 revisions

Introduction

This page will, hopefully, show the User how to utilize the System Wide Root Output Framework, that was introduced in the beginning of 2019. If anything is unclear or if you spot an error please do not hesitate to let us know.

Sections

  1. ROOT File Structure
  2. ROOT File Creation
  3. Accessing the ROOT TTree
  4. Adding to the ROOT output
  5. Supported Processors

ROOT File Structure

TNamed Header

We have several TNamed in the ROOT file. For lack of a better term we refer to these as the "header".

TNamed Key Processor Source Description
config None The config XML that was used during scanning
outputFile None The basename set during scanning
createTime None The rootFile creation date and time
RootVersion None The version of ROOT used to create the file
outputRootFile None The full ROOT output file name
facilityType GammaScintProcessor or GammaScintFragProcessor The facility type passed to the GammaScintProcessor / GammaScintFragProcessor
bunchingTime(sec) GammaScintProcessor or GammaScintFragProcessor The bunching time in seconds. Only used in "frag" facilities
VDType PspmtProcessor The voltage divider type passed to the PSPMT Processor
SoftThresh PspmtProcessor The software threshold for the PSPMT implantation detector

PixTreeEvent TTree

The structure of the ROOT TTree is centered around keeping the Pixie Events built by PAASS intact. The way we accomplish this is by only filling the TTree once after the Process() method is called by the DetectorDriver. Each processor should have its own structure in the PaassRootStruc.hpp. Exceptions can be made for processors that are not used very often (LiquidScintProcessor) or do the same analysis (CloverProcessor and CloverFragProcessor). The PixTreeEvent class has a std::vector of each structure which is where we send the data after it is processed. Its these vectors that make Draw()(See Accessing the ROOT TTree->ROOT Prompt) act up when accessing multiple vectors.

NOTE: These ROOT dictionaries are version specific, and ROOT will complain if there is a mismatch when you try to read it. While it might work, there is no guarantee that the TTree is being read correctly. To help with this problem, we include a TNamed outside of the TTree that contains the ROOT version used to generate the TTree. This TNamed should be readable with/without the dictionary.

ROOT File Creation

Shell

The Pixie TTree structure is more complex then what ROOT can handle without some help. During the compilation of utkscan or utkscanor, we generate a ROOT dictionary and a library. For the scan to work properly with the ROOT output, the libPaassRootStruct.so (the named was changed on 10/23/2019. The old name was libSysRootstrucLib.so) must be in your LD_LIBRARY_PATH. Also the PaassRootStruc.hpp must be in your CPLUS_INCLUDE_PATH. By FAR the easiest way to do this is to load the pixieSuite environment module that is installed after compilation. Instructions on how to do this are on this page.

Utkscan(or)

You must enable the SysRoot option in your xml. This will cause the scan to generate a root file containing the PixTree. This file will be named OutputFileName_DD.root where OutputFileName is what is passed to scan as the output name (i.e the -o flag for utkscan or the first argument for utkscanor).

Accessing ROOT TTree

Shell

You must set up your shell as above. ROOT needs the libPaassRootStruct.so as well as the PaassRootStruc.hpp to be able to access the TTree. ROOT needs the library to be loaded before it tries to open the file with TTree. An easy way to do this is to just add gSystem->Load("libPaassRootStruct.so") to your ${HOME}/.rootlogon.C. Additionally, if you plan to utilize TProof (either yourself or via a TSelector) you need to add Proof.Logon $(HOME)/.rootlogon.C to your ${HOME}/.rootrc

ROOT Prompt

Due to the structure of the PixTreeEvent TTree:Draw() is a little dangerous to use. While plotting inside of one of the vectors is okay as soon as you try to cross vectors the output of Draw becomes incomplete/wrong. Draw("vandle_vec_.tof:vandle_vec_.qdc") is okay, while Draw("vandle_vec_.tof:clover_vec_.energy") is not. As such it is ALWAYS recommended to use the TTreeReader and TH*::Fill() to access and plot the data; we also encourage the use of the TSelector for more complex analysis over a larger data set. This is due to the ease of using a TSelector with TProof. We will leave that how-to to the guys over at CERN (Developing a TSelector, Accessing a TTree with a TSelector)

Adding to the ROOT output

All of the ROOT output is controlled by the DetectorDriver via the PixieTreeEvent class. When adding a new processor to the framework, remember to complete the following.

  1. The User must add the new struc to the PaassRootStruc.hpp as well as add the new struc to the vector list and the Reset() method.
  2. In the appropriate processor:
    • Declare and fill the new structure as needed
    • emplace_back() the structure onto the new PixieTreeEvent vector.
    • Reset the processor's structure to the <StructName>_DEFAULT_STRUCT that is declared in the PaassRootStruc.hpp before the end of the ChanEvt loop.
  3. The User MUST add the new struc and vector to the PaassRootLinkDef.hpp.

The RootDevProcessor does all of this and is recommended as a simple example.

Supported Processors

This is a list of processors that currently support the system wide ROOT output framework.

  • CloverProcessor
  • CloverFragProcessor
  • DoubleBetaProcessor
  • GammaScintProcessor
  • GammaScintFragProcessor
  • GeProcessor (via the CLOVERS struct)
  • LiquidScintProcessor (via the VANDLES struct)
  • LogicProcessor
  • PspmtProcessor
  • RootDevProcessor
  • SingleBetaProcessor
  • VandleProcessor

Clone this wiki locally