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 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 //-------------------------------------------------------------------------
23 #include "AliESDfriend.h"
24 #include "AliESDVZEROfriend.h"
25 #include "AliESDTZEROfriend.h"
26 #include "AliESDADfriend.h"
28 ClassImp(AliESDfriend)
30 AliESDfriend::AliESDfriend(): AliVfriendEvent(), fTracks("AliESDfriendTrack",1),
31 fESDVZEROfriend(NULL),
32 fESDTZEROfriend(NULL),
38 // Default constructor
40 for (Int_t i=0;i<72;i++)
43 fNclustersTPCused[i]=0;
47 AliESDfriend::AliESDfriend(const AliESDfriend &f) :
50 fESDVZEROfriend(f.fESDVZEROfriend ? new AliESDVZEROfriend(*f.fESDVZEROfriend) : NULL),
51 fESDTZEROfriend(f.fESDTZEROfriend ? new AliESDTZEROfriend(*f.fESDTZEROfriend) : NULL),
52 fESDADfriend(f.fESDADfriend ? new AliESDADfriend(*f.fESDADfriend) : NULL),
59 memcpy(fNclustersTPC,f.fNclustersTPC,sizeof(fNclustersTPC));
60 memcpy(fNclustersTPCused,f.fNclustersTPCused,sizeof(fNclustersTPCused));
64 AliESDfriend& AliESDfriend::operator=(const AliESDfriend& esd)
67 // Assignment operator
68 if(&esd == this) return *this;
69 TObject::operator=(esd);
70 fTracks = esd.fTracks;
72 delete fESDVZEROfriend;
73 fESDVZEROfriend = new AliESDVZEROfriend(*esd.fESDVZEROfriend);
75 delete fESDTZEROfriend;
76 fESDTZEROfriend = new AliESDTZEROfriend(*esd.fESDTZEROfriend);
79 fESDADfriend = new AliESDADfriend(*esd.fESDADfriend);
81 memcpy(fNclustersTPC,esd.fNclustersTPC,sizeof(fNclustersTPC));
82 memcpy(fNclustersTPCused,esd.fNclustersTPCused,sizeof(fNclustersTPCused));
90 AliESDfriend::~AliESDfriend() {
95 delete fESDVZEROfriend;
96 delete fESDTZEROfriend;
101 void AliESDfriend::Reset()
104 // Reset friend information
107 for (Int_t i=0;i<72;i++)
110 fNclustersTPCused[i]=0;
112 delete fESDVZEROfriend; fESDVZEROfriend=0;
113 delete fESDTZEROfriend; fESDTZEROfriend=0;
114 delete fESDADfriend; fESDADfriend=0;
118 void AliESDfriend::SetVZEROfriend(AliESDVZEROfriend * obj)
121 // Set the VZERO friend data object
122 // (complete raw data)
123 if (!fESDVZEROfriend) fESDVZEROfriend = new AliESDVZEROfriend();
124 if (obj) *fESDVZEROfriend = *obj;
126 void AliESDfriend::SetTZEROfriend(AliESDTZEROfriend * obj)
129 // Set the TZERO friend data object
130 // (complete raw data)
131 if (!fESDTZEROfriend) fESDTZEROfriend = new AliESDTZEROfriend();
132 if (obj) *fESDTZEROfriend = *obj;
134 void AliESDfriend::SetADfriend(AliESDADfriend * obj)
137 // Set the AD friend data object
138 // (complete raw data)
139 if (!fESDADfriend) fESDADfriend = new AliESDADfriend();
140 if (obj) *fESDADfriend = *obj;