This commit was generated by cvs2svn to compensate for changes in r4472,
[u/mrichter/AliRoot.git] / HBTAN / AliHBTRun.h
1 #ifndef ALIHBTRUN_H
2 #define ALIHBTRUN_H
3
4 #include "AliHBTEvent.h"
5 #include <TObjArray.h>
6
7 //class describing set of events (the run)
8 //designed for fast acces
9 //Piotr.Skowronski@cern.ch
10
11 class AliHBTParticle;
12
13 class AliHBTEvent;
14
15 class AliHBTRun: public TObject
16  {
17   public:
18     AliHBTRun();
19     virtual ~AliHBTRun();
20
21     void            AddParticle(Int_t event, AliHBTParticle* part); //inerface to AliHBTEvent::AddParticle(AliHBTParticle*) 
22     void            AddParticle(Int_t event, TParticle* part);//inerface to AliHBTEvent::AddParticle(TParticle*) 
23     
24     //inerface to AliHBTEvent::AddParticle(Int_t.Double_t,Double_t,Double_t,Double_t,Double_t,Double_t,Double_t,Double_t,Double_t)
25     void            AddParticle(Int_t event, Int_t pdg, 
26                                 Double_t px, Double_t py, Double_t pz, Double_t etot,
27                                 Double_t vx, Double_t vy, Double_t vz, Double_t time); 
28     
29     AliHBTParticle* GetParticle(Int_t event, Int_t n); //returns nth particle from event
30     AliHBTEvent*    GetEvent(Int_t event) const; //returns AliHBTEvent number "event"
31     
32     Int_t           GetNumberOfEvents() const; //returns number of events
33     Int_t               GetNumberOfParticlesInEvent(Int_t event) const; //returns number of particles in event number "event"
34     void            Reset();//clears all events in the array (deletes)
35   protected:
36     TObjArray* fEvents;//!Array containig AliHBTEvents
37   private:
38     
39   public:
40     ClassDef(AliHBTRun,1)
41  };
42  
43  
44 /**************************************************************************/
45
46 inline
47 AliHBTEvent* AliHBTRun::GetEvent(Int_t event) const
48 {
49 //returns pointer to AliHBTEvent number "event"
50   
51   return (AliHBTEvent*)fEvents->At(event);
52 }
53 /**************************************************************************/
54 inline
55 AliHBTParticle* AliHBTRun::GetParticle(Int_t event, Int_t n) 
56 {
57  //returns nth particle from event number event
58   return GetEvent(event)->GetParticle(n);
59 }
60
61 /**************************************************************************/
62
63 inline
64 Int_t AliHBTRun::GetNumberOfEvents() const
65  {
66 //returns number of events in collection
67
68    return fEvents->GetEntriesFast(); //there may be empty slots but we do not care
69                                      //Analysis checks it if return is not NULL
70  }
71 /**************************************************************************/
72
73 inline
74 Int_t AliHBTRun::GetNumberOfParticlesInEvent(Int_t event) const
75 {
76 //returns number of Particles in event 
77   return GetEvent(event)->GetNumberOfParticles();
78 }
79  
80 #endif