Catching up to NewIO -> Particle stores all passible PID and their probabilities
[u/mrichter/AliRoot.git] / HBTAN / AliHBTRun.cxx
CommitLineData
1b446896 1#include "AliHBTRun.h"
2
3#include <TObjArray.h>
4
e1c43ab8 5//____________________
6///////////////////////////////////////////////////////
7// //
8// AliHBTRun //
9// //
10// Class storing and managing events //
11// //
12// Piotr.Skowronski@cern.ch //
13// http://alisoft.cern.ch/people/skowron/analyzer //
14// //
15///////////////////////////////////////////////////////
1b446896 16
17ClassImp(AliHBTRun)
18/**************************************************************************/
19
20AliHBTRun::AliHBTRun()
e1c43ab8 21{
22 //contructor
23 fEvents = new TObjArray();//create array for AliHBTEvents
24 if(!fEvents) Fatal("AliHBTRun::AliHBTRun","Can not allocate memory");
25 fEvents->SetOwner(); //array is an owner: when is deleted or cleared it deletes objects that it contains
26}
1b446896 27/**************************************************************************/
1b446896 28
e1c43ab8 29AliHBTRun::~AliHBTRun()
30{
31 //destructor
32 delete fEvents;//delete array with events
33}
1b446896 34/**************************************************************************/
e1c43ab8 35
1b446896 36void AliHBTRun::Reset()
37 {
38 fEvents->Clear();//clear an array with events.
39 //All events are deleted because array is an owner (set in constructor)
40 }
41/**************************************************************************/
42
1b446896 43void AliHBTRun::AddParticle(Int_t event, AliHBTParticle* part)
44{
45 //Adds particle to event
1b446896 46 //if there is no event of this number, crate it and add to the collection
47 if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliHBTEvent, event);
48
49 GetEvent(event)->AddParticle(part);
50}
51/**************************************************************************/
52
8089a083 53void AliHBTRun::AddParticle(Int_t event, TParticle* part, Int_t idx)
1b446896 54{
55 //if there is no event of this number, crate it and add to the collection
56 if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliHBTEvent, event);
8089a083 57 GetEvent(event)->AddParticle(part,idx);
1b446896 58}
59/**************************************************************************/
60
8089a083 61void AliHBTRun::AddParticle(Int_t event, Int_t pdg, Int_t idx,
1b446896 62 Double_t px, Double_t py, Double_t pz, Double_t etot,
63 Double_t vx, Double_t vy, Double_t vz, Double_t time)
64{
65 //if there is no event of this number, crate it and add to the collection
66 if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliHBTEvent, event);
8089a083 67 GetEvent(event)->AddParticle(pdg,idx,px,py,pz,etot,vx,vy,vz,time);
1b446896 68}
69
70/**************************************************************************/