]>
Commit | Line | Data |
---|---|---|
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 | |
17 | ClassImp(AliHBTRun) | |
18 | /**************************************************************************/ | |
19 | ||
20 | AliHBTRun::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 | 29 | AliHBTRun::~AliHBTRun() |
30 | { | |
31 | //destructor | |
32 | delete fEvents;//delete array with events | |
33 | } | |
1b446896 | 34 | /**************************************************************************/ |
e1c43ab8 | 35 | |
1b446896 | 36 | void 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 | 43 | void 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 | ||
1b446896 | 53 | void AliHBTRun::AddParticle(Int_t event, TParticle* part) |
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); | |
57 | GetEvent(event)->AddParticle(part); | |
58 | } | |
59 | /**************************************************************************/ | |
60 | ||
1b446896 | 61 | void AliHBTRun::AddParticle(Int_t event, Int_t pdg, |
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); | |
67 | GetEvent(event)->AddParticle(pdg,px,py,pz,etot,vx,vy,vz,time); | |
68 | } | |
69 | ||
70 | /**************************************************************************/ |