X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenReaderTreeK.cxx;h=62614be4b2f845d85cef2d29c906e060fbef4c0e;hb=e56016a002d38069843e4a32174ba6404f0883e9;hp=241139fa81cbd03ed239c6e3ab651c8c50b088b3;hpb=198bb1c7ab5437cd36dc37692d7ad850220b43fd;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenReaderTreeK.cxx b/EVGEN/AliGenReaderTreeK.cxx index 241139fa81c..62614be4b2f 100644 --- a/EVGEN/AliGenReaderTreeK.cxx +++ b/EVGEN/AliGenReaderTreeK.cxx @@ -14,7 +14,13 @@ **************************************************************************/ /* $Id$ */ - +// +// Realisation of AliGenReader to be used with AliGenExtFile +// It reads events from a kinematics TreeK. +// NextEvent() is used to loop over events +// and NextParticle() to loop over particles. +// Author: andreas.morsch@cern.ch +// #include #include #include @@ -24,9 +30,10 @@ #include "AliGenReaderTreeK.h" #include "AliHeader.h" #include "AliRun.h" +#include "AliStack.h" #include "AliRunLoader.h" -ClassImp(AliGenReaderTreeK); +ClassImp(AliGenReaderTreeK) const TString AliGenReaderTreeK::fgkEventFolderName("GenReaderTreeK"); @@ -73,7 +80,7 @@ void AliGenReaderTreeK::Init() // Initialization // Connect base file and file to read from - TTree *ali = gAlice->TreeE(); + TTree *ali = AliRunLoader::Instance()->TreeE(); if (ali) { fBaseFile = ali->GetCurrentFile(); } else { @@ -153,7 +160,7 @@ AliGenReaderTreeK& AliGenReaderTreeK::operator=(const AliGenReaderTreeK& rhs) return *this; } -void AliGenReaderTreeK::Copy(AliGenReaderTreeK&) const +void AliGenReaderTreeK::Copy(TObject&) const { // // Copy @@ -165,6 +172,8 @@ void AliGenReaderTreeK::Copy(AliGenReaderTreeK&) const TString& AliGenReaderTreeK::GetDirName(Int_t entry) { +// Get the current directory name + TString* retval;//return value if (fDirs == 0x0) { @@ -207,3 +216,9 @@ void AliGenReaderTreeK::AddDir(const char* dirname) TObjString *odir= new TObjString(dirname); fDirs->Add(odir); } + +TParticle* AliGenReaderTreeK::GetParticle(Int_t i) + { + if (fStack && iParticle(i); + return 0x0; + }