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 notifce *
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 ////////////////////////////////////////////////////
18 // \file AliPhJTrackList.cxx
20 // \author J. Rak, D.J.Kim, R.Diaz (University of Jyvaskyla)
21 // \email: djkim@jyu.fi
22 // \version $Revision: 1.4 $
23 // \date $Date: 2008/05/08 13:44:46 $
25 // Class contains a list (TClonesArray) of tracks
26 /////////////////////////////////////////////////////
28 // $Id: AliPhJTrackList.cxx,v 1.4 2008/05/08 13:44:46 djkim Exp $
30 #include "AliJTrack.h"
31 #include "AliPhJTrackList.h"
35 ClassImp(AliPhJTrackList)
37 #define kNumTracks 1500
39 //______________________________________________________________________________
41 AliPhJTrackList::AliPhJTrackList(expName exp):fTrackList(0x0),fTracks(0){
47 fTrackList = new TClonesArray("AliJTrack",kNumTracks);
52 //______________________________________________________________________________
54 AliPhJTrackList::AliPhJTrackList():fTrackList(0x0),fTracks(0){
56 fTrackList = new TClonesArray("AliJTrack",kNumTracks);
59 //______________________________________________________________________________
61 AliPhJTrackList::AliPhJTrackList(const AliPhJTrackList& a):
63 fTrackList(new TClonesArray(*a.fTrackList)),
69 //______________________________________________________________________________
72 AliPhJTrackList::~AliPhJTrackList(){
78 //______________________________________________________________________________
80 void AliPhJTrackList::Reset(){
83 if(fTracks>kNumTracks){
84 fTrackList->Expand(kNumTracks);
89 //______________________________________________________________________________
91 int AliPhJTrackList::SetTClonesArraySize(const unsigned int ntrk){
94 fTrackList->Expand(kNumTracks);
99 //______________________________________________________________________________
101 void AliPhJTrackList::AddAliJTrack(const unsigned int itrk){
102 //add a new track to the list
103 new((*fTrackList)[itrk]) AliJTrack();
106 //______________________________________________________________________________
108 AliPhJBaseTrack* AliPhJTrackList::GetTrack(const unsigned int itrk){
109 //retrieve a track from the list
110 return (AliPhJBaseTrack*)fTrackList->UncheckedAt(itrk);
113 //______________________________________________________________________________
115 AliJTrack* AliPhJTrackList::GetAliJTrack(const unsigned int itrk){
117 return (AliJTrack*)fTrackList->UncheckedAt(itrk);
121 //______________________________________________________________________________
123 AliPhJTrackList& AliPhJTrackList::operator=(const AliPhJTrackList& list){
126 TObject::operator=(list);
127 fTrackList = list.fTrackList;
128 fTracks = list.fTracks;