]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/ESD/AliESDfriend.cxx
make it compile
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDfriend.cxx
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
27 ClassImp(AliESDfriend)
28
29 AliESDfriend::AliESDfriend(): TObject(), fTracks("AliESDfriendTrack",1),
30   fESDVZEROfriend(NULL),
31   fESDTZEROfriend(NULL),
32   fNclustersTPC(),
33   fNclustersTPCused()
34 {
35  //
36  // Default constructor
37  //
38   for (Int_t i=0;i<72;i++)
39   {
40     fNclustersTPC[i]=0;
41     fNclustersTPCused[i]=0;
42   }
43 }
44
45 AliESDfriend::AliESDfriend(const AliESDfriend &f) :
46   TObject(f),
47   AliVfriendEvent(),
48   fTracks(f.fTracks),
49   fESDVZEROfriend(f.fESDVZEROfriend ? new AliESDVZEROfriend(*f.fESDVZEROfriend) : NULL),
50   fESDTZEROfriend(f.fESDTZEROfriend ? new AliESDTZEROfriend(*f.fESDTZEROfriend) : NULL),
51   fNclustersTPC(),
52   fNclustersTPCused()
53 {
54  //
55  // Copy constructor
56  //
57  memcpy(fNclustersTPC,f.fNclustersTPC,sizeof(fNclustersTPC));
58  memcpy(fNclustersTPCused,f.fNclustersTPCused,sizeof(fNclustersTPCused));
59
60 }
61
62 AliESDfriend& AliESDfriend::operator=(const AliESDfriend& esd)
63 {
64     
65     // Assignment operator
66     if(&esd == this) return *this;
67     TObject::operator=(esd);
68     fTracks = esd.fTracks;
69
70     delete fESDVZEROfriend;
71     fESDVZEROfriend = new AliESDVZEROfriend(*esd.fESDVZEROfriend);
72
73     delete fESDTZEROfriend;
74     fESDTZEROfriend = new AliESDTZEROfriend(*esd.fESDTZEROfriend);
75  
76     memcpy(fNclustersTPC,esd.fNclustersTPC,sizeof(fNclustersTPC));
77     memcpy(fNclustersTPCused,esd.fNclustersTPCused,sizeof(fNclustersTPCused));
78  
79  
80     return *this;
81 }
82
83
84
85 AliESDfriend::~AliESDfriend() {
86   //
87   // Destructor
88   //
89   fTracks.Delete();
90   delete fESDVZEROfriend;
91   delete fESDTZEROfriend;
92 }
93
94
95 void AliESDfriend::Reset()
96 {
97   //
98   // Reset friend information
99   //
100   fTracks.Delete();
101   for (Int_t i=0;i<72;i++)
102   {
103     fNclustersTPC[i]=0;
104     fNclustersTPCused[i]=0;
105   }
106   delete fESDVZEROfriend; fESDVZEROfriend=0;
107   delete fESDTZEROfriend; fESDTZEROfriend=0;
108 }  
109
110
111 void AliESDfriend::SetVZEROfriend(AliESDVZEROfriend * obj)
112 {
113   //
114   // Set the VZERO friend data object
115   // (complete raw data)
116   if (!fESDVZEROfriend) fESDVZEROfriend = new AliESDVZEROfriend();
117   if (obj) *fESDVZEROfriend = *obj;
118 }
119 void AliESDfriend::SetTZEROfriend(AliESDTZEROfriend * obj)
120 {
121   //
122   // Set the TZERO friend data object
123   // (complete raw data)
124   if (!fESDTZEROfriend) fESDTZEROfriend = new AliESDTZEROfriend();
125   if (obj) *fESDTZEROfriend = *obj;
126 }