1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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 //-------------------------------------------------------------------------
22 #include "AliAODevent.h"
23 #include "AliESDVertex.h"
30 AliAODevent::AliAODevent() {
31 fV0s = new TClonesArray("AliAODv0");
32 fCascades = new TClonesArray("AliAODxi");
35 AliAODevent::~AliAODevent() {
39 AliAODevent::AliAODevent(AliESD* e) {
40 // Constructor from an ESD.
41 fV0s = new TClonesArray("AliAODv0");
42 fCascades = new TClonesArray("AliAODxi");
43 fRunNumber = (UInt_t)e->GetRunNumber();
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.
45 fNumberOfTracks = (UInt_t)e->GetNumberOfTracks();
47 const AliESDVertex* esdVertex = e->GetVertex();
48 fPrimVertexX = esdVertex->GetXv();
49 fPrimVertexY = esdVertex->GetYv();
50 fPrimVertexZ = esdVertex->GetZv();
52 for (Int_t i=0; i<e->GetNumberOfV0s(); i++) {
53 AliAODv0* v=new AliAODv0(e->GetV0(i),e);
58 for (Int_t i=0; i<e->GetNumberOfCascades(); i++) {
59 AliAODxi* c=new AliAODxi(e->GetCascade(i),e);
65 AliAODevent::AliAODevent(const AliAODevent& 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)
80 AliAODevent& AliAODevent::operator=(const AliAODevent& aod){
81 // Assignment operator
83 fPrimVertexX = aod.fPrimVertexX;
84 fPrimVertexY = aod.fPrimVertexY;
85 fPrimVertexZ = aod.fPrimVertexZ;
86 fRunNumber = aod.fRunNumber;
87 fEventNumber = aod.fEventNumber;
88 fNumberOfTracks = aod.fNumberOfTracks;
92 fV0s=(TClonesArray*)aod.fV0s->Clone();
93 fCascades=(TClonesArray*)aod.fCascades->Clone();
99 void AliAODevent::AddV0(AliAODv0* v0) {
100 // Adds a V0 in the list.
101 Int_t idx=fV0s->GetEntries();
102 TClonesArray& arr=*fV0s;
103 new(arr[idx]) AliAODv0(*v0);
106 void AliAODevent::AddCascade(AliAODxi* xi) {
107 // Adds a cascade in the list.
108 Int_t idx=fCascades->GetEntries();
109 TClonesArray& arr=*fCascades;
110 new(arr[idx]) AliAODxi(*xi);