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: AliPhJPhotonList.cxx,v 1.4 2008/05/08 13:44:45 djkim Exp $
18 ////////////////////////////////////////////////////
20 // \file AliPhJPhotonList.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 photons
28 ////////////////////////////////////////////////////
31 #include "AliPhJPhoton.h"
32 #include "AliJPhoton.h"
34 #include "AliPhJPhotonList.h"
38 ClassImp(AliPhJPhotonList)
40 #define kNumPhotons 1500
42 //______________________________________________________________________________
44 AliPhJPhotonList::AliPhJPhotonList(expName exp):fPhotonList(0x0), fPhotons(-999){
50 fPhotonList = new TClonesArray("AliJPhoton",kNumPhotons);
56 //______________________________________________________________________________
58 AliPhJPhotonList::AliPhJPhotonList():fPhotonList(0x0),fPhotons(0){
60 fPhotonList = new TClonesArray("AliJPhoton",kNumPhotons);
64 //______________________________________________________________________________
66 AliPhJPhotonList::AliPhJPhotonList(const AliPhJPhotonList& a):
68 fPhotonList(new TClonesArray(*a.fPhotonList)),
73 //______________________________________________________________________________
75 AliPhJPhotonList::~AliPhJPhotonList(){
81 //______________________________________________________________________________
83 void AliPhJPhotonList::Reset(){
86 if(fPhotons>kNumPhotons){
87 fPhotonList->Expand(kNumPhotons);
92 //______________________________________________________________________________
94 int AliPhJPhotonList::SetTClonesArraySize(const unsigned int nph){
95 //set number of photons in the list
97 fPhotonList->Expand(kNumPhotons);
102 //______________________________________________________________________________
104 void AliPhJPhotonList::AddAliJPhoton(const unsigned int iph){
105 //add photon to the list
106 new((*fPhotonList)[iph]) AliJPhoton();
109 //______________________________________________________________________________
111 AliPhJPhoton* AliPhJPhotonList::GetPhoton(const unsigned int iph){
113 return (AliPhJPhoton*)fPhotonList->UncheckedAt(iph);
116 //______________________________________________________________________________
118 AliJPhoton* AliPhJPhotonList::GetAliJPhoton(const unsigned int iph){
120 return (AliJPhoton*)fPhotonList->UncheckedAt(iph);
123 //______________________________________________________________________________
125 AliPhJPhotonList& AliPhJPhotonList::operator=(const AliPhJPhotonList& list){
128 TObject::operator=(list);
129 fPhotonList = list.fPhotonList;
130 fPhotons = list.fPhotons;