]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDTZEROfriend.cxx
fixing mem leak in operator=
[u/mrichter/AliRoot.git] / STEER / AliESDTZEROfriend.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 ///
18 /// This is a class for containing T0 time corrected by SPD vertex and amplitude
19 ///
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #include "AliESDTZEROfriend.h"
23
24 ClassImp(AliESDTZEROfriend)
25
26 //_____________________________________________________________________________
27 AliESDTZEROfriend::AliESDTZEROfriend():
28   TObject()
29 {
30   for(int i = 0;i<24;i++)fT0time[i] = fT0ampQTC[i] = fT0ampLEDminCFD[i] = 0;
31
32 AliESDTZEROfriend::AliESDTZEROfriend(const AliESDTZEROfriend &tzero ) :
33   TObject(tzero)
34 {
35   // copy constuctor
36   for(int i = 0;i<24;i++){
37     fT0time[i] = tzero.fT0time[i]; 
38     fT0ampQTC[i] = tzero.fT0ampQTC[i];
39     fT0ampLEDminCFD[i] = tzero.fT0ampLEDminCFD[i];
40   }
41 }
42
43 AliESDTZEROfriend& AliESDTZEROfriend::operator=(const AliESDTZEROfriend& tzero){
44   // assigmnent operator
45   if(this!=&tzero) {
46     TObject::operator=(tzero);
47     for(int i = 0;i<24;i++){
48       fT0time[i] = tzero.fT0time[i]; 
49       fT0ampQTC[i] = tzero.fT0ampQTC[i];
50       fT0ampLEDminCFD[i] = tzero.fT0ampLEDminCFD[i];
51     }
52   } 
53   return *this;
54 }
55
56 void AliESDTZEROfriend::Copy(TObject &obj) const {
57   
58   // this overwrites the virtual TOBject::Copy()
59   // to allow run time copying without casting
60   // in AliESDEvent
61
62   if(this==&obj)return;
63   AliESDTZEROfriend *robj = dynamic_cast<AliESDTZEROfriend*>(&obj);
64   if(!robj)return; // not an AliESDTZEROfriend
65   *robj = *this;
66
67 }
68 void AliESDTZEROfriend::Reset()
69 {
70   // Reset the contents of the object
71     for(int i = 0;i<24;i++)
72       fT0time[i]= fT0ampQTC[i] = fT0ampLEDminCFD[i] =0 ;
73     
74 }
75
76