Obsolete code removed.
[u/mrichter/AliRoot.git] / JETAN / AliJetUnitArray.cxx
CommitLineData
4a01bb2c 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 notice *
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
8838ab7a 16
17/* $Id$ */
18
19//_________________________________________________________________________
4a01bb2c 20// Unit used by UA1 algorithm
8838ab7a 21// --
22//*-- Author: Sarah Blyth (LBL/UCT)
23// --
24// Revised Version for JETAN
be6e5811 25// -- Magali Estienne (magali.estienne@subatech.in2p3.fr)
4a01bb2c 26
8838ab7a 27#include "AliJetUnitArray.h"
4a01bb2c 28
be6e5811 29class TVector3;
30class TLorentzVector;
31class TClonesArray;
32
4a01bb2c 33ClassImp(AliJetUnitArray)
34
b92e2ccf 35AliJetUnitArray::AliJetUnitArray():
ee7de0dd 36 fUnitEnergy(0.0),
37 fUnitEta(0.0),
38 fUnitPhi(0.0),
39 fUnitDeta(0.),
40 fUnitDphi(0.),
41 fUnitID(0),
42 fUnitTrackID(0),
43 fUnitNum(0),
44 fUnitClusterID(0),
45 fUnitFlag(kOutJet),
46 fUnitCutFlag(kPtSmaller),
8838ab7a 47 fUnitCutFlag2(kPtSmaller),
ee7de0dd 48 fUnitSignalFlag(kBad),
49 fUnitDetectorFlag(kTpc),
50 fUnitPx(0.),
51 fUnitPy(0.),
52 fUnitPz(0.),
8838ab7a 53 fUnitMass(0.),
8838ab7a 54 fVc(0),
55 fVn(0),
be6e5811 56 fUnitTrackRef(new TRefArray),
57 fUnitCellRef(new TRefArray),
58 fUnitClusterRef(new TRefArray)
4a01bb2c 59{
60 // Default constructor
4a01bb2c 61}
62
8838ab7a 63AliJetUnitArray::AliJetUnitArray(Int_t absId, Int_t esdId, Float_t eta, Float_t phi, Float_t en, Float_t Deta, Float_t Dphi, AliJetFinderUnitDetectorFlagType_t det, AliJetFinderUnitFlagType_t inout, AliJetFinderUnitCutFlagType_t cut, AliJetFinderUnitCutFlagType_t cut2, AliJetFinderUnitSignalFlagType_t signal,Float_t mass, Int_t clusId):
64 fUnitEnergy(en),
65 fUnitEta(eta),
66 fUnitPhi(phi),
67 fUnitDeta(Deta),
68 fUnitDphi(Dphi),
69 fUnitID(absId),
70 fUnitTrackID(esdId),
71 fUnitNum(0),
72 fUnitClusterID(clusId),
73 fUnitFlag(inout),
74 fUnitCutFlag(cut),
75 fUnitCutFlag2(cut2),
be6e5811 76 fUnitSignalFlag(kBad),
8838ab7a 77 fUnitDetectorFlag(det),
78 fUnitPx(0.),
79 fUnitPy(0.),
80 fUnitPz(0.),
81 fUnitMass(mass),
8838ab7a 82 fVc(0),
83 fVn(0),
be6e5811 84 fUnitTrackRef(new TRefArray),
85 fUnitCellRef(new TRefArray),
86 fUnitClusterRef(new TRefArray)
8838ab7a 87{
88 //abs ID (in a eta,phi grid, track ID in ESD, eta, phi, energy, px, py, pz, Deta, Dphi, detector flag, in/out jet, mass
89
90 // Constructor 2
91}
92
ee7de0dd 93AliJetUnitArray::AliJetUnitArray(Int_t absId, Int_t esdId, Float_t eta, Float_t phi, Float_t en, Float_t px, Float_t py, Float_t pz, Float_t Deta, Float_t Dphi, AliJetFinderUnitDetectorFlagType_t det, AliJetFinderUnitFlagType_t inout, AliJetFinderUnitCutFlagType_t cut, Float_t mass, Int_t clusId):
94 fUnitEnergy(en),
95 fUnitEta(eta),
96 fUnitPhi(phi),
97 fUnitDeta(Deta),
98 fUnitDphi(Dphi),
99 fUnitID(absId),
100 fUnitTrackID(esdId),
101 fUnitNum(0),
102 fUnitClusterID(clusId),
103 fUnitFlag(inout),
104 fUnitCutFlag(cut),
8838ab7a 105 fUnitCutFlag2(kPtSmaller),
106 fUnitSignalFlag(kBad),
ee7de0dd 107 fUnitDetectorFlag(det),
108 fUnitPx(px),
109 fUnitPy(py),
110 fUnitPz(pz),
8838ab7a 111 fUnitMass(mass),
8838ab7a 112 fVc(0),
113 fVn(0),
be6e5811 114 fUnitTrackRef(new TRefArray),
115 fUnitCellRef(new TRefArray),
116 fUnitClusterRef(new TRefArray)
ee7de0dd 117{
118 // Constructor 2
119}
8838ab7a 120
be6e5811 121AliJetUnitArray::AliJetUnitArray(const AliJetUnitArray& rUnit):
122 TObject(rUnit),
123 fUnitEnergy(rUnit.fUnitEnergy),
124 fUnitEta(rUnit.fUnitEta),
125 fUnitPhi(rUnit.fUnitPhi),
126 fUnitDeta(rUnit.fUnitDeta),
127 fUnitDphi(rUnit.fUnitDphi),
128 fUnitID(rUnit.fUnitID),
129 fUnitTrackID(rUnit.fUnitTrackID),
130 fUnitNum(rUnit.fUnitNum),
131 fUnitClusterID(rUnit.fUnitClusterID),
132 fUnitFlag(rUnit.fUnitFlag),
133 fUnitCutFlag(rUnit.fUnitCutFlag),
134 fUnitCutFlag2(rUnit.fUnitCutFlag2),
135 fUnitSignalFlag(rUnit.fUnitSignalFlag),
136 fUnitDetectorFlag(rUnit.fUnitDetectorFlag),
137 fUnitPx(rUnit.fUnitPx),
138 fUnitPy(rUnit.fUnitPy),
139 fUnitPz(rUnit.fUnitPz),
140 fUnitMass(rUnit.fUnitMass),
141 fVc(rUnit.fVc),
142 fVn(rUnit.fVn),
143 fUnitTrackRef(rUnit.fUnitTrackRef),
144 fUnitCellRef(rUnit.fUnitCellRef),
145 fUnitClusterRef(rUnit.fUnitClusterRef)
146{
147 // Copy constructor
148}
149
150AliJetUnitArray& AliJetUnitArray::operator=(const AliJetUnitArray& rhs)
151{
152 // Assignment
153 fUnitEnergy = rhs.fUnitEnergy;
154 fUnitEta = rhs.fUnitEta;
155 fUnitPhi = rhs.fUnitPhi;
156 fUnitDeta = rhs.fUnitDeta;
157 fUnitDphi = rhs.fUnitDphi;
158 fUnitID = rhs.fUnitID;
159 fUnitTrackID = rhs.fUnitTrackID;
160 fUnitNum = rhs.fUnitNum;
161 fUnitClusterID = rhs.fUnitClusterID;
162 fUnitFlag = rhs.fUnitFlag;
163 fUnitCutFlag = rhs.fUnitCutFlag;
164 fUnitCutFlag2 = rhs.fUnitCutFlag2;
165 fUnitSignalFlag = rhs.fUnitSignalFlag;
166 fUnitDetectorFlag = rhs.fUnitDetectorFlag;
167 fUnitPx = rhs.fUnitPx;
168 fUnitPy = rhs.fUnitPy;
169 fUnitPz = rhs.fUnitPz;
170 fUnitMass = rhs.fUnitMass;
171 fVc = rhs.fVc;
172 fVn = rhs.fVn;
173 fUnitTrackRef = rhs.fUnitTrackRef;
174 fUnitCellRef = rhs.fUnitCellRef;
175 fUnitClusterRef = rhs.fUnitClusterRef;
176
177 return *this;
178
179}
180
181
8838ab7a 182//------------------------------------------------------------------------
4a01bb2c 183AliJetUnitArray::~AliJetUnitArray()
184{
185 // Destructor
be6e5811 186 delete fUnitTrackRef;
187 delete fUnitCellRef;
188 delete fUnitClusterRef;
189
190}
191
192void AliJetUnitArray::ClearUnitTrackRef()
193{
194 fUnitTrackRef->Clear();
195}
196
197void AliJetUnitArray::ClearUnitCellRef()
198{
199 fUnitCellRef->Clear();
4a01bb2c 200}
8838ab7a 201
202//------------------------------------------------------------------------
203void AliJetUnitArray::SetUnitSignalFlagC(Bool_t init, AliJetFinderUnitSignalFlagType_t flag)
204{
205 // Set signal flag of the charged particle
206 if(init){
207 if(!fVc.empty())
208 fVc.clear();
209 }
210 else fVc.push_back(flag);
211}
212
213//------------------------------------------------------------------------
214void AliJetUnitArray::SetUnitSignalFlagN(Bool_t init, AliJetFinderUnitSignalFlagType_t flag)
215{
216 // Set signal flag of the neutral cell
217 if(init){
218 if(!fVn.empty())
219 fVn.clear();
220 }
221 else fVn.push_back(flag);
222}
223
8838ab7a 224
225//------------------------------------------------------------------------
226Bool_t AliJetUnitArray::GetUnitSignalFlagC(Int_t ind, AliJetFinderUnitSignalFlagType_t &flagc)
227{
228 // Get signal flag of the charged particle
229 if(ind <= (Int_t)fVc.size())
230 {
231 flagc = (AliJetFinderUnitSignalFlagType_t)fVc[ind];
232 return kTRUE;
233 }
234 else return kFALSE;
235}
236
237//------------------------------------------------------------------------
238Bool_t AliJetUnitArray::GetUnitSignalFlagN(Int_t ind, AliJetFinderUnitSignalFlagType_t &flagn)
239{
240 // Get signal flag of the neutral cell
241 if(ind <= (Int_t)fVn.size())
242 {
243 flagn = (AliJetFinderUnitSignalFlagType_t)fVn[ind];
244 return kTRUE;
245 }
246 else return kFALSE;
8838ab7a 247}
248
249//------------------------------------------------------------------------
250Float_t AliJetUnitArray::EtaToTheta(Float_t arg) const
251{
252 // Eta to theta transformation
253 return 2.*atan(exp(-arg));
254}
255
256//------------------------------------------------------------------------
257Bool_t AliJetUnitArray::operator>(AliJetUnitArray unit) const
4a01bb2c 258{
259 // Greater than operator used by sort
260 if( fUnitEnergy > unit.GetUnitEnergy())
261 return kTRUE;
262 else
263 return kFALSE;
264}
265
8838ab7a 266//------------------------------------------------------------------------
267Bool_t AliJetUnitArray::operator<( AliJetUnitArray unit) const
4a01bb2c 268{
269 // Less than operator used by sort
270 if( fUnitEnergy < unit.GetUnitEnergy())
271 return kTRUE;
272 else
273 return kFALSE;
274}
275
8838ab7a 276//------------------------------------------------------------------------
277Bool_t AliJetUnitArray::operator==( AliJetUnitArray unit) const
4a01bb2c 278{
279 // equality operator used by sort
280 if( fUnitEnergy == unit.GetUnitEnergy())
281 return kTRUE;
282 else
283 return kFALSE;
284}