SusyNtuple
SusyNtuple/ChainHelper.h
00001 #ifndef SusyNtuple_ChainHelper_h
00002 #define SusyNtuple_ChainHelper_h
00003 
00004 #include <fstream>
00005 
00006 #include "TFile.h"
00007 #include "TChain.h"
00008 
00020 class ChainHelper
00021 {
00022 
00023   public:
00024 
00025     //ChainHelper(std::string treeName = "");
00026     //~ChainHelper(){};
00027 
00028     enum Status {
00029       GOOD = 0,
00030       BAD = 1
00031     };
00032 
00034     static Status addFile(TChain* chain, std::string file);
00035 
00037     static Status addFileList(TChain* chain, std::string fileListName);
00038 
00039     // Add all files in a directory (obsolete, use addInput() instead)
00040     static Status addFileDir(TChain* chain, std::string fileDir);
00041 
00043 
00047     static Status addInput(TChain* chain, const std::string &input, bool verbose=false);
00048     // get the first file from a generic input
00049     static std::string firstFile(const std::string &input, bool verbose=false);
00051     static bool inputIsFile(const std::string &input);
00053     static bool inputIsList(const std::string &input);
00055     static bool inputIsDir(const std::string &input);
00056 
00057 };
00058 
00059 
00060 
00061 #endif
 All Classes Functions Variables Typedefs Enumerations Enumerator