A class to systematically name files produced by my analysis programs. More...
#include <OutputConvention.h>
Public Member Functions | |
OutputConvention (int argcIn, char *argvIn[]) | |
Constructor. More... | |
TString | getOutputFileName (TString ext="") |
Get the name of the output file from the program name (and system time). More... | |
TString | getOutputDir () |
Looks for an environment variable called OUTPUT_DIR and if it exists, sets it as the output dir. More... | |
TFile * | makeFile () |
Create the new output file with proper name. More... | |
Static Public Member Functions | |
static TFile * | getFile (TString fileNameWithWildcards) |
Opens matching file with the most recent suffix. More... | |
A class to systematically name files produced by my analysis programs.
Uses the program name, arguments, date, and time.
Definition at line 35 of file OutputConvention.h.
Acclaim::OutputConvention::OutputConvention | ( | int | argcIn, |
char * | argvIn[] | ||
) |
Constructor.
argcIn | should be the main executable's argc value. |
argvIn | should be the main executable's argv value. |
Definition at line 15 of file OutputConvention.cxx.
|
static |
Opens matching file with the most recent suffix.
Opens a TFile matching a fileName with wildcards. If multiple matches gets the "greatest" TString, which hopefully corresponds to the file with the latest date suffix.
fileNameWithWildcards | is the name of the file (with wildcards) that you wish to open. |
Sorts all matching files into increasing order of fileName. If the files have my standard date suffix attached to them, then this should correspond to the most recent file.
Definition at line 199 of file OutputConvention.cxx.
TString Acclaim::OutputConvention::getOutputDir | ( | ) |
Looks for an environment variable called OUTPUT_DIR and if it exists, sets it as the output dir.
Definition at line 175 of file OutputConvention.cxx.
TString Acclaim::OutputConvention::getOutputFileName | ( | TString | ext = "" | ) |
Get the name of the output file from the program name (and system time).
ext | is an optional parameter file extension you want (e.g. .txt, .root, .csv), if none is given then .root is used. |
Definition at line 36 of file OutputConvention.cxx.
TFile * Acclaim::OutputConvention::makeFile | ( | ) |
Create the new output file with proper name.
Makes the standard named ROOT file. Complains if there's a problem and returns NULL.
Definition at line 90 of file OutputConvention.cxx.