AliRoot Core  edcc906 (edcc906)
AliTreeFormulaF Class Reference

Helper class for AliTreePlayer - formatted string to query tree

Example usage

Example: Construct directory path

More...

#include <AliTreePlayer.h>

Inheritance diagram for AliTreeFormulaF:

Public Member Functions

 AliTreeFormulaF ()
 Default constructor. More...
 
 ~AliTreeFormulaF ()
 
 AliTreeFormulaF (const char *name, const char *formula, TTree *tree, Int_t debug=0)
 
virtual Int_t Compile (const char *expression="")
 
virtual char * PrintValue (Int_t mode=0) const
 
virtual char * PrintValue (Int_t mode, Int_t instance, const char *decform="9.9") const
 
virtual void UpdateFormulaLeaves ()
 
virtual Int_t GetNdata ()
 

Public Attributes

TObjArrayfTextArray
 
TObjArrayfFormatArray
 array of text inputs More...
 
TObjArrayfFormulaArray
 array of format strings to draw More...
 
TString fValue
 array of TFormulas More...
 
Int_t fDebug
 current cache value of the formula More...
 

Detailed Description

Helper class for AliTreePlayer - formatted string to query tree

Example usage

Example: Construct directory path

AliExternalInfo info;TTree * tree = info.GetTree("QA.TPC","LHC15o","pass1");
formula = new AliTreeFormulaF("xxx","xxx/%d{year}/%d{period.GetName()}/%d{pass.GetName()}/%d{run}/xxx",tree);
tree->GetEntry(0);
formula->PrintValue(0,0,"")
Output: "xxx/2015/LHC15o/pass1/245683/xxx"

#### Example: Construct directory path

AliExternalInfo info;TTree * tree = info.GetTree("QA.TPC","LHC15o","pass1");
formula = new AliTreeFormulaF("xxx","<a href=\"https://alice-logbook.cern.ch/logbook/date_online.php?p_cont=rund&p_run=%d{run}\"\a>",tree);
tree->GetEntry(0);
formula->PrintValue(0,0,"")
Output: "<a href=\"https://alice-logbook.cern.ch/logbook/date_online.php?p_cont=rund&p_run=245683\"a>"

Example: Variable formatting

  • Internally root formatting are used for the individual data variables. This formatting is different than standard printf formatting
  • TODO - Implement own formatting also for variables -
    formula = new AliTreeFormulaF("xxx","<a href=\"https://alice-logbook.cern.ch/logbook/date_online.php?p_cont=rund&p_run=%2.1f{run}\"\a>",tree);
    Ouptut: "<a href=\"https://alice-logbook.cern.ch/logbook/date_online.php?p_cont=rund&p_run=245683.0\"a>"
    formula = new AliTreeFormulaF("xxx","<a href=\"https://alice-logbook.cern.ch/logbook/date_online.php?p_cont=rund&p_run=%0.5f{run}\"\a>",tree);
    Output: "<a href=\"https://alice-logbook.cern.ch/logbook/date_online.php?p_cont=rund&p_run=245683.00000\"a>"
    Author
    Marian Ivanov

Definition at line 74 of file AliTreePlayer.h.

Constructor & Destructor Documentation

AliTreeFormulaF::AliTreeFormulaF ( )

Default constructor.

Definition at line 46 of file AliTreePlayer.cxx.

AliTreeFormulaF::~AliTreeFormulaF ( )

TODO - check if not memory leak

Definition at line 63 of file AliTreePlayer.cxx.

AliTreeFormulaF::AliTreeFormulaF ( const char *  name,
const char *  formula,
TTree *  tree,
Int_t  debug = 0 
)
Parameters
name
formula
tree

Definition at line 53 of file AliTreePlayer.cxx.

Member Function Documentation

Int_t AliTreeFormulaF::Compile ( const char *  expression = "")
virtual

Compile Formatted expression

Parameters
expression
Returns
TODO - Error handling - invalidate expression in case of the compilation error

TODO - add AliDebug

Definition at line 74 of file AliTreePlayer.cxx.

Referenced by AliTreeFormulaF().

virtual Int_t AliTreeFormulaF::GetNdata ( )
inlinevirtual

Definition at line 83 of file AliTreePlayer.h.

char * AliTreeFormulaF::PrintValue ( Int_t  mode = 0) const
virtual
Parameters
mode
Returns

Definition at line 117 of file AliTreePlayer.cxx.

char * AliTreeFormulaF::PrintValue ( Int_t  mode,
Int_t  instance,
const char *  decform = "9.9" 
) const
virtual

Overwrite TTreeFormula PrintValue

Parameters
mode
instance
decform
Returns
TODO - proper treatment of the 64bits/32 bits integer TODO - speed up evaluation caching information (e.g format type )
  • get rid of the root formatting string and use sprintf formatting
  • e.g using t

Definition at line 130 of file AliTreePlayer.cxx.

void AliTreeFormulaF::UpdateFormulaLeaves ( )
virtual

Definition at line 171 of file AliTreePlayer.cxx.

Member Data Documentation

Int_t AliTreeFormulaF::fDebug

current cache value of the formula

Definition at line 89 of file AliTreePlayer.h.

Referenced by Compile(), and PrintValue().

TObjArray* AliTreeFormulaF::fFormatArray

array of text inputs

Definition at line 86 of file AliTreePlayer.h.

Referenced by Compile(), PrintValue(), and ~AliTreeFormulaF().

TObjArray* AliTreeFormulaF::fFormulaArray

array of format strings to draw

Definition at line 87 of file AliTreePlayer.h.

Referenced by Compile(), PrintValue(), UpdateFormulaLeaves(), and ~AliTreeFormulaF().

TObjArray* AliTreeFormulaF::fTextArray

Definition at line 85 of file AliTreePlayer.h.

Referenced by Compile(), PrintValue(), and ~AliTreeFormulaF().

TString AliTreeFormulaF::fValue
mutable

array of TFormulas

Definition at line 88 of file AliTreePlayer.h.

Referenced by PrintValue().


The documentation for this class was generated from the following files: