Crombie Tools
CorrectorApplicator Class Reference

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

#include <CorrectorApplicator.h>

+ Inheritance diagram for CorrectorApplicator:

Public Member Functions

 CorrectorApplicator (TString name="", Bool_t saveAll=true)
 
virtual ~CorrectorApplicator ()
 
void AddCorrector (Corrector *corrector)
 Add a Corrector object to the CorrectorApplicator. More...
 
void AddFactorToMerge (TString factor)
 Add a branch name to include by multiplication into the main output branch of the CorrectorApplicator. More...
 
void ApplyCorrections (TString fileName)
 Apply the corrections to a given file. More...
 
CorrectorApplicatorCopy ()
 Copy this CorrectorApplicator for parallelization. More...
 
void RunOnFile (TString fileName)
 Wrapper for CrombieTools.Parallelization.RunOnDirectory() to use. More...
 
void SetInputTreeName (TString tree)
 Set the name of the input tree for each of the Corrector objects to read. More...
 
void SetIsUncertainty (Bool_t unc)
 Sets whether the common branch is an uncertainty or a scale factor. More...
 
void SetOutputTreeName (TString tree)
 Set the name of the output tree for the correctors. More...
 
- Public Member Functions inherited from InDirectoryHolder
 InDirectoryHolder ()
 
virtual ~InDirectoryHolder ()
 
TString GetInDirectory () const
 
void SetInDirectory (TString dir)
 Sets the input directory where the MCFiles will be searched for, and adds a "/" if needed. 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...
 
- Public Member Functions inherited from ProgressReporter
 ProgressReporter ()
 
virtual ~ProgressReporter ()
 
void SetReportFrequency (Long64_t freq)
 Sets the frequency of reporting progress to terminal. More...
 

Private Attributes

std::vector< Corrector * > fCorrectors
 Vector of corrector pointers. More...
 
TString fInputTreeName = "events"
 Input tree name. More...
 
Bool_t fIsUncertainty = false
 Determines how to merge the branches. More...
 
std::vector< TString > fMergeFactors
 Vector of branches to merge. More...
 
TString fName
 Name of the master output branch. More...
 
TString fOutputTreeName = "corrections"
 Output tree name. More...
 
Bool_t fSaveAll
 Bool to save other Corrector results to tree too. More...
 

Additional Inherited Members

- Public Types inherited from Debug
enum  DebugLevel { eQuiet = 0, eError, eInfo, eDebug }
 Different possible debug levels. More...
 
- Protected Member Functions inherited from InDirectoryHolder
TString AddInDir (TString FileName)
 A helper function that prepends the input directory to a filename. More...
 
- Protected Member Functions inherited from Debug
void DisplayFunc (const char *func)
 Sends the name of the function during debuggin. More...
 
- Protected Member Functions inherited from ProgressReporter
void ReportProgress (Long64_t entry)
 Sends report to the terminal if needed. More...
 
void SetNumberOfEntries (Long64_t nentries)
 Sets the number of entries to process. More...
 
Long64_t SetNumberOfEntries (TTree *tree)
 Sets the number of entries to process from a tree. More...
 
void SetReportFile (TString name)
 Sets the name of the file to report to the terminal. More...
 
- Protected Attributes inherited from ProgressReporter
Long64_t fNumberOfEntries = 0
 Number of entries being run over. More...
 

Detailed Description

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

Applies multiple Corrector objects to a tree in a file.

Todo:
create a type of corrector that does trigger bits from a TFormula

Definition at line 25 of file CorrectorApplicator.h.

Constructor & Destructor Documentation

§ CorrectorApplicator()

CorrectorApplicator::CorrectorApplicator ( TString  name = "",
Bool_t  saveAll = true 
)

Referenced by Copy().

§ ~CorrectorApplicator()

CorrectorApplicator::~CorrectorApplicator ( )
virtual

Definition at line 26 of file CorrectorApplicator.cc.

Member Function Documentation

§ AddCorrector()

void CorrectorApplicator::AddCorrector ( Corrector corrector)
inline

Add a Corrector object to the CorrectorApplicator.

Definition at line 45 of file CorrectorApplicator.h.

References fCorrectors.

§ AddFactorToMerge()

void CorrectorApplicator::AddFactorToMerge ( TString  factor)
inline

Add a branch name to include by multiplication into the main output branch of the CorrectorApplicator.

Definition at line 47 of file CorrectorApplicator.h.

References fMergeFactors.

§ ApplyCorrections()

void CorrectorApplicator::ApplyCorrections ( TString  fileName)

Apply the corrections to a given file.

Applies all of the Corrector objects to the input fileName.

The file name does not have to be an absolute path if fInDirectory is set. Each unique name of the Corrector objects creates a new branch if fSaveAll is true. If multiple correctors have the same name, then the result of that branch is the product of the correctors. A product of all Corrector object results and any branches labelled to be merged are stored in a branch called fName.

Definition at line 41 of file CorrectorApplicator.cc.

References InDirectoryHolder::AddInDir(), fCorrectors, fInputTreeName, fIsUncertainty, fMergeFactors, fName, fOutputTreeName, fSaveAll, crombie::Cutflow::Merge(), ProgressReporter::ReportProgress(), ProgressReporter::SetNumberOfEntries(), and ProgressReporter::SetReportFile().

Referenced by RunOnFile().

§ Copy()

CorrectorApplicator * CorrectorApplicator::Copy ( )

Copy this CorrectorApplicator for parallelization.

Definition at line 167 of file CorrectorApplicator.cc.

References CorrectorApplicator(), and fCorrectors.

§ RunOnFile()

void CorrectorApplicator::RunOnFile ( TString  fileName)
inline

Wrapper for CrombieTools.Parallelization.RunOnDirectory() to use.

Definition at line 50 of file CorrectorApplicator.h.

References ApplyCorrections().

§ SetInputTreeName()

void CorrectorApplicator::SetInputTreeName ( TString  tree)
inline

Set the name of the input tree for each of the Corrector objects to read.

Definition at line 38 of file CorrectorApplicator.h.

References fInputTreeName.

§ SetIsUncertainty()

void CorrectorApplicator::SetIsUncertainty ( Bool_t  unc)
inline

Sets whether the common branch is an uncertainty or a scale factor.

Definition at line 53 of file CorrectorApplicator.h.

References fIsUncertainty.

§ SetOutputTreeName()

void CorrectorApplicator::SetOutputTreeName ( TString  tree)
inline

Set the name of the output tree for the correctors.

If this is the same as the input tree, the branch must not already exist.

Definition at line 43 of file CorrectorApplicator.h.

References fOutputTreeName.

Member Data Documentation

§ fCorrectors

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

Vector of corrector pointers.

Definition at line 60 of file CorrectorApplicator.h.

Referenced by AddCorrector(), ApplyCorrections(), and Copy().

§ fInputTreeName

TString CorrectorApplicator::fInputTreeName = "events"
private

Input tree name.

Definition at line 58 of file CorrectorApplicator.h.

Referenced by ApplyCorrections(), and SetInputTreeName().

§ fIsUncertainty

Bool_t CorrectorApplicator::fIsUncertainty = false
private

Determines how to merge the branches.

Definition at line 62 of file CorrectorApplicator.h.

Referenced by ApplyCorrections(), and SetIsUncertainty().

§ fMergeFactors

std::vector<TString> CorrectorApplicator::fMergeFactors
private

Vector of branches to merge.

Definition at line 61 of file CorrectorApplicator.h.

Referenced by AddFactorToMerge(), and ApplyCorrections().

§ fName

TString CorrectorApplicator::fName
private

Name of the master output branch.

Definition at line 56 of file CorrectorApplicator.h.

Referenced by ApplyCorrections().

§ fOutputTreeName

TString CorrectorApplicator::fOutputTreeName = "corrections"
private

Output tree name.

Definition at line 59 of file CorrectorApplicator.h.

Referenced by ApplyCorrections(), and SetOutputTreeName().

§ fSaveAll

Bool_t CorrectorApplicator::fSaveAll
private

Bool to save other Corrector results to tree too.

Definition at line 57 of file CorrectorApplicator.h.

Referenced by ApplyCorrections().


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