Crombie Tools
TwoScaleFactorCorrector Class Reference

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

#include <TwoScaleFactorCorrector.h>

+ Inheritance diagram for TwoScaleFactorCorrector:

Public Member Functions

 TwoScaleFactorCorrector ()
 Constructor setting the name of a branch it would like to write to. More...
 
 TwoScaleFactorCorrector (TString name, Corrector *Leg1Loose, Corrector *Leg1Tight, Corrector *Leg2Loose, Corrector *Leg2Tight)
 
virtual ~TwoScaleFactorCorrector ()
 
TwoScaleFactorCorrectorCopy ()
 Copy this TwoScaleFactorCorrector 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

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

Private Attributes

std::vector< Corrector * > fCorrectors
 Pointers to the Correctors. More...
 

Static Private Attributes

static constexpr int TSFCORRECTOR_NCORRECTORS = 4
 

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

A TwoScaleFactorCorrector reads from a tree and histogram and returns a correction factor. The CorrectorApplicator facilitates this application by providing the trees and writes the result to a branch.

Unlike the Corrector, there are two different scale factors for two different legs considered. Cuts and conditions are given explicitly for when to apply which scale factor to which leg by supplying this Corrector with four regular Corrector objects.

A condition that results in a combinatoric scale factor is also given. If this condition is true, for example, if we require two loose leptons, with at least one also tight (though both can be tight), we use the following scale factor when both leptons are tight:

\[ SF = \frac{SF_{1,tight}^2 SF_{2,loose} + SF_{1,loose} SF_{2,tight}^2} {SF_{1,tight} + SF_{2,tight}} \]

Definition at line 42 of file TwoScaleFactorCorrector.h.

Constructor & Destructor Documentation

§ TwoScaleFactorCorrector() [1/2]

TwoScaleFactorCorrector::TwoScaleFactorCorrector ( )
inline

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

Definition at line 46 of file TwoScaleFactorCorrector.h.

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

Referenced by Copy().

§ TwoScaleFactorCorrector() [2/2]

TwoScaleFactorCorrector::TwoScaleFactorCorrector ( TString  name,
Corrector Leg1Loose,
Corrector Leg1Tight,
Corrector Leg2Loose,
Corrector Leg2Tight 
)

§ ~TwoScaleFactorCorrector()

TwoScaleFactorCorrector::~TwoScaleFactorCorrector ( )
virtual

Definition at line 20 of file TwoScaleFactorCorrector.cc.

References fCorrectors.

Referenced by TwoScaleFactorCorrector().

Member Function Documentation

§ Copy()

§ DoEval()

Float_t TwoScaleFactorCorrector::DoEval ( )
privatevirtual

Evaluate the TTree pointer fInTree at its current entry.

Returns
value of correction histogram using the expressions added through AddInExpression(), unless the event does not pass the cut set by SetInCut(). In that case, a default value is returned (1.0).

Reimplemented from Corrector.

Definition at line 42 of file TwoScaleFactorCorrector.cc.

References fCorrectors.

Referenced by TwoScaleFactorCorrector().

§ GetFormulas()

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

Gets the list of formulas that this corrector is using.

Reimplemented from Corrector.

Definition at line 79 of file TwoScaleFactorCorrector.cc.

References fCorrectors.

Referenced by TwoScaleFactorCorrector().

§ SetInTree()

void TwoScaleFactorCorrector::SetInTree ( TTree *  tree)
virtual

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

Reimplemented from Corrector.

Definition at line 27 of file TwoScaleFactorCorrector.cc.

References fCorrectors, and Corrector::SetInTree().

Referenced by TwoScaleFactorCorrector().

Member Data Documentation

§ fCorrectors

std::vector<Corrector*> TwoScaleFactorCorrector::fCorrectors
private

Pointers to the Correctors.

Definition at line 66 of file TwoScaleFactorCorrector.h.

Referenced by Copy(), DoEval(), GetFormulas(), SetInTree(), and ~TwoScaleFactorCorrector().

§ TSFCORRECTOR_NCORRECTORS

constexpr int TwoScaleFactorCorrector::TSFCORRECTOR_NCORRECTORS = 4
staticprivate

Definition at line 65 of file TwoScaleFactorCorrector.h.

Referenced by Copy().


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