]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESDfriendTrack.cxx
Effective C++ initialization of data members in the default constructor
[u/mrichter/AliRoot.git] / STEER / AliESDfriendTrack.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 AliESDfriendTrack class
18// This class keeps complementary to the AliESDtrack information
19// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
20//-------------------------------------------------------------------------
21#include "AliTrackPointArray.h"
22#include "AliESDfriendTrack.h"
23#include "AliESD.h"
24
25ClassImp(AliESDfriendTrack)
26
27 AliESDfriendTrack::AliESDfriendTrack(): TObject(), f1P(0), fPoints(0) {
28 //
29 // Default constructor
30 //
31 Int_t i;
32 for (i=0; i<AliESDtrack::kMaxITScluster; i++) fITSindex[i]=-2;
33 for (i=0; i<AliESDtrack::kMaxTPCcluster; i++) fTPCindex[i]=-2;
34 for (i=0; i<AliESDtrack::kMaxTRDcluster; i++) fTRDindex[i]=-2;
35}
36
37AliESDfriendTrack::AliESDfriendTrack(const AliESDfriendTrack &t):
38TObject(t),
39f1P(t.f1P),
40fPoints(0)
41{
42 //
43 // Copy constructor
44 //
45 Int_t i;
46 for (i=0; i<AliESDtrack::kMaxITScluster; i++) fITSindex[i]=t.fITSindex[i];
47 for (i=0; i<AliESDtrack::kMaxTPCcluster; i++) fTPCindex[i]=t.fTPCindex[i];
48 for (i=0; i<AliESDtrack::kMaxTRDcluster; i++) fTRDindex[i]=t.fTRDindex[i];
49 if (t.fPoints) fPoints=new AliTrackPointArray(*t.fPoints);
50}
51
52AliESDfriendTrack::AliESDfriendTrack(const AliESDtrack &t):
53TObject(t),
54f1P(t.Get1P()),
55fPoints(0)
56{
57 //
58 // Extracts the complementary info from the ESD track
59 //
60 t.GetITSclusters(fITSindex);
61 t.GetTPCclusters(fTPCindex);
62 t.GetTRDclusters(fTRDindex);
63 const AliTrackPointArray *points=t.GetTrackPointArray();
64 if (points) fPoints=new AliTrackPointArray(*points);
65}
66
67AliESDfriendTrack::~AliESDfriendTrack() {delete fPoints;}