AliRoot Core  edcc906 (edcc906)
AliESDfriend.cxx
Go to the documentation of this file.
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"
24 #include "AliESDVZEROfriend.h"
25 #include "AliESDTZEROfriend.h"
26 #include "AliESDADfriend.h"
27 
28 ClassImp(AliESDfriend)
29 
31  fESDIndicesStored(kFALSE),
32  fTracks("AliESDfriendTrack",1),
33  fESDVZEROfriend(NULL),
34  fESDTZEROfriend(NULL),
35  fESDADfriend(NULL)
36 {
37  //
38  // Default constructor
39  //
40  fTracks.SetOwner(kTRUE);
41  memset(fNclustersTPC,0,sizeof(fNclustersTPC));
42  memset(fNclustersTPCused,0,sizeof(fNclustersTPCused));
43 }
44 
46  AliVfriendEvent(f),
47  fESDIndicesStored(f.fESDIndicesStored),
48  fTracks(f.fTracks),
49  fESDVZEROfriend(f.fESDVZEROfriend ? new AliESDVZEROfriend(*f.fESDVZEROfriend) : NULL),
50  fESDTZEROfriend(f.fESDTZEROfriend ? new AliESDTZEROfriend(*f.fESDTZEROfriend) : NULL),
51  fESDADfriend(f.fESDADfriend ? new AliESDADfriend(*f.fESDADfriend) : NULL)
52 {
53  //
54  // Copy constructor
55  //
56  memcpy(fNclustersTPC,f.fNclustersTPC,sizeof(fNclustersTPC));
58 
59 }
60 
62 {
63 
64  // Assignment operator
65  if(&esd == this) return *this;
66  TObject::operator=(esd);
68  // Clean up the old TClonesArray
70  // fTracks.Delete();
71  // Assign the new one
72  fTracks = esd.fTracks;
73 
74  if(fESDVZEROfriend)
75  delete fESDVZEROfriend;
77  if(esd.fESDVZEROfriend)
79 
80  if(fESDTZEROfriend)
81  delete fESDTZEROfriend;
83  if(esd.fESDTZEROfriend)
85 
86  if(fESDADfriend)
87  delete fESDADfriend;
88  fESDADfriend=0;
89  if(esd.fESDADfriend)
91 
92  memcpy(fNclustersTPC,esd.fNclustersTPC,sizeof(fNclustersTPC));
94 
95 
96  return *this;
97 }
98 
99 
100 
102  //
103  // Destructor
104  //
106  //fTracks.Delete();
107  if(fESDVZEROfriend)
108  delete fESDVZEROfriend;
109  fESDVZEROfriend=0;
110  if(fESDTZEROfriend)
111  delete fESDTZEROfriend;
112  fESDTZEROfriend=0;
113  if(fESDADfriend)
114  delete fESDADfriend;
115  fESDADfriend=0;
116 }
117 
119 {
120  // delete tracks taking care of eventual shared objects in the tracks (e.g. TPCclusters)
121  int ntr=fTracks.GetEntriesFast();
122  for (int i=0;i<ntr;i++) {
125  }
126  fTracks.Delete();
127 }
128 
130 {
131  // Reset friend information, used for the shalow copy
132  for (int i=fTracks.GetEntriesFast();i--;) fTracks[i]->Clear();
133  fTracks.Clear();
134  for (Int_t i=0;i<72;i++)
135  {
136  fNclustersTPC[i]=0;
137  fNclustersTPCused[i]=0;
138  }
141  delete fESDADfriend; fESDADfriend=0;
142 }
143 
144 
146 {
147  //
148  // Reset friend information
149  //
151  // fTracks.Delete();
152  for (Int_t i=0;i<72;i++)
153  {
154  fNclustersTPC[i]=0;
155  fNclustersTPCused[i]=0;
156  }
159  delete fESDADfriend; fESDADfriend=0;
160 }
161 
163 {
164  //
165  // Set the VZERO friend data object
166  // (complete raw data)
168  if (obj) *fESDVZEROfriend = *obj;
169 }
171 {
172  //
173  // Set the TZERO friend data object
174  // (complete raw data)
176  if (obj) *fESDTZEROfriend = *obj;
177 }
179 {
180  //
181  // Set the AD friend data object
182  // (complete raw data)
184  if (obj) *fESDADfriend = *obj;
185 }
void SetTZEROfriend(AliESDTZEROfriend *obj)
void TagSuppressSharedObjectsBeforeDeletion()
Int_t fNclustersTPC[72]
Definition: AliESDfriend.h:96
Bool_t fESDIndicesStored
Definition: AliESDfriend.h:90
void SetVZEROfriend(const AliESDVZEROfriend *obj)
AliESDTZEROfriend * fESDTZEROfriend
Definition: AliESDfriend.h:93
void Clear()
Add comment.
AliESDVZEROfriend * fESDVZEROfriend
Definition: AliESDfriend.h:92
Int_t fNclustersTPCused[72]
Definition: AliESDfriend.h:97
TF1 * f
Definition: interpolTest.C:21
void DeleteTracksSafe()
AliESDADfriend * fESDADfriend
Definition: AliESDfriend.h:94
virtual ~AliESDfriend()
void SetADfriend(AliESDADfriend *obj)
AliESDfriend & operator=(const AliESDfriend &esd)
TClonesArray fTracks
Definition: AliESDfriend.h:91