00001
00002
00003
00004
00005 #ifndef MyTextFileReaderH
00006 #define MyTextFileReaderH
00007
00008
00009
00010
00011
00021
00022
00023
00024
00025
00026
00027
00028 #include <iostream>
00029 #include <fstream>
00030
00031 #include <string>
00032 #include <vector>
00033 #include <map>
00034
00035
00036 #include "TString.h"
00037
00038
00039
00040
00041
00042 class MyTextFileReader {
00043
00044 public:
00045
00046 MyTextFileReader(void) {
00047 init("");
00048 }
00050
00051 MyTextFileReader(TString textfilename) {
00052 init(textfilename);
00053 }
00056
00057 ~MyTextFileReader(void) {
00058 destruct();
00059 }
00061
00062
00063
00064 TString get_textfilename(void);
00066
00067 TString get_string(TString key_string);
00069
00070 Bool_t get_bool(TString key_string);
00072
00073 int get_int(TString key_string);
00074
00075
00076 template <class MyType> MyType
00077 retrieve_from_file(TString key_string, TString filename = "");
00080
00081 void fill_cutvalue_map(TString cutstring, TString filename = "");
00085
00086 Double_t get_cutvalue(TString variable);
00089
00090 private:
00091
00092
00093 TString m_textfilename;
00094
00095
00096
00097 typedef std::map<TString, Double_t> maptype;
00098 typedef maptype::value_type ValuePair;
00099
00100 maptype m_cutvalue_map;
00101
00102 void init(TString textfilename);
00103
00104
00105 void destruct(void);
00106
00107
00108 };
00109
00110 #endif