]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/ESD/AliESDfriend.cxx
doxy: do not show whitespace diffs on bulk edit
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDfriend.cxx
CommitLineData
1d99986f 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 AliESDfriend class
18// This class contains some additional to the ESD information like
19// the clusters associated to tracks.
20// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
21//-------------------------------------------------------------------------
22
23#include "AliESDfriend.h"
73df58ab 24#include "AliESDVZEROfriend.h"
25#include "AliESDTZEROfriend.h"
7d96454a 26#include "AliESDADfriend.h"
1d99986f 27
28ClassImp(AliESDfriend)
29
14055182 30AliESDfriend::AliESDfriend(): AliVfriendEvent(), fTracks("AliESDfriendTrack",1),
73df58ab 31 fESDVZEROfriend(NULL),
5576d489 32 fESDTZEROfriend(NULL),
7d96454a 33 fESDADfriend(NULL),
5576d489 34 fNclustersTPC(),
35 fNclustersTPCused()
1d99986f 36{
37 //
38 // Default constructor
39 //
5576d489 40 for (Int_t i=0;i<72;i++)
41 {
42 fNclustersTPC[i]=0;
43 fNclustersTPCused[i]=0;
44 }
1d99986f 45}
46
b7ec049a 47AliESDfriend::AliESDfriend(const AliESDfriend &f) :
14055182 48 AliVfriendEvent(f),
b7ec049a 49 fTracks(f.fTracks),
73df58ab 50 fESDVZEROfriend(f.fESDVZEROfriend ? new AliESDVZEROfriend(*f.fESDVZEROfriend) : NULL),
5576d489 51 fESDTZEROfriend(f.fESDTZEROfriend ? new AliESDTZEROfriend(*f.fESDTZEROfriend) : NULL),
7d96454a 52 fESDADfriend(f.fESDADfriend ? new AliESDADfriend(*f.fESDADfriend) : NULL),
5576d489 53 fNclustersTPC(),
54 fNclustersTPCused()
1d99986f 55{
56 //
57 // Copy constructor
58 //
5576d489 59 memcpy(fNclustersTPC,f.fNclustersTPC,sizeof(fNclustersTPC));
60 memcpy(fNclustersTPCused,f.fNclustersTPCused,sizeof(fNclustersTPCused));
61
1d99986f 62}
63
c43af351 64AliESDfriend& AliESDfriend::operator=(const AliESDfriend& esd)
65{
66
67 // Assignment operator
68 if(&esd == this) return *this;
69 TObject::operator=(esd);
70 fTracks = esd.fTracks;
f66f9a4a 71
253bd418 72 delete fESDVZEROfriend;
73 fESDVZEROfriend = new AliESDVZEROfriend(*esd.fESDVZEROfriend);
c43af351 74
253bd418 75 delete fESDTZEROfriend;
76 fESDTZEROfriend = new AliESDTZEROfriend(*esd.fESDTZEROfriend);
7d96454a 77
78 delete fESDADfriend;
79 fESDADfriend = new AliESDADfriend(*esd.fESDADfriend);
73df58ab 80
5576d489 81 memcpy(fNclustersTPC,esd.fNclustersTPC,sizeof(fNclustersTPC));
82 memcpy(fNclustersTPCused,esd.fNclustersTPCused,sizeof(fNclustersTPCused));
73df58ab 83
84
c43af351 85 return *this;
86}
87
88
89
1d99986f 90AliESDfriend::~AliESDfriend() {
91 //
92 // Destructor
93 //
ddfbc51a 94 fTracks.Delete();
95 delete fESDVZEROfriend;
96 delete fESDTZEROfriend;
7d96454a 97 delete fESDADfriend;
b090e6a3 98}
99
73df58ab 100
d9880d92 101void AliESDfriend::Reset()
102{
103 //
104 // Reset friend information
105 //
106 fTracks.Delete();
107 for (Int_t i=0;i<72;i++)
108 {
109 fNclustersTPC[i]=0;
110 fNclustersTPCused[i]=0;
111 }
112 delete fESDVZEROfriend; fESDVZEROfriend=0;
113 delete fESDTZEROfriend; fESDTZEROfriend=0;
7d96454a 114 delete fESDADfriend; fESDADfriend=0;
d9880d92 115}
116
73df58ab 117
b090e6a3 118void AliESDfriend::SetVZEROfriend(AliESDVZEROfriend * obj)
119{
120 //
121 // Set the VZERO friend data object
122 // (complete raw data)
123 if (!fESDVZEROfriend) fESDVZEROfriend = new AliESDVZEROfriend();
124 if (obj) *fESDVZEROfriend = *obj;
1d99986f 125}
73df58ab 126void AliESDfriend::SetTZEROfriend(AliESDTZEROfriend * obj)
127{
128 //
129 // Set the TZERO friend data object
130 // (complete raw data)
131 if (!fESDTZEROfriend) fESDTZEROfriend = new AliESDTZEROfriend();
132 if (obj) *fESDTZEROfriend = *obj;
133}
7d96454a 134void AliESDfriend::SetADfriend(AliESDADfriend * obj)
135{
136 //
137 // Set the AD friend data object
138 // (complete raw data)
139 if (!fESDADfriend) fESDADfriend = new AliESDADfriend();
140 if (obj) *fESDADfriend = *obj;
141}