#ifndef TStnInputModule_hh #define TStnInputModule_hh #include "TStnModule.hh" class TStnEvent; class TStnNode; class TChain; class TFile; class TStnDataset; class TStnInputModule: public TStnModule { //----------------------------------------------------------------------------- // data members //----------------------------------------------------------------------------- protected: TFile* fFile; bool fOwnChain; // Is it our chain? TChain* fChain; // pointer to the analyzed TChain Int_t fCurrent; // current Tree number in a TChain Double_t fEntry; // entry number in the chain TList* fDatasetList; // list of datasets to be processed //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: TStnInputModule(const char* name = "InputModule", const char* title = "Input Module"); virtual ~TStnInputModule(); virtual int BeginJob (); virtual int BeginRun (); virtual int Event (Int_t i); virtual int EndRun (); virtual int EndJob (); int InitChain(const char* FileName, const char* TreeName); virtual int AddDataset(TStnDataset* Dataset, int Print = 0); virtual int RegisterInputBranches(TStnEvent* Event) = 0; //----------------------------------------------------------------------------- // accessors //----------------------------------------------------------------------------- virtual Double_t GetEntries (); Double_t GetEntry () { return fEntry; } Int_t FindEvent (Int_t Run, Int_t Event); TStnDataset* GetDataset (int i) { return (TStnDataset*) fDatasetList->At(i); } TChain* GetChain () { return fChain; } // returns pointer to TStnDataBlock, // but don't want to do type casting virtual TStnNode* GetNode(const char* BranchName, const char* ClassName); //----------------------------------------------------------------------------- // modifiers //----------------------------------------------------------------------------- virtual Int_t SetBranches() { return 0; } //----------------------------------------------------------------------------- // other methods //----------------------------------------------------------------------------- virtual Int_t NextEvent(Int_t IEntry); virtual Int_t LoadEntry(Int_t IEntry); ClassDef(TStnInputModule,0) // Base class for STNTUPLE input module }; #endif