OutputConvention.h
1 /* -*- C++ -*-.***************************************************************************************************
2  Author: Ben Strutt
3  Email: b.strutt.12@ucl.ac.uk
4 
5  Description:
6  A class to manage output file names from environment variables, exec arguments and time.
7 *************************************************************************************************************** */
8 
9 #ifndef OUTPUTCONVENTION_H
10 #define OUTPUTCONVENTION_H
11 
12 
13 #include "TDatime.h"
14 #include "TString.h"
15 #include "TFile.h"
16 #include "TChain.h"
17 
18 #include <stdlib.h>
19 #include <errno.h>
20 #include <sys/stat.h>
21 #include <iostream>
22 #include <algorithm>
23 
24 
32 
33 public:
34 
35  OutputConvention(int argcIn, char* argvIn[]);
36 
37  TString getOutputFileName(TString ext="");
38 
39  static TFile* getFile(TString fileNameWithWildcards);
40 
41 private:
42  int argc;
43  char** argv;
44  TDatime dateTime;
45  TString outputDir;
46  TString dateTimeSuffix;
47  TString outFileName;
48 
49  TString getDateTimeSuffix();
50  TString getOutputDir();
51 
52 
53 
54 };
55 
56 
57 
58 
59 #endif
TString getOutputFileName(TString ext="")
Get the name of the output file from the program name (and system time).
A class to systematically name files produced by my analysis programs.
OutputConvention(int argcIn, char *argvIn[])
Constructor.
static TFile * getFile(TString fileNameWithWildcards)
Opens a TFile matching a fileName with wildcards. If multiple matches gets the "greatest" TString...