SusyNtuple
|
00001 // -*- c++ -*- 00002 #ifndef SUSY_EVENTLISTHANDLER_H 00003 #define SUSY_EVENTLISTHANDLER_H 00004 00005 #include "TEventList.h" 00006 00007 #include <string> 00008 00009 class TFile; 00010 00011 namespace Susy { 00013 00026 class EventlistHandler { 00027 00028 public: 00029 EventlistHandler(); 00030 ~EventlistHandler(); 00031 bool cacheDoesExists() const; 00032 EventlistHandler& setCacheFilename(const std::string value="./cache/Sample_eventList.root"); 00033 EventlistHandler& setListName(const std::string value="EventList") { m_listName = value; return *this; } 00034 EventlistHandler& addEvent(Long64_t entry); 00035 EventlistHandler& setVerbose(bool value=true) { m_verbose = value; return *this; } 00036 TEventList* eventList() { return &m_eventlist; } 00037 TEventList* fetchEventList(); 00038 std::string cacheFilename() const { return m_cacheFilename; } 00039 00040 private: // rule of three 00041 // EventlistHandler& (const EventlistHandler&); 00042 // EventlistHandler& operator=(const EventlistHandler&); 00043 private: 00044 bool initOutputFile(); 00045 bool outputFileExists(); 00046 bool closeOutputFile(); 00047 void setDefaultValues(); 00048 private: 00049 std::string m_cacheFilename; 00050 std::string m_listName; 00051 bool m_firstEventHasBeenProcessed; 00052 TEventList m_eventlist; 00053 TFile *m_cacheFile; 00054 bool m_verbose; 00055 }; 00056 } // Susy 00057 00058 #endif