X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenReaderTreeK.h;h=d31cf1cf136844edcbaa70bb560cd47d7e49a075;hb=84290fcc7685f8042edd047c160800a572601361;hp=6c30527682196b8e49cbedd7f14e928255ce3191;hpb=ae872676b538ed53d09042339ac3f2926d69f2f2;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenReaderTreeK.h b/EVGEN/AliGenReaderTreeK.h index 6c305276821..d31cf1cf136 100644 --- a/EVGEN/AliGenReaderTreeK.h +++ b/EVGEN/AliGenReaderTreeK.h @@ -4,37 +4,64 @@ * See cxx source for full Copyright notice */ /* $Id$ */ - +// +// Realisation of AliGenReader to be used with AliGenExtFile +// It reads events from a kinematics TreeK. +// Author: andreas.morsch@cern.ch +// #include "AliGenReader.h" +#include "AliStack.h" + class TFile; +class AliRunLoader; class AliStack; -class AliHeader; - +class TString; +class TObjArray; class AliGenReaderTreeK : public AliGenReader { public: AliGenReaderTreeK(); - AliGenReaderTreeK(const AliGenReaderTreeK &reader){;} + AliGenReaderTreeK(const AliGenReaderTreeK &reader); virtual ~AliGenReaderTreeK(); // Initialise virtual void Init(); // Read virtual Int_t NextEvent(); virtual TParticle* NextParticle(); - AliGenReaderTreeK & operator=(const AliGenReader & rhs); - + virtual void RewindEvent(); + virtual void SetOnlyPrimaries(Bool_t flag){fOnlyPrimaries = flag;} + AliGenReaderTreeK & operator=(const AliGenReaderTreeK & rhs); + void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names + void AddDir(const char* dirname); + AliRunLoader * GetRunLoader() const {return fInRunLoader;} + protected: Int_t fNcurrent; // points to the next entry Int_t fNparticle; // Next particle in list Int_t fNp; // number of particles - TFile *fFile; //! pointer to file + AliRunLoader *fInRunLoader; //!Run Loader of the input event TFile *fBaseFile; //! pointer to base file AliStack *fStack; //! Particle stack - AliHeader *fHeader; //! Pointer to event header - TTree *fTreeE; //! Pointer to header tree + Bool_t fOnlyPrimaries; // Flag indicating wether only primaries are read + TObjArray *fDirs; //arry with directories to read data from + Int_t fCurrentDir; //Number of current directory + static const TString fgkEventFolderName;//!name of folder where event to read is mounted + + TString& GetDirName(Int_t entry); + TParticle* GetParticle(Int_t i); + private: + void Copy(TObject&) const; ClassDef(AliGenReaderTreeK,1) // Read particles from TreeK }; + +inline +TParticle* AliGenReaderTreeK::GetParticle(Int_t i) + { + if (fStack && iParticle(i); + return 0x0; + } + #endif