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 // $Id: AliPhJMCTrackList.cxx,v 1.4 2008/05/08 13:44:46 djkim Exp $
18 ////////////////////////////////////////////////////
20 // \file AliPhJMCTrackList.cxx
22 // \author J. Rak, D.J.Kim, R.Diaz (University of Jyvaskyla)
23 // \email: djkim@jyu.fi
24 // \version $Revision: 1.4 $
25 // \date $Date: 2008/05/08 13:44:46 $
27 // Class containing a list (TClonesArray) of MC tracks
28 ////////////////////////////////////////////////////
30 #include "AliPhJMCTrackList.h"
34 ClassImp(AliPhJMCTrackList)
36 #define kNumTracks 1500
38 //______________________________________________________________________________
40 AliPhJMCTrackList::AliPhJMCTrackList(expName exp):fMcTrackList(0x0),fTracks(0){
46 fMcTrackList = new TClonesArray("AliJMCTrack",kNumTracks);
51 //______________________________________________________________________________
53 AliPhJMCTrackList::AliPhJMCTrackList():fMcTrackList(0x0),fTracks(0){
55 fMcTrackList = new TClonesArray("AliJMCTrack",kNumTracks);
58 //______________________________________________________________________________
60 AliPhJMCTrackList::AliPhJMCTrackList(const AliPhJMCTrackList& a):
62 fMcTrackList(new TClonesArray(*a.fMcTrackList)),
68 //______________________________________________________________________________
70 AliPhJMCTrackList::~AliPhJMCTrackList(){
72 fMcTrackList->Clear();
76 //______________________________________________________________________________
78 void AliPhJMCTrackList::Reset(){
80 fMcTrackList->Clear();
81 if(fTracks>kNumTracks){
82 fMcTrackList->Expand(kNumTracks);
87 //______________________________________________________________________________
89 int AliPhJMCTrackList::SetTClonesArraySize(const unsigned int ntrk){
90 //set size of the list
92 fMcTrackList->Expand(kNumTracks);
97 //______________________________________________________________________________
99 void AliPhJMCTrackList::AddJMCTrack(const unsigned int itrk){
100 //add Mc track to the list
101 new((*fMcTrackList)[itrk]) AliJMCTrack();
104 //______________________________________________________________________________
107 AliJMCTrack* AliPhJMCTrackList::GetTrack(const unsigned int itrk){
108 //get track from the list
109 return (AliJMCTrack*)fMcTrackList->UncheckedAt(itrk);
112 //______________________________________________________________________________
114 AliPhJMCTrackList& AliPhJMCTrackList::operator=(const AliPhJMCTrackList& list){
117 TObject::operator=(list);
118 fMcTrackList=list.fMcTrackList;
119 fTracks=list.fTracks;