]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliAOD.h
2688f3ba657f8a62165c21e045a2ce32af029273
[u/mrichter/AliRoot.git] / ANALYSIS / AliAOD.h
1 #ifndef ALIAOD_H
2 #define ALIAOD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 /////////////////////////////////////////////////////////////
9 //
10 // base class for AOD containers
11 //
12 /////////////////////////////////////////////////////////////
13
14 #include <TObject.h>
15 #include <TClonesArray.h>
16 #include "AliVAODParticle.h"
17
18 class TParticle;
19
20 class AliAOD: public TObject {
21 public:
22   AliAOD();
23   virtual ~AliAOD();
24
25   virtual TClonesArray*    GetParticles() {return fParticles;};
26   virtual void             SetParticleClassName(const char* classname);
27   virtual void             SetParticleClass(TClass* pclass);
28   
29   virtual Int_t            GetNumberOfParticles() const  {return (fParticles)?fParticles->GetEntriesFast():0;}
30   virtual AliVAODParticle* GetParticle(Int_t index) const {return  (fParticles)?(AliVAODParticle*)fParticles->At(index):0x0;}
31   virtual void             AddParticle(AliVAODParticle* particle);
32   virtual void             AddParticle(TParticle* part, Int_t idx); //adds particle to the event
33   virtual void             AddParticle(Int_t pdg, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
34                                        Double_t vx, Double_t vy, Double_t vz, Double_t time);
35   
36   virtual void             Reset();
37   void                     SwapParticles(Int_t i, Int_t j);//swaps particles positions; used by AliReader::Blend
38   Bool_t                   IsRandomized() const {return fIsRandomized;}
39   void                     SetRandomized(Bool_t flag = kTRUE){fIsRandomized = flag;}
40   
41   void                     GetPrimaryVertex(Double_t&x, Double_t&y, Double_t&z);
42   void                     SetPrimaryVertex(Double_t x, Double_t y, Double_t z);
43   
44   Int_t                    GetNumberOfCharged(Double_t etamin = -10.0, Double_t etamax = 10.0) const;
45   void                     Move(Double_t x, Double_t y, Double_t z);//moves all spacial coordinates about this vector
46   virtual void             SetOwner(Bool_t owner);
47   virtual void             Print(Option_t* /*option*/ = 0);
48 private:
49   TClonesArray            *fParticles;   // array of AOD particles, AliAOD is owner of particles
50   Bool_t                   fIsRandomized;//flag indicating if positions of particles were randomized - used by HBTAN
51   Double_t                 fPrimaryVertexX;//X position of the primary vertex
52   Double_t                 fPrimaryVertexY;//Y position of the primary vertex
53   Double_t                 fPrimaryVertexZ;//Z position of the primary vertex
54   TClass*                  fParticleClass;//object that defines type of the particle       
55   
56   ClassDef(AliAOD,1)  // base class for AOD containers
57 };
58
59 #endif