Crombie Tools
FormulaCorrector Class Reference

Can be created using the CrombieTools.SkimmingTools.FormulaCorrector module. More...

#include <FormulaCorrector.h>

+ Inheritance diagram for FormulaCorrector:

Public Member Functions

 FormulaCorrector (TString name, TString formula)
 Constructor setting the name of a branch it would like to write to. More...
 
virtual ~FormulaCorrector ()
 
FormulaCorrectorCopy ()
 Copy this FormulaCorrector for parallelization. More...
 
std::vector< TString > GetFormulas ()
 Gets the list of formulas that this corrector is using. More...
 
void SetInTree (TTree *tree)
 Set the pointer to the TTree the Corrector objects inside are reading. More...
 
- Public Member Functions inherited from Corrector
 Corrector (TString name="correction")
 Constructor setting the name of a branch it would like to write to. More...
 
virtual ~Corrector ()
 
void AddInExpression (TString expres)
 Add an expression to read from the histogram. More...
 
Bool_t CompareFileName (TString fileName)
 Compares the file name to the Regex and returns true if corrections will be applied. More...
 
Float_t Evaluate ()
 Evaluate the TTree pointer fInTree at its current entry. More...
 
std::pair< bool, Float_t > EvaluateWithFlag ()
 Evaluate the TTree pointer fInTree at its current entry and return a status bit corresponding to cut. More...
 
TString GetName () const
 Get the name of the branch that this Corrector would like to write to. More...
 
void SetBinning (UInt_t num, Double_t min, Double_t max)
 Set the binning when the histograms do not store the correct x values. More...
 
void SetCorrectionFile (TString fileName)
 Set the file containing the correction histogram by name. More...
 
void SetCorrectionHist (TString histName)
 Set the correction histogram name within the correction file. More...
 
void SetCorrectionHist (TString hist1, TString hist2)
 Set two histograms to divide in order to obtain the correction histogram. More...
 
void SetHistReader (HistReader reader)
 Set the type of histogram reader. More...
 
void SetInCut (TString cut)
 Set a cut for the corrector. More...
 
void SetMatchFileName (TString regexpr)
 Set a RegEx for the Corrector to check against the filename. If no match, corrections are not applied. More...
 
- Public Member Functions inherited from Debug
 Debug ()
 
virtual ~Debug ()
 
DebugLevel GetDebugLevel ()
 Gets the verbosity for a class. More...
 
template<typename T , typename... V>
void Message (DebugLevel level, T message, V... more)
 Sends a message if the verbosity level is appropriate. More...
 
void Message (DebugLevel level)
 
void SetDebugLevel (DebugLevel level)
 Sets the verbosity for a class. More...
 

Private Member Functions

 FormulaCorrector ()
 
Float_t DoEval ()
 Evaluate the TTree pointer fInTree at its current entry. More...
 

Private Attributes

TTreeFormula * fFormula = NULL
 
TString fFormulaString
 

Additional Inherited Members

- Public Types inherited from Corrector
enum  HistReader { eValue = 0, eZeroCenteredUnc, eUnityCenteredUnc }
 Used to set the way to read the correction histogram. More...
 
- Public Types inherited from Debug
enum  DebugLevel { eQuiet = 0, eError, eInfo, eDebug }
 Different possible debug levels. More...
 
- Public Attributes inherited from Corrector
bool Merge = true
 Flag determining whether or not to merge into the CorrectorApplicator branch. More...
 
- Protected Member Functions inherited from Corrector
Double_t GetFormulaResult (Int_t index, Bool_t use_mins=true)
 Evaluate one of the formulae. If use_lims, then don't give a result that would go off the relevant axis. More...
 
Int_t GetNumDims ()
 Get the number of dimensions that the formulas hold. More...
 
void InitializeTree ()
 Function to initialize TTreeFormula on the tree. More...
 
- Protected Member Functions inherited from Debug
void DisplayFunc (const char *func)
 Sends the name of the function during debuggin. More...
 
- Protected Attributes inherited from Corrector
TTreeFormula * fCutFormula = NULL
 Formula for cut. More...
 
TString fInCut = "1"
 Corrector cut. More...
 
TTree * fInTree = NULL
 Pointer to tree being read. More...
 
Bool_t fIsCopy = false
 Track if instance is a copy. More...
 
Bool_t fMatchedFileName
 A flag telling this corrector if the file has been matched. More...
 
TString fName
 Name of branch to write to. More...
 

Detailed Description

Can be created using the CrombieTools.SkimmingTools.FormulaCorrector module.

A Formulacorrector Takes a given formulat and saves a branch with the formula result.

Definition at line 27 of file FormulaCorrector.h.

Constructor & Destructor Documentation

§ FormulaCorrector() [1/2]

FormulaCorrector::FormulaCorrector ( )
inlineprivate

Definition at line 30 of file FormulaCorrector.h.

References Copy(), DoEval(), GetFormulas(), SetInTree(), and ~FormulaCorrector().

Referenced by Copy().

§ FormulaCorrector() [2/2]

FormulaCorrector::FormulaCorrector ( TString  name,
TString  formula 
)

Constructor setting the name of a branch it would like to write to.

§ ~FormulaCorrector()

FormulaCorrector::~FormulaCorrector ( )
virtual

Definition at line 18 of file FormulaCorrector.cc.

References fFormula.

Referenced by FormulaCorrector().

Member Function Documentation

§ Copy()

FormulaCorrector * FormulaCorrector::Copy ( )
virtual

Copy this FormulaCorrector for parallelization.

Reimplemented from Corrector.

Definition at line 42 of file FormulaCorrector.cc.

References Corrector::fIsCopy, FormulaCorrector(), and CrombieTools.SkimmingTools.FormulaCorrector::newFormulaCorrector.

Referenced by FormulaCorrector().

§ DoEval()

Float_t FormulaCorrector::DoEval ( )
privatevirtual

Evaluate the TTree pointer fInTree at its current entry.

Reimplemented from Corrector.

Definition at line 36 of file FormulaCorrector.cc.

References fFormula.

Referenced by FormulaCorrector().

§ GetFormulas()

std::vector< TString > FormulaCorrector::GetFormulas ( )
virtual

Gets the list of formulas that this corrector is using.

Reimplemented from Corrector.

Definition at line 50 of file FormulaCorrector.cc.

References fFormulaString, and Corrector::GetFormulas().

Referenced by FormulaCorrector().

§ SetInTree()

void FormulaCorrector::SetInTree ( TTree *  tree)
virtual

Set the pointer to the TTree the Corrector objects inside are reading.

Reimplemented from Corrector.

Definition at line 25 of file FormulaCorrector.cc.

References fFormula, fFormulaString, Corrector::fInTree, and Corrector::SetInTree().

Referenced by FormulaCorrector().

Member Data Documentation

§ fFormula

TTreeFormula* FormulaCorrector::fFormula = NULL
private

Definition at line 50 of file FormulaCorrector.h.

Referenced by DoEval(), SetInTree(), and ~FormulaCorrector().

§ fFormulaString

TString FormulaCorrector::fFormulaString
private

Definition at line 49 of file FormulaCorrector.h.

Referenced by GetFormulas(), and SetInTree().


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