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: AliPhJHeaderList.cxx,v 1.4 2008/05/08 13:44:45 djkim Exp $
18 ////////////////////////////////////////////////////
20 // \file AliPhJHeaderList.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:45 $
27 // Class containing a list (TClonesArray) of event headers
28 ////////////////////////////////////////////////////
30 #include "AliPhJBaseHeader.h"
31 #include "AliJHeader.h"
33 #include "AliPhJHeaderList.h"
37 ClassImp(AliPhJHeaderList)
39 #define kNumTracks 1500
41 //______________________________________________________________________________
43 AliPhJHeaderList::AliPhJHeaderList(expName exp): fHeaderList(0x0), fHeaders(0){
49 fHeaderList = new TClonesArray("AliJHeader",kNumTracks);
54 //______________________________________________________________________________
56 AliPhJHeaderList::AliPhJHeaderList(): fHeaderList(0x0),fHeaders(0){
58 fHeaderList = new TClonesArray("AliJHeader",kNumTracks);
61 //______________________________________________________________________________
63 AliPhJHeaderList::AliPhJHeaderList(const AliPhJHeaderList& a):
65 fHeaderList(new TClonesArray(*a.fHeaderList)),
71 //______________________________________________________________________________
73 AliPhJHeaderList::~AliPhJHeaderList(){
79 //______________________________________________________________________________
81 void AliPhJHeaderList::Reset(){
84 if(fHeaders>kNumTracks){
85 fHeaderList->Expand(kNumTracks);
90 //______________________________________________________________________________
92 int AliPhJHeaderList::SetTClonesArraySize(const unsigned int nhdr){
93 //set size of the list
95 fHeaderList->Expand(kNumTracks);
100 //______________________________________________________________________________
102 void AliPhJHeaderList::AddAliJHeader(const unsigned int ihdr){
103 //add new header to the list
104 new((*fHeaderList)[ihdr]) AliJHeader();
107 //______________________________________________________________________________
109 AliPhJBaseHeader* AliPhJHeaderList::GetHeader(const unsigned int ihdr){
110 //retrieve header to the list
111 return (AliPhJBaseHeader*)fHeaderList->UncheckedAt(ihdr);
114 //______________________________________________________________________________
116 AliJHeader* AliPhJHeaderList::GetAliJHeader(const unsigned int ihdr){
118 return (AliJHeader*)fHeaderList->UncheckedAt(ihdr);
121 //______________________________________________________________________________
123 AliPhJHeaderList& AliPhJHeaderList::operator=(const AliPhJHeaderList& list){
126 TObject::operator=(list);
127 fHeaderList = list.fHeaderList;
128 fHeaders = list.fHeaders;