]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/JCORRAN/AliPhJPhotonList.cxx
Adding some histograms for jet shape
[u/mrichter/AliRoot.git] / PWG4 / JCORRAN / AliPhJPhotonList.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 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 **************************************************************************/
15
16 // $Id: AliPhJPhotonList.cxx,v 1.4 2008/05/08 13:44:45 djkim Exp $
17
18 ////////////////////////////////////////////////////
19 //
20 //  \file AliPhJPhotonList.cxx
21 //  \brief
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 $
26 //
27 // Class containing a list (TClonesArray) of photons
28 ////////////////////////////////////////////////////
29
30 #include "JConst.h"
31 #include "AliPhJPhoton.h"
32 #include "AliJPhoton.h"
33
34 #include "AliPhJPhotonList.h"
35
36 using namespace std;
37
38 ClassImp(AliPhJPhotonList)
39
40 #define kNumPhotons 1500
41
42 //______________________________________________________________________________
43
44 AliPhJPhotonList::AliPhJPhotonList(expName exp):fPhotonList(0x0), fPhotons(-999){
45   //constructor
46    switch (exp){
47    case kPHENIX:
48        break;
49    case kALICE:
50        fPhotonList = new TClonesArray("AliJPhoton",kNumPhotons);
51        break;
52    }
53   
54 }
55
56 //______________________________________________________________________________
57
58 AliPhJPhotonList::AliPhJPhotonList():fPhotonList(0x0),fPhotons(0){
59   //constructor
60   fPhotonList = new TClonesArray("AliJPhoton",kNumPhotons);
61
62 }
63
64 //______________________________________________________________________________
65
66 AliPhJPhotonList::AliPhJPhotonList(const AliPhJPhotonList& a):
67   TObject(a),
68   fPhotonList(new TClonesArray(*a.fPhotonList)),
69   fPhotons(a.fPhotons)
70 {
71   //copy constructor
72 }
73 //______________________________________________________________________________
74
75 AliPhJPhotonList::~AliPhJPhotonList(){
76   //destructor
77   fPhotonList->Clear();
78   delete fPhotonList;
79 }
80
81 //______________________________________________________________________________
82
83 void AliPhJPhotonList::Reset(){
84   //reset object
85   fPhotonList->Clear();
86   if(fPhotons>kNumPhotons){
87     fPhotonList->Expand(kNumPhotons);
88   }
89   fPhotons = 0;
90 }
91
92 //______________________________________________________________________________
93
94 int AliPhJPhotonList::SetTClonesArraySize(const unsigned int nph){
95   //set number of photons in the list
96   if(nph>kNumPhotons){
97     fPhotonList->Expand(kNumPhotons);
98   }
99   return nph;
100 }
101
102 //______________________________________________________________________________
103
104 void AliPhJPhotonList::AddAliJPhoton(const unsigned int iph){
105   //add photon to the list  
106   new((*fPhotonList)[iph]) AliJPhoton();
107 }
108
109 //______________________________________________________________________________
110
111 AliPhJPhoton* AliPhJPhotonList::GetPhoton(const unsigned int iph){
112   //retrieve object
113   return (AliPhJPhoton*)fPhotonList->UncheckedAt(iph);
114 }
115
116 //______________________________________________________________________________
117
118 AliJPhoton* AliPhJPhotonList::GetAliJPhoton(const unsigned int iph){
119    // ALICE getter
120    return (AliJPhoton*)fPhotonList->UncheckedAt(iph);
121 }
122
123 //______________________________________________________________________________
124
125 AliPhJPhotonList& AliPhJPhotonList::operator=(const AliPhJPhotonList& list){
126   //operator=
127   if(this != &list){
128     TObject::operator=(list);
129     fPhotonList = list.fPhotonList;
130     fPhotons    = list.fPhotons;
131   }
132
133   return *this;
134 }