]>
Commit | Line | Data |
---|---|---|
c028b974 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //------------------------------------------------------------------------- | |
17 | // Implementation of the Analysis Oriented Data (AOD) event summary | |
18 | // Purpose : container of event important information for soft analysis | |
19 | // Author : Renaud Vernet, IPHC, Strasbourg | |
20 | //------------------------------------------------------------------------- | |
21 | ||
22 | #include "AliAODevent.h" | |
23 | #include "AliESDVertex.h" | |
24 | #include "AliESD.h" | |
25 | #include "AliAODv0.h" | |
26 | #include "AliAODxi.h" | |
27 | ||
8e32596a | 28 | ClassImp(AliAODevent) |
c028b974 | 29 | |
30 | AliAODevent::AliAODevent() { | |
31 | fV0s = new TClonesArray("AliAODv0"); | |
32 | fCascades = new TClonesArray("AliAODxi"); | |
33 | } | |
34 | ||
35 | AliAODevent::~AliAODevent() { | |
36 | delete fV0s; | |
37 | } | |
38 | ||
39 | AliAODevent::AliAODevent(AliESD* e) { | |
bd4febd5 | 40 | // Constructor from an ESD. |
c028b974 | 41 | fV0s = new TClonesArray("AliAODv0"); |
42 | fCascades = new TClonesArray("AliAODxi"); | |
43 | fRunNumber = (UInt_t)e->GetRunNumber(); | |
31fd97b2 | 44 | fEventNumber = (UInt_t)e->GetEventNumberInFile(); // This is most likely NOT the event number you'd like to use. It has nothing to do with the 'real' event number. |
c028b974 | 45 | fNumberOfTracks = (UInt_t)e->GetNumberOfTracks(); |
46 | ||
bd4febd5 | 47 | const AliESDVertex* esdVertex = e->GetVertex(); |
48 | fPrimVertexX = esdVertex->GetXv(); | |
49 | fPrimVertexY = esdVertex->GetYv(); | |
50 | fPrimVertexZ = esdVertex->GetZv(); | |
c028b974 | 51 | |
52 | for (Int_t i=0; i<e->GetNumberOfV0s(); i++) { | |
53 | AliAODv0* v=new AliAODv0(e->GetV0(i),e); | |
54 | this->AddV0(v); | |
55 | delete v; | |
56 | } | |
57 | ||
58 | for (Int_t i=0; i<e->GetNumberOfCascades(); i++) { | |
59 | AliAODxi* c=new AliAODxi(e->GetCascade(i),e); | |
60 | this->AddCascade(c); | |
61 | delete c; | |
62 | } | |
63 | } | |
64 | ||
65 | AliAODevent::AliAODevent(const AliAODevent& aod) : | |
66 | TObject(aod), | |
67 | fV0s((TClonesArray*)aod.fV0s->Clone()), | |
68 | fCascades((TClonesArray*)aod.fCascades->Clone()), | |
69 | fPrimVertexX(aod.fPrimVertexX), | |
70 | fPrimVertexY(aod.fPrimVertexY), | |
71 | fPrimVertexZ(aod.fPrimVertexZ), | |
72 | fRunNumber(aod.fRunNumber), | |
73 | fEventNumber(aod.fEventNumber), | |
74 | fNumberOfTracks(aod.fNumberOfTracks) | |
75 | { | |
bd4febd5 | 76 | // Copy constructor. |
c028b974 | 77 | } |
78 | ||
79 | ||
80 | AliAODevent& AliAODevent::operator=(const AliAODevent& aod){ | |
bd4febd5 | 81 | // Assignment operator |
c028b974 | 82 | if(this!=&aod) { |
83 | fPrimVertexX = aod.fPrimVertexX; | |
84 | fPrimVertexY = aod.fPrimVertexY; | |
85 | fPrimVertexZ = aod.fPrimVertexZ; | |
86 | fRunNumber = aod.fRunNumber; | |
87 | fEventNumber = aod.fEventNumber; | |
88 | fNumberOfTracks = aod.fNumberOfTracks; | |
89 | ||
90 | delete fV0s; | |
91 | delete fCascades; | |
92 | fV0s=(TClonesArray*)aod.fV0s->Clone(); | |
93 | fCascades=(TClonesArray*)aod.fCascades->Clone(); | |
94 | } | |
95 | return *this; | |
96 | } | |
97 | ||
98 | ||
99 | void AliAODevent::AddV0(AliAODv0* v0) { | |
bd4febd5 | 100 | // Adds a V0 in the list. |
c028b974 | 101 | Int_t idx=fV0s->GetEntries(); |
102 | TClonesArray& arr=*fV0s; | |
103 | new(arr[idx]) AliAODv0(*v0); | |
104 | } | |
105 | ||
106 | void AliAODevent::AddCascade(AliAODxi* xi) { | |
bd4febd5 | 107 | // Adds a cascade in the list. |
c028b974 | 108 | Int_t idx=fCascades->GetEntries(); |
109 | TClonesArray& arr=*fCascades; | |
110 | new(arr[idx]) AliAODxi(*xi); | |
111 | } |