7 /**************************************************************************/
13 fEvents = new TObjArray();//create array for AliHBTEvents
14 if(!fEvents) Fatal("AliHBTRun::AliHBTRun","Can not allocate memory");
15 fEvents->SetOwner(); //array is an owner: when is deleted or cleared it deletes objects that it contains
17 /**************************************************************************/
18 AliHBTRun::~AliHBTRun()
22 delete fEvents;//delete array with events
26 /**************************************************************************/
27 void AliHBTRun::Reset()
29 fEvents->Clear();//clear an array with events.
30 //All events are deleted because array is an owner (set in constructor)
32 /**************************************************************************/
35 void AliHBTRun::AddParticle(Int_t event, AliHBTParticle* part)
37 //Adds particle to event
39 //if there is no event of this number, crate it and add to the collection
40 if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliHBTEvent, event);
42 GetEvent(event)->AddParticle(part);
44 /**************************************************************************/
47 void AliHBTRun::AddParticle(Int_t event, TParticle* part)
49 //if there is no event of this number, crate it and add to the collection
50 if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliHBTEvent, event);
51 GetEvent(event)->AddParticle(part);
53 /**************************************************************************/
56 void AliHBTRun::AddParticle(Int_t event, Int_t pdg,
57 Double_t px, Double_t py, Double_t pz, Double_t etot,
58 Double_t vx, Double_t vy, Double_t vz, Double_t time)
60 //if there is no event of this number, crate it and add to the collection
61 if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliHBTEvent, event);
62 GetEvent(event)->AddParticle(pdg,px,py,pz,etot,vx,vy,vz,time);
65 /**************************************************************************/