]>
Commit | Line | Data |
---|---|---|
1b446896 | 1 | #ifndef ALIHBTEvent_H |
2 | #define ALIHBTEvent_H | |
8089a083 | 3 | //__________________________________________________________ |
4 | /////////////////////////////////////////////////////////////////// | |
5 | // | |
6 | // class AliHBTEvent | |
7 | // | |
8 | // This class is container for paticles coming from one event | |
9 | // | |
10 | // more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html | |
11 | // | |
12 | // Piotr.Skowronski@cern.ch | |
13 | // | |
14 | /////////////////////////////////////////////////////////////////// | |
1b446896 | 15 | |
16 | #include <TObject.h> | |
17 | ||
18 | class AliHBTParticle; | |
19 | class TParticle; | |
20 | class AliHBTEvent: public TObject | |
21 | { | |
22 | public: | |
23 | AliHBTEvent(); | |
24 | virtual ~AliHBTEvent(); | |
8089a083 | 25 | const static UInt_t fgkInitEventSize; //initial number of the array |
aa4e0a70 | 26 | //if expanded, this size is used also |
1b446896 | 27 | AliHBTParticle* GetParticle(Int_t n); //gets particle |
28 | AliHBTParticle* GetParticleSafely(Int_t n); //gets particle with index check | |
29 | ||
8089a083 | 30 | void AddParticle(AliHBTParticle*); //adds particle to the event |
31 | void AddParticle(TParticle*, Int_t idx); //adds particle to the event | |
32 | void AddParticle(Int_t pdg, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot, | |
1b446896 | 33 | Double_t vx, Double_t vy, Double_t vz, Double_t time); |
34 | ||
35 | Int_t GetNumberOfParticles() const; | |
cea431b6 | 36 | void Reset(); //deletes all entries |
37 | void SetOwner(Bool_t owns = kTRUE){ fOwner = owns; } | |
8089a083 | 38 | Bool_t IsOwner() {return fOwner;} |
aa4e0a70 | 39 | |
1b446896 | 40 | protected: |
41 | AliHBTParticle ** fParticles; //!array of pointers to the particles | |
cea431b6 | 42 | Int_t fNParticles; //!number of particles in Event |
8089a083 | 43 | Int_t fSize; //!current size of the array |
cea431b6 | 44 | Bool_t fOwner; //flag if that event owns the |
45 | void Expand(); //expands the array if necessary | |
aa4e0a70 | 46 | |
1b446896 | 47 | private: |
1b446896 | 48 | ClassDef(AliHBTEvent,1) |
49 | }; | |
50 | /**************************************************************************/ | |
51 | ||
52 | inline | |
53 | AliHBTParticle* AliHBTEvent::GetParticle(Int_t n) | |
54 | { | |
55 | //Gets particle without boundary check | |
56 | return fParticles[n]; | |
57 | } | |
58 | ||
59 | /**************************************************************************/ | |
60 | ||
61 | inline | |
62 | Int_t AliHBTEvent::GetNumberOfParticles() const | |
63 | { | |
64 | //reurns number of particles in this event | |
65 | return fNParticles; | |
66 | } | |
67 | ||
68 | #endif |