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 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 **************************************************************************/
19 //_________________________________________________________________________
20 // Unit used by UA1 algorithm
22 //*-- Author: Sarah Blyth (LBL/UCT)
24 // Revised Version for JETAN
25 // -- Magali Estienne (IReS)
30 #include <TLorentzVector.h>
31 #include <TClonesArray.h>
33 #include "AliJetUnitArray.h"
35 ClassImp(AliJetUnitArray)
37 AliJetUnitArray::AliJetUnitArray():
48 fUnitCutFlag(kPtSmaller),
49 fUnitCutFlag2(kPtSmaller),
50 fUnitSignalFlag(kBad),
51 fUnitDetectorFlag(kTpc),
61 // Default constructor
64 AliJetUnitArray::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):
73 fUnitClusterID(clusId),
77 fUnitSignalFlag(signal),
78 fUnitDetectorFlag(det),
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
93 AliJetUnitArray::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):
102 fUnitClusterID(clusId),
105 fUnitCutFlag2(kPtSmaller),
106 fUnitSignalFlag(kBad),
107 fUnitDetectorFlag(det),
120 //------------------------------------------------------------------------
121 AliJetUnitArray::~AliJetUnitArray()
126 //------------------------------------------------------------------------
127 void AliJetUnitArray::SetUnitSignalFlagC(Bool_t init, AliJetFinderUnitSignalFlagType_t flag)
129 // Set signal flag of the charged particle
134 else fVc.push_back(flag);
137 //------------------------------------------------------------------------
138 void AliJetUnitArray::SetUnitSignalFlagN(Bool_t init, AliJetFinderUnitSignalFlagType_t flag)
140 // Set signal flag of the neutral cell
145 else fVn.push_back(flag);
148 //------------------------------------------------------------------------
149 void AliJetUnitArray::SetUnitEtN(Bool_t init, Float_t et)
151 // Set transverse energy of the neutral cell
156 else fVet.push_back(et);
160 //------------------------------------------------------------------------
161 void AliJetUnitArray::SetUnitPxPyPz(Bool_t init, vector<Float_t> v3)
163 // Set momentum components of the charged particle
175 //------------------------------------------------------------------------
176 Bool_t AliJetUnitArray::GetUnitSignalFlagC(Int_t ind, AliJetFinderUnitSignalFlagType_t &flagc)
178 // Get signal flag of the charged particle
179 if(ind <= (Int_t)fVc.size())
181 flagc = (AliJetFinderUnitSignalFlagType_t)fVc[ind];
187 //------------------------------------------------------------------------
188 Bool_t AliJetUnitArray::GetUnitSignalFlagN(Int_t ind, AliJetFinderUnitSignalFlagType_t &flagn)
190 // Get signal flag of the neutral cell
191 if(ind <= (Int_t)fVn.size())
193 flagn = (AliJetFinderUnitSignalFlagType_t)fVn[ind];
199 //------------------------------------------------------------------------
200 Bool_t AliJetUnitArray::GetUnitEtN(Int_t ind, Float_t &et)
202 // Get transverse energy of the neutral cell
203 if(ind <= (Int_t)fVet.size())
205 et = (Float_t)fVet[ind];
211 //------------------------------------------------------------------------
212 Bool_t AliJetUnitArray::GetUnitPxPyPz(Int_t ind, Float_t &px, Float_t &py, Float_t &pz)
214 // Get momentum components of the charged particle
215 if(ind <= (Int_t)fV.size())
217 px = (Float_t)fV[ind][0];
218 py = (Float_t)fV[ind][1];
219 pz = (Float_t)fV[ind][2];
225 //------------------------------------------------------------------------
226 Bool_t AliJetUnitArray::GetUnitPxPyPzE(Int_t ind, Float_t &px, Float_t &py, Float_t &pz, Float_t &en)
228 // Get 4-momentum components of the charged particle
229 if(ind <= (Int_t)fV.size())
231 px = (Float_t)fV[ind][0];
232 py = (Float_t)fV[ind][1];
233 pz = (Float_t)fV[ind][2];
234 en = TMath::Sqrt(px*px+py*py+pz*pz);
240 //------------------------------------------------------------------------
241 Float_t AliJetUnitArray::EtaToTheta(Float_t arg) const
243 // Eta to theta transformation
244 return 2.*atan(exp(-arg));
247 //------------------------------------------------------------------------
248 Bool_t AliJetUnitArray::operator>(AliJetUnitArray unit) const
250 // Greater than operator used by sort
251 if( fUnitEnergy > unit.GetUnitEnergy())
257 //------------------------------------------------------------------------
258 Bool_t AliJetUnitArray::operator<( AliJetUnitArray unit) const
260 // Less than operator used by sort
261 if( fUnitEnergy < unit.GetUnitEnergy())
267 //------------------------------------------------------------------------
268 Bool_t AliJetUnitArray::operator==( AliJetUnitArray unit) const
270 // equality operator used by sort
271 if( fUnitEnergy == unit.GetUnitEnergy())