]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDfriend.cxx
ea8e1de5516d3dd6592f89a2ac07ed1a88707ad3
[u/mrichter/AliRoot.git] / STEER / 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 "AliESDfriendTrack.h"
25 #include "AliESD.h"
26
27 ClassImp(AliESDfriend)
28
29 AliESDfriend::AliESDfriend(): TObject(), fTracks("AliESDfriendTrack",15000)
30 {
31  //
32  // Default constructor
33  //
34 }
35
36 AliESDfriend::AliESDfriend(const AliESDfriend &f):TObject(f),fTracks(f.fTracks)
37 {
38  //
39  // Copy constructor
40  //
41 }
42
43 AliESDfriend::AliESDfriend(const AliESD &event): TObject(event),
44 fTracks("AliESDfriendTrack",event.GetNumberOfTracks()) {
45   //
46   // Extracts the additional info from the ESD
47   //
48   Int_t ntrk=event.GetNumberOfTracks();
49
50   for (Int_t i=0; i<ntrk; i++) {
51     const AliESDtrack *t=event.GetTrack(i);
52     AliESDfriendTrack *ft=(AliESDfriendTrack *)t->GetFriendTrack();
53     ft->Set1P(t->Get1P());
54     new (fTracks[fTracks.GetEntriesFast()]) AliESDfriendTrack(*ft); 
55   }
56 }
57
58 AliESDfriend::~AliESDfriend() {
59   //
60   // Destructor
61   //
62   fTracks.Delete();
63 }