Public Member Functions | Static Public Member Functions | List of all members
Acclaim::OutputConvention Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

Acclaim::OutputConvention::OutputConvention ( int  argcIn,
char *  argvIn[] 
)

Constructor.

Parameters
argcInshould be the main executable's argc value.
argvInshould be the main executable's argv value.

Definition at line 15 of file OutputConvention.cxx.

Member Function Documentation

TFile * Acclaim::OutputConvention::getFile ( TString  fileNameWithWildcards)
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.

Parameters
fileNameWithWildcardsis the name of the file (with wildcards) that you wish to open.
Returns
NULL if no matches, the opened file if there is a match.

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.

Returns
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).

Parameters
extis an optional parameter file extension you want (e.g. .txt, .root, .csv), if none is given then .root is used.
Returns
the output file name

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.

Returns
the newly created makefile or NULL if there was a problem.

Definition at line 90 of file OutputConvention.cxx.


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