]>
Commit | Line | Data |
---|---|---|
7c3c85cd | 1 | //-*- Mode: C++ -*- |
2 | ||
3 | // $Id: AliHLTJETConeGrid.h $ | |
4 | ||
5 | #ifndef ALIHLTJETCONEGRID_H | |
6 | #define ALIHLTJETCONEGRID_H | |
7 | ||
8 | /* This file is property of and copyright by the ALICE HLT Project * | |
9 | * ALICE Experiment at CERN, All rights reserved. * | |
10 | * See cxx source for full Copyright notice */ | |
11 | ||
12 | /** @file AliHLTJETConeGrid.h | |
13 | @author Jochen Thaeder | |
14 | @date | |
15 | @brief Eta-Phi grid of the cone finder | |
16 | */ | |
17 | ||
18 | // see below for class documentation | |
19 | // or | |
20 | // refer to README to build package | |
21 | // or | |
22 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
23 | ||
24 | ||
25 | #include "TClonesArray.h" | |
26 | #include "TParticle.h" | |
27 | ||
28 | #include "AliESDtrack.h" | |
29 | ||
30 | #include "AliHLTLogging.h" | |
31 | #include "AliHLTJETBase.h" | |
32 | ||
33 | /** | |
34 | * @class AliHLTJETConeGrid | |
35 | * Eta-Phi grid of the cone finder | |
36 | * | |
37 | * @ingroup alihlt_jet_cone | |
38 | */ | |
39 | ||
40 | class AliHLTJETConeGrid : public AliHLTLogging, public TObject { | |
41 | ||
42 | public: | |
43 | ||
44 | /* | |
45 | * --------------------------------------------------------------------------------- | |
46 | * Constructor / Destructor | |
47 | * --------------------------------------------------------------------------------- | |
48 | */ | |
49 | ||
50 | /** standard constructor */ | |
51 | AliHLTJETConeGrid(); | |
52 | ||
53 | /** destructor */ | |
54 | virtual ~AliHLTJETConeGrid(); | |
55 | ||
56 | /* | |
57 | * --------------------------------------------------------------------------------- | |
58 | * Process | |
59 | * --------------------------------------------------------------------------------- | |
60 | */ | |
61 | ||
62 | /** Fill particle into grid -> into cell | |
63 | * retrieve the grid indeces and get (eta,phi,pt) of the particle | |
64 | * @param esdTrack ptr to track | |
65 | * @param aEtaPhi array to be filled with (eta,phi,pt) of the particle | |
66 | * @param aGridIdx array to be filled with grid indeces | |
67 | * @return 0 on sucess, < 0 for error | |
68 | */ | |
69 | Int_t FillTrack( TParticle* particle, const Float_t* aEtaPhi, Int_t* aGridIdx ); | |
70 | ||
71 | /** Fill track into grid -> into cell | |
72 | * retrieve the grid indeces and get (eta,phi,pt) of the track | |
73 | * @param esdTrack ptr to track | |
74 | * @param aEtaPhi array to be filled with (eta,phi,pt) of the track | |
75 | * @param aGridIdx array to be filled with grid indeces | |
76 | * @return 0 on sucess, < 0 for error | |
77 | */ | |
78 | Int_t FillTrack( AliESDtrack* esdTrack, const Float_t* aEtaPhi, Int_t* aGridIdx ); | |
79 | ||
80 | /* | |
81 | * --------------------------------------------------------------------------------- | |
82 | * Initialize / Reset | |
83 | * --------------------------------------------------------------------------------- | |
84 | */ | |
85 | ||
86 | /** Initialize grid | |
87 | * @return 0 on sucess, < 0 for error | |
88 | */ | |
89 | Int_t Initialize(); | |
90 | ||
91 | /** Reset grid */ | |
92 | void Reset(); | |
93 | ||
94 | /* | |
95 | * --------------------------------------------------------------------------------- | |
96 | * Setter | |
97 | * --------------------------------------------------------------------------------- | |
98 | */ | |
99 | ||
100 | /** Set eta range parameters */ | |
101 | void SetEtaRange( Float_t etaMin, Float_t etaMax, Float_t etaRange ) | |
102 | { fEtaMin = etaMin; fEtaMax = etaMax; fEtaRange = etaRange; } | |
103 | ||
104 | /** Set eta range parameters */ | |
105 | void SetPhiRange( Float_t phiMin, Float_t phiMax, Float_t phiRange ) | |
106 | { fPhiMin = phiMin; fPhiMax = phiMax; fPhiRange = phiRange; } | |
107 | ||
108 | /** Set binning */ | |
109 | void SetBinning( Float_t etaBinning, Float_t phiBinning ) | |
110 | { fEtaBinning = etaBinning; fPhiBinning = phiBinning; } | |
111 | ||
112 | /** Set cone radius */ | |
113 | void SetConeRadius( Float_t coneRadius) { fConeRadius = coneRadius; } | |
114 | ||
115 | /* | |
116 | * --------------------------------------------------------------------------------- | |
117 | * Helper - public | |
118 | * --------------------------------------------------------------------------------- | |
119 | */ | |
120 | ||
121 | /** Next cell | |
122 | * Returns idx for the next cell in around seed | |
123 | * @return idx, -1 if false | |
124 | */ | |
125 | Int_t NextCell(); | |
126 | ||
127 | /** Seed cell iterator | |
128 | * Sets cell iterator for the NextCell method for | |
129 | * a given seed | |
130 | * @param etaIdx Eta index of seed | |
131 | * @param phiIdx Phi index of seed | |
132 | */ | |
133 | void SetCellIter( const Int_t etaIdx, const Int_t phiIdx ); | |
134 | ||
135 | ||
136 | /** Check if there is an object at cellIdx in fGrid | |
137 | * @param cellIdx CellIdx where there coulf be an object | |
138 | * @return ptr to cell, NULL if empty | |
139 | */ | |
140 | TObject* UncheckedAt( Int_t cellIdx ) { return fGrid->UncheckedAt(cellIdx); } | |
141 | ||
142 | ||
143 | // reinterpret_cast<AliHLTJETConeEtaPhiCell*>((*fGrid)[cellIdx]) | |
144 | //if ( ( iResult = jet->AddCell(fGrid->GetCell(cellIdx)) ) ) { | |
145 | ||
146 | ||
147 | ||
148 | /////////////////////////////////////////////////////////////////////////////////// | |
149 | ||
150 | private: | |
151 | ||
152 | /** copy constructor prohibited */ | |
153 | AliHLTJETConeGrid (const AliHLTJETConeGrid&); | |
154 | ||
155 | /** assignment operator prohibited */ | |
156 | AliHLTJETConeGrid& operator= (const AliHLTJETConeGrid&); | |
157 | ||
158 | /* | |
159 | * --------------------------------------------------------------------------------- | |
160 | * Helper - private | |
161 | * --------------------------------------------------------------------------------- | |
162 | */ | |
163 | ||
164 | /** Get Cell index out of eta and phi | |
165 | * @param aEtaPhi input structure containing eta,phi | |
166 | * [0] = eta, | |
167 | * [1] = phi | |
168 | * @param aGridIdx output structure containing grid index | |
169 | * [0] = 1D index in primary region | |
170 | * [1] = 1D index in outter region | |
171 | * [2] = eta index in primary region | |
172 | * [3] = phi index in primary region | |
173 | * [4] = phi index in outter region | |
174 | * @return 0 on sucess, 1 for outter phi present, <0 for error | |
175 | */ | |
176 | Int_t GetCellIndex( const Float_t* aEtaPhi, Int_t* aGridIdx ); | |
177 | ||
178 | /* | |
179 | * --------------------------------------------------------------------------------- | |
180 | * Members - private | |
181 | * --------------------------------------------------------------------------------- | |
182 | */ | |
183 | ||
184 | // -- Cells | |
185 | ||
186 | /** Search Grid */ | |
187 | TClonesArray* fGrid; //! transient | |
188 | ||
189 | // -- Grid boundaries in eta and phi - set via setter | |
190 | ||
191 | /** Minimum eta */ | |
192 | Float_t fEtaMin; // see above | |
193 | ||
194 | /** Maximum eta */ | |
195 | Float_t fEtaMax; // see above | |
196 | ||
197 | /** Minimum phi */ | |
198 | Float_t fPhiMin; // see above | |
199 | ||
200 | /** Maximum phi */ | |
201 | Float_t fPhiMax; // see above | |
202 | ||
203 | /** Total eta range */ | |
204 | Float_t fEtaRange; // see above | |
205 | ||
206 | /** Total phi range | |
207 | * abs(phimin)+phiMax + 2*coneRadius; | |
208 | */ | |
209 | Float_t fPhiRange; // see above | |
210 | ||
211 | // -- Grid parameter - set via setter | |
212 | ||
213 | /** Binning in eta */ | |
214 | Float_t fEtaBinning; // see above | |
215 | ||
216 | /** Binning in phi */ | |
217 | Float_t fPhiBinning; // see above | |
218 | ||
219 | // -- Number of bins in eta and phi - set via Initialize() | |
220 | ||
221 | /** Number of grid bins in eta */ | |
222 | Int_t fEtaNGridBins; // see above | |
223 | ||
224 | /** Number of grid bins in phi */ | |
225 | Int_t fPhiNGridBins; // see above | |
226 | ||
227 | /** Total number of bins */ | |
228 | Int_t fNBins; // see above | |
229 | ||
230 | // -- Bins around R - set via Initialize() | |
231 | ||
232 | /** Number of grid bins in eta in R */ | |
233 | Int_t fEtaNRBins; // see above | |
234 | ||
235 | /** Number of grid bins in phi in R */ | |
236 | Int_t fPhiNRBins; // see above | |
237 | ||
238 | // -- Cell iterator - set in SetCellIter() | |
239 | ||
240 | /** Eta Idx - current */ | |
241 | Int_t fEtaIdxCurrent; // see above | |
242 | ||
243 | /** Eta Idx - min */ | |
244 | Int_t fEtaIdxMin; // see above | |
245 | ||
246 | /** Eta Idx - max */ | |
247 | Int_t fEtaIdxMax; // see above | |
248 | ||
249 | /** Phi Idx - current */ | |
250 | Int_t fPhiIdxCurrent; // see above | |
251 | ||
252 | /** Phi Idx - min */ | |
253 | Int_t fPhiIdxMin; // see above | |
254 | ||
255 | /** Phi Idx - max */ | |
256 | Int_t fPhiIdxMax; // see above | |
257 | ||
258 | // -- Cone radius - set via setter | |
259 | ||
260 | /** Cone radius */ | |
261 | Float_t fConeRadius; // see above | |
262 | ||
263 | ClassDef(AliHLTJETConeGrid, 1) | |
264 | ||
265 | }; | |
266 | #endif | |
267 |