**************************************************************************/
/* $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 <TFile.h>
#include <TTree.h>
#include <TParticle.h>
#include "AliGenReaderTreeK.h"
#include "AliHeader.h"
#include "AliRun.h"
+#include "AliStack.h"
#include "AliRunLoader.h"
-ClassImp(AliGenReaderTreeK);
+ClassImp(AliGenReaderTreeK)
const TString AliGenReaderTreeK::fgkEventFolderName("GenReaderTreeK");
// Initialization
// Connect base file and file to read from
- TTree *ali = gAlice->TreeE();
+ TTree *ali = AliRunLoader::Instance()->TreeE();
if (ali) {
fBaseFile = ali->GetCurrentFile();
} else {
return *this;
}
-void AliGenReaderTreeK::Copy(AliGenReaderTreeK&) const
+void AliGenReaderTreeK::Copy(TObject&) const
{
//
// Copy
TString& AliGenReaderTreeK::GetDirName(Int_t entry)
{
+// Get the current directory name
+
TString* retval;//return value
if (fDirs == 0x0)
{
TObjString *odir= new TObjString(dirname);
fDirs->Add(odir);
}
+
+TParticle* AliGenReaderTreeK::GetParticle(Int_t i)
+ {
+ if (fStack && i<fNp) return fStack->Particle(i);
+ return 0x0;
+ }