Crombie Tools
InOutDirectoryHolder Class Reference

nThis class is used to facilitate writing files to a directory. More...

#include <InOutDirectoryHolder.h>

+ Inheritance diagram for InOutDirectoryHolder:

Public Member Functions

 InOutDirectoryHolder ()
 
virtual ~InOutDirectoryHolder ()
 
TString GetOutDirectory () const
 
void SetInputOutputMap (TString input, TString output)
 Adds a mapping from input to output file name. More...
 
void SetOutDirectory (TString dir)
 Sets the output directory where the files will be written, and adds a "/" if needed. More...
 
void SetOverwriteFiles (Bool_t overwrite)
 Sets whether or not to overwrite files. 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...
 

Protected Member Functions

TString AddOutDir (TString FileName) const
 A helper function that prepends the output directory to a filename. 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...
 

Private Attributes

std::map< TString, TString > fInOutMap
 Stores name changes from input to output directories. More...
 
TString fOutDirectory = ""
 Stores the output directory, and always ends with a '/'. More...
 
Bool_t fOverwriteFiles = true
 Sets whether or not to overwrite output files. More...
 

Additional Inherited Members

- Public Types inherited from Debug
enum  DebugLevel { eQuiet = 0, eError, eInfo, eDebug }
 Different possible debug levels. More...
 

Detailed Description

n

This class is used to facilitate writing files to a directory.

Main purpose is to centralize function of adding output directory to the filename when considering said file.

Definition at line 24 of file InOutDirectoryHolder.h.

Constructor & Destructor Documentation

§ InOutDirectoryHolder()

InOutDirectoryHolder::InOutDirectoryHolder ( )
inline

Definition at line 27 of file InOutDirectoryHolder.h.

§ ~InOutDirectoryHolder()

virtual InOutDirectoryHolder::~InOutDirectoryHolder ( )
inlinevirtual

Definition at line 28 of file InOutDirectoryHolder.h.

Member Function Documentation

§ AddOutDir()

TString InOutDirectoryHolder::AddOutDir ( TString  FileName) const
protected

A helper function that prepends the output directory to a filename.

Parameters
FileNameis the name of a file inside the fOutDirectory or an absolute path.
Returns
FileName with the output directory prepended, unless absolute or fOutDirectory is empty, where it is left alone.

Definition at line 60 of file InOutDirectoryHolder.h.

References AddDirectory(), test::code, fInOutMap, fOutDirectory, and fOverwriteFiles.

Referenced by PlotFitParameters::DoFit(), Plot2D::DoFit(), PlotStack::MakeCanvas(), LimitTreeMaker::MakeTrees(), SetInputOutputMap(), and FlatSkimmer::Skim().

§ GetOutDirectory()

TString InOutDirectoryHolder::GetOutDirectory ( ) const
inline
Returns
the output directory

Definition at line 33 of file InOutDirectoryHolder.h.

References fOutDirectory.

§ SetInputOutputMap()

void InOutDirectoryHolder::SetInputOutputMap ( TString  input,
TString  output 
)
inline

Adds a mapping from input to output file name.

Definition at line 38 of file InOutDirectoryHolder.h.

References AddOutDir(), fInOutMap, and hadd::input.

§ SetOutDirectory()

void InOutDirectoryHolder::SetOutDirectory ( TString  dir)
inline

Sets the output directory where the files will be written, and adds a "/" if needed.

Definition at line 31 of file InOutDirectoryHolder.h.

References fOutDirectory.

§ SetOverwriteFiles()

void InOutDirectoryHolder::SetOverwriteFiles ( Bool_t  overwrite)
inline

Sets whether or not to overwrite files.

Definition at line 35 of file InOutDirectoryHolder.h.

References fOverwriteFiles.

Member Data Documentation

§ fInOutMap

std::map<TString, TString> InOutDirectoryHolder::fInOutMap
private

Stores name changes from input to output directories.

Definition at line 52 of file InOutDirectoryHolder.h.

Referenced by AddOutDir(), and SetInputOutputMap().

§ fOutDirectory

TString InOutDirectoryHolder::fOutDirectory = ""
private

Stores the output directory, and always ends with a '/'.

Definition at line 53 of file InOutDirectoryHolder.h.

Referenced by AddOutDir(), GetOutDirectory(), and SetOutDirectory().

§ fOverwriteFiles

Bool_t InOutDirectoryHolder::fOverwriteFiles = true
private

Sets whether or not to overwrite output files.

Definition at line 54 of file InOutDirectoryHolder.h.

Referenced by AddOutDir(), and SetOverwriteFiles().


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