Crombie Tools
|
Can be created using the CrombieTools.SkimmingTools.Corrector module. More...
#include <CorrectorApplicator.h>
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... | |
CorrectorApplicator * | Copy () |
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... | |
Can be created using the CrombieTools.SkimmingTools.Corrector module.
Applies multiple Corrector objects to a tree in a file.
Definition at line 25 of file CorrectorApplicator.h.
CorrectorApplicator::CorrectorApplicator | ( | TString | name = "" , |
Bool_t | saveAll = true |
||
) |
Referenced by Copy().
|
virtual |
Definition at line 26 of file CorrectorApplicator.cc.
|
inline |
Add a Corrector object to the CorrectorApplicator.
Definition at line 45 of file CorrectorApplicator.h.
References fCorrectors.
|
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.
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().
CorrectorApplicator * CorrectorApplicator::Copy | ( | ) |
Copy this CorrectorApplicator for parallelization.
Definition at line 167 of file CorrectorApplicator.cc.
References CorrectorApplicator(), and fCorrectors.
|
inline |
Wrapper for CrombieTools.Parallelization.RunOnDirectory() to use.
Definition at line 50 of file CorrectorApplicator.h.
References ApplyCorrections().
|
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.
|
inline |
Sets whether the common branch is an uncertainty or a scale factor.
Definition at line 53 of file CorrectorApplicator.h.
References fIsUncertainty.
|
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.
|
private |
Vector of corrector pointers.
Definition at line 60 of file CorrectorApplicator.h.
Referenced by AddCorrector(), ApplyCorrections(), and Copy().
|
private |
Input tree name.
Definition at line 58 of file CorrectorApplicator.h.
Referenced by ApplyCorrections(), and SetInputTreeName().
|
private |
Determines how to merge the branches.
Definition at line 62 of file CorrectorApplicator.h.
Referenced by ApplyCorrections(), and SetIsUncertainty().
|
private |
Vector of branches to merge.
Definition at line 61 of file CorrectorApplicator.h.
Referenced by AddFactorToMerge(), and ApplyCorrections().
|
private |
Name of the master output branch.
Definition at line 56 of file CorrectorApplicator.h.
Referenced by ApplyCorrections().
|
private |
Output tree name.
Definition at line 59 of file CorrectorApplicator.h.
Referenced by ApplyCorrections(), and SetOutputTreeName().
|
private |
Bool to save other Corrector results to tree too.
Definition at line 57 of file CorrectorApplicator.h.
Referenced by ApplyCorrections().