]> git.uio.no Git - u/mrichter/AliRoot.git/blame - JETAN/AliJetFillUnitArray.cxx
Unicor is lower case now (Stefan)
[u/mrichter/AliRoot.git] / JETAN / AliJetFillUnitArray.cxx
CommitLineData
be6e5811 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
16
17//======================================================================
18// ***July 2009
19// Fill Unit Array class
20// Base class used by AliJetESDReader to fill a UnitArray from the information extracted
21// from the particle tracks or emcal cells
22// Author: magali.estienne@subatech.in2p3.fr
23//======================================================================
24
25
26#include "AliJetFillUnitArray.h"
27
28// --- ROOT system ---
29class TSystem;
30class TLorentzVector;
31class TVector3;
32class TGeoManager;
33class TProcessID;
34
35// --- AliRoot header files ---
36class AliJetFinder;
37class AliJetReader;
38class AliJetESDReader;
39class AliJetESDReaderHeader;
40class AliJetUnitArray;
41
42ClassImp(AliJetFillUnitArray)
43
44//_____________________________________________________________________________
45AliJetFillUnitArray::AliJetFillUnitArray()
46 : TTask("AliJetFillUnitArray","Fill Unit Array with tpc/its and emcal information"),
47 fNTracks(0),
48 fNTracksCut(0),
49 fOpt(0),
50 fDZ(0),
51 fDebug(0),
52 fReaderHeader(0x0),
53 fMomentumArray(0x0),
54 fUnitArray(0x0),
55 fRefArray(0x0),
56 fProcId(kFALSE),
57 fTPCGrid(0x0),
58 fEMCalGrid(0x0),
59 fGeom(0x0),
60 fNphi(0),
61 fNeta(0),
62 fGrid(0),
63 fPhi2(0),
64 fEta2(0),
65 fIndex(0x0),
66 fParams(0x0),
67 fPhiMin(0),
68 fPhiMax(0),
69 fEtaMin(0),
70 fEtaMax(0),
71 fEtaBinInTPCAcc(0),
72 fPhiBinInTPCAcc(0),
73 fEtaBinInEMCalAcc(0),
74 fPhiBinInEMCalAcc(0),
75 fNbinPhi(0)
76{
77 // constructor
78}
79
80//_____________________________________________________________________________
81AliJetFillUnitArray::~AliJetFillUnitArray()
82{
83 // destructor
84}
85
86//_____________________________________________________________________________
87void AliJetFillUnitArray::GetEtaPhiFromIndex(Int_t index, Float_t &eta, Float_t &phi)
88{
89 // Get the eta,phi position from the index
90
91 for(Int_t j=0; j<fNphi+1; j++) {
92 for(Int_t i=0; i<fNeta+1; i++) {
93
94 // TPC grid only
95 //-------------------------------------
96 if(fGrid==0) {
97 if(j*(fNeta+1)+i == index) {
98 eta = fEta2->At(i);
99 phi = fPhi2->At(j);
100 }
101 }
102
103 // TPC-EMCAL grid
104 //-------------------------------------
105 Int_t ii = 0;
106 if(i==0) ii = 0;
107 if(i>0 && i<(fEtaBinInTPCAcc-fEtaBinInEMCalAcc)/2) ii = i;
108 if(i>=(fEtaBinInTPCAcc+fEtaBinInEMCalAcc)/2 && i<fNeta+1) ii = i-fEtaBinInEMCalAcc;
109
110 if(fGrid==1) {
111 if(j<(fNbinPhi+1) && j*(fNeta+1)+i == index) {
112 eta = fEta2->At(i);
113 phi = fPhi2->At(j);
114 }
115
116 if((j>=(fNbinPhi+1) && j<(fNbinPhi+1+fPhiBinInEMCalAcc)) &&
117 ((fNbinPhi+1)*(fNeta+1) + (j-fNbinPhi-1)*(fEtaBinInTPCAcc-fEtaBinInEMCalAcc) + ii)== index ) {
118 if(ii==0) {Int_t ind = 0; eta = fEta2->At(ind);}
119 else eta = fEta2->At(i);
120 phi = fPhi2->At(j);
121 }
122
123 if(j>=(fNbinPhi+1+fPhiBinInEMCalAcc) && ((fNbinPhi+1)*(fNeta+1)+fPhiBinInEMCalAcc*((fEtaBinInTPCAcc-fEtaBinInEMCalAcc))+(j-(fNbinPhi+1+fPhiBinInEMCalAcc))*(fNeta+1)+i == index)) {
124 eta = fEta2->At(i);
125 phi = fPhi2->At(j);
126 }
127 }
128 }
129 }
130}
131
132//_____________________________________________________________________________
133Float_t AliJetFillUnitArray::EtaToTheta(Float_t arg)
134{
135 return 2.*atan(exp(-arg));
136}
137
138
139
140
141
142
143