Crombie Tools
TMVACorrector Class Reference

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

#include <TMVACorrector.h>

+ Inheritance diagram for TMVACorrector:

Public Member Functions

 TMVACorrector (TString name, TString weights_file)
 
 ~TMVACorrector ()
 
TMVACorrectorCopy ()
 Copy this TMVACorrector for parallelization. More...
 
void ReadVarConfig (const char *config)
 Read a configuration file consisting of two columns: variable name and formula expression. 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...
 
virtual std::vector< TString > GetFormulas ()
 Gets the list of formulas that this corrector is using. 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...
 
virtual void SetInTree (TTree *tree)
 Set the pointer to the TTree this Corrector is reading. 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

Float_t DoEval ()
 Evaluate the MVA weights at the current entry. More...
 

Private Attributes

std::vector< Float_t > fFormulaResults
 Results of the formulae are stored in here for the reader. More...
 
std::vector< TString > fVarNames
 Keep the variable names for copy operations. More...
 
TString fWeightsFile
 Keep this variable for copy operations. More...
 
TMVA::IMethod * method {}
 Pointer to method to evaluate. More...
 
TMVA::Reader * reader {new TMVA::Reader("Silent")}
 The reader used by this object. More...
 

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.TMVACorrector module.

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

Definition at line 30 of file TMVACorrector.h.

Constructor & Destructor Documentation

§ TMVACorrector()

TMVACorrector::TMVACorrector ( TString  name,
TString  weights_file 
)

Referenced by Copy().

§ ~TMVACorrector()

TMVACorrector::~TMVACorrector ( )

Definition at line 18 of file TMVACorrector.cc.

References reader.

Member Function Documentation

§ Copy()

TMVACorrector * TMVACorrector::Copy ( )
virtual

§ DoEval()

Float_t TMVACorrector::DoEval ( )
privatevirtual

Evaluate the MVA weights at the current entry.

Reimplemented from Corrector.

Definition at line 43 of file TMVACorrector.cc.

References fFormulaResults, Corrector::GetFormulaResult(), Corrector::GetNumDims(), and method.

§ ReadVarConfig()

void TMVACorrector::ReadVarConfig ( const char *  config)

Read a configuration file consisting of two columns: variable name and formula expression.

Definition at line 22 of file TMVACorrector.cc.

References Corrector::AddInExpression(), fFormulaResults, Corrector::fName, fVarNames, fWeightsFile, method, and reader.

Member Data Documentation

§ fFormulaResults

std::vector<Float_t> TMVACorrector::fFormulaResults
private

Results of the formulae are stored in here for the reader.

Definition at line 45 of file TMVACorrector.h.

Referenced by Copy(), DoEval(), and ReadVarConfig().

§ fVarNames

std::vector<TString> TMVACorrector::fVarNames
private

Keep the variable names for copy operations.

Definition at line 46 of file TMVACorrector.h.

Referenced by Copy(), and ReadVarConfig().

§ fWeightsFile

TString TMVACorrector::fWeightsFile
private

Keep this variable for copy operations.

Definition at line 47 of file TMVACorrector.h.

Referenced by Copy(), and ReadVarConfig().

§ method

TMVA::IMethod* TMVACorrector::method {}
private

Pointer to method to evaluate.

Definition at line 48 of file TMVACorrector.h.

Referenced by Copy(), DoEval(), and ReadVarConfig().

§ reader

TMVA::Reader* TMVACorrector::reader {new TMVA::Reader("Silent")}
private

The reader used by this object.

Definition at line 44 of file TMVACorrector.h.

Referenced by Copy(), ReadVarConfig(), and ~TMVACorrector().


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