#ifndef TCOMETInputSelected_hxx_seek #define TCOMETInputSelected_hxx_seek #include #include "EoaCore.hxx" #include "ICOMETInput.hxx" #include "IDataVector.hxx" class TTree; namespace COMET { class ICOMETEvent; class ICOMETInput; class IEntryList; class ICOMETInputSelected; // Exception handling OA_EXCEPTION(ECOMETInputSelected,EoaCore); OA_EXCEPTION(ENoSelectedListContainter, ECOMETInputSelected); OA_EXCEPTION(EListNotFound, ECOMETInputSelected); } /// Extents the basic COMET input class to load an IEntryList and only read /// events from the event tree as determined by the IEntryList. It accesses the /// data vector of IEntryLists that are stored at the top level of the file. class COMET::ICOMETInputSelected : public ICOMETInput { public: /// Open an input file(default constructor) ICOMETInputSelected(const char* fName, Option_t* option="", int compress = 1); /// Open an input file with a list selected by name ICOMETInputSelected(const char* fName, Option_t* option, int compress, const char* listName); /// Open an input file with a list selected by index ICOMETInputSelected(const char* fName, Option_t* option, int compress, int listIndex); /// Use a TFile that was opened someplace else. The COMETInput object /// takes ownership of the file. This is particularly useful if the file /// has been openned using the static TFile::Open method. This method /// returns a pointer to a TFile derived class that is appropriate to the /// type of file (dist, http, &c). ICOMETInputSelected(TFile* file); ICOMETInputSelected(TFile* file, const char* listName); ICOMETInputSelected(TFile* file, int listIndex); virtual ~ICOMETInputSelected(void); /// Return the total number of events to be read in this file/list /// combination virtual Int_t GetEntriesInFile(void); /// Read the next event in the file. virtual ICOMETEvent* NextEvent(int skip = 0); /// Read the previous event in the file. virtual ICOMETEvent* PreviousEvent(int skip = 0); /// Read the n'th event in the file. The events are counted from zero. virtual ICOMETEvent* ReadEvent(Int_t n); /// Set the the selected events virtual void SetListContainer(); /// Set by list name virtual void SetSelection(const char* select_name); /// Set by list index virtual void SetSelection(int listIndex); private: IDataVector* fListContainer; /// Container for all lists IEntryList* fSelected; ///The entry list of selected events int fSelectIdx; ///The index of the selected event in the entry list ClassDef(ICOMETInputSelected,0); }; #endif