/*
$Log$
+Revision 1.17 2001/11/09 09:12:58 morsch
+Generalization by using AliGenReader object to read particles from file.
+
Revision 1.16 2001/07/27 17:09:35 morsch
Use local SetTrack, KeepTrack and SetHighWaterMark methods
to delegate either to local stack or to stack owned by AliRun.
y < fYMin || y > fYMax )
{
printf("\n Not selected %d %f %f %f %f %f", i, theta, phi, pmom, pt, y);
+ delete iparticle;
continue;
}
p[0] = iparticle->Px();
}
}
SetTrack(fTrackIt,-1,idpart,p,origin,polar,0,kPPrimary,nt);
- }
+ delete iparticle;
+ }
TFile *pFile=0;
// Get AliRun object or create it
if (!gAlice) {
/*
$Log$
+Revision 1.1 2001/11/09 09:10:46 morsch
+Realisation of AliGenReader that reads the old cwn event format.
+
*/
// Read the old ALICE event format based on CW-ntuples
fTreeNtuple = 0;
}
+AliGenReaderCwn::~AliGenReaderCwn()
+{
+ delete fTreeNtuple;
+}
+
void AliGenReaderCwn::Init()
{
//
+AliGenReaderCwn& AliGenReaderCwn::operator=(const AliGenReaderCwn& rhs)
+{
+// Assignment operator
+ return *this;
+}
AliGenReaderCwn();
AliGenReaderCwn(const AliGenReaderCwn &reader){;}
- virtual ~AliGenReaderCwn(){;}
- // Initialise
+ virtual ~AliGenReaderCwn();
+ // Initialise
virtual void Init();
// Read
virtual Int_t NextEvent();
virtual TParticle* NextParticle();
- AliGenReaderCwn & operator=(const AliGenReader & rhs){return *this;}
+ AliGenReaderCwn & operator=(const AliGenReaderCwn & rhs);
protected:
Int_t fNcurrent; // points to the next entry
Int_t fNparticle; // particle number in event
/*
$Log$
+Revision 1.1 2001/11/09 09:11:24 morsch
+Realisation of AliGenReader that reads the kine tree (TreeK).
+
*/
#include <TFile.h>
#include <TTree.h>
fNparticle = 0;
fFile = 0;
fBaseFile = 0;
+ fTreeE = 0;
+}
+
+AliGenReaderTreeK::~AliGenReaderTreeK()
+{
+// Destructor
+ delete fTreeE;
}
void AliGenReaderTreeK::Init()
fStack = new AliStack(1000);
fFile->cd();
// Connect treeE
- TTree* treeE = (TTree*)gDirectory->Get("TE");
- treeE->ls();
+ if (fTreeE) {
+ delete fTreeE;
+ } else {
+ fTreeE = (TTree*)gDirectory->Get("TE");
+ }
+
if (fHeader) delete fHeader;
fHeader = 0;
- treeE->SetBranchAddress("Header", &fHeader);
+ fTreeE->SetBranchAddress("Header", &fHeader);
// Get next event
- treeE->GetEntry(fNcurrent);
+ fTreeE->GetEntry(fNcurrent);
fStack = fHeader->Stack();
fStack->GetEvent(fNcurrent);
+AliGenReaderTreeK& AliGenReaderTreeK::operator=(const AliGenReaderTreeK& rhs)
+{
+// Assignment operator
+ return *this;
+}
{
public:
AliGenReaderTreeK();
-
AliGenReaderTreeK(const AliGenReaderTreeK &reader){;}
- virtual ~AliGenReaderTreeK(){;}
+ virtual ~AliGenReaderTreeK();
// Initialise
virtual void Init();
// Read
virtual Int_t NextEvent();
virtual TParticle* NextParticle();
- AliGenReaderTreeK & operator=(const AliGenReader & rhs){return *this;}
+ AliGenReaderTreeK & operator=(const AliGenReader & rhs);
+
protected:
Int_t fNcurrent; // points to the next entry
Int_t fNparticle; // Next particle in list
TFile *fBaseFile; //! pointer to base file
AliStack *fStack; //! Particle stack
AliHeader *fHeader; //! Pointer to event header
+ TTree *fTreeE; //! Pointer to header tree
ClassDef(AliGenReaderTreeK,1) // Read particles from TreeK
};
#endif