00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00002 // 8.11.2006, AUTHOR: OLIVER KORTNER 00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00004 00005 //:::::::::::::::::::::::::::::::::::::::::::::::::::: 00006 //:: MAIN PROGRAMME TO RUN THE ANALYSIS OF THE AAN. :: 00007 //:::::::::::::::::::::::::::::::::::::::::::::::::::: 00008 00009 //::::::::::::::::: 00010 //:: HEADER FILE :: 00011 //::::::::::::::::: 00012 00013 // standard C++ // 00014 #include <iostream> 00015 #include <fstream> 00016 00017 // STL // 00018 #include <string> 00019 #include <vector> 00020 00021 // AAN reader // 00022 #include "NtupleReader/NtupleReader.h" 00023 00024 // ROOT // 00025 #include "TSystem.h" 00026 00027 // user analysis // 00028 #include "MyAnalysisExample/MyAnalysisExample.h" //example 00029 //#include "HiggsAnalysis/MyJetAnalysis.h" // steffen 00030 //#include "HiggsAnalysis/MyHtautauAnalysis.h" // manfred 00031 //#include "HiggsAnalysis/Ttbar_Analyse.h" // thies 00032 00033 //:::::::::::::::::::::::: 00034 //:: NAMESPACE SETTINGS :: 00035 //:::::::::::::::::::::::: 00036 00037 using namespace std; 00038 00039 00040 //:::::::::: 00041 //:: MAIN :: 00042 //:::::::::: 00043 00044 int main(int argc, char * argv[]) { 00045 00046 //----------------------------- 00047 //-- CHECK FOR CORRECT USAGE -- 00048 //----------------------------- 00049 00050 if (argc!=2) { 00051 cerr << endl 00052 << "Incorrect usage!\n" 00053 << "Correct usage:\n" 00054 << "AAN_analysis.exe <name of the textfile containing the " 00055 << "AAN files>\n"; 00056 return 1; 00057 } 00058 00059 //--------------- 00060 //-- VARIABLES -- 00061 //--------------- 00062 00063 00064 //TSystem *gSystem=new TSystem; 00065 //gSystem->Load("libAnalysisTools.so"); 00066 00067 MyAnalysisExample my_analysis; // the user's analysis class // 00068 //MyJetAnalysis my_analysis; 00069 //MyHtautauAnalysis my_analysis; 00070 //Ttbar_Analyse my_analysis; 00071 00072 string sdummy; // auxiliary string 00073 vector<string> filename; // vector containing the names of the AAN files 00074 00075 filename.push_back(argv[1]); 00076 00077 //ifstream settings_file(argv[1]); // file containing the names of the 00078 // AAN files 00079 // if (settings_file.fail()) { 00080 // cerr << endl 00081 // << "Could not open settings file " << argv[1] << "." 00082 // << endl; 00083 // return 1; 00084 // } 00085 00086 //------------------------------------- 00087 //-- READ THE NAMES OF THE AAN FILES -- 00088 //------------------------------------- 00089 00090 // while (!settings_file.eof()) { 00091 // settings_file >> sdummy; 00092 // if (settings_file.eof()) { 00093 // break; 00094 // } 00095 // filename.push_back(sdummy); 00096 // } 00097 00098 //---------------------------------------------------------- 00099 //-- INITIALIZE THE EVENT READER AND LOOP OVER THE EVENTS -- 00100 //---------------------------------------------------------- 00101 00102 //my_analysis.filename = filename[0].c_str(); 00103 my_analysis.filename = filename[0].c_str(); 00104 NtupleReader reader(filename, string("CollectionTree"), 00105 &my_analysis); 00106 00107 reader.event_loop(); 00108 00109 return 0; 00110 00111 }