]>
Commit | Line | Data |
---|---|---|
b5a207b4 | 1 | //$Id$ |
2 | ||
b1886074 | 3 | // Author: Anders Vestbo <mailto:vestbo@fi.uib.no> |
4 | //*-- Copyright © ASV | |
4cafa5fc | 5 | |
48f3c46f | 6 | #include "AliL3MemHandler.h" |
e26acabd | 7 | #include "AliL3Logging.h" |
99e7186b | 8 | #include "AliL3HoughTransformer.h" |
4de874d1 | 9 | #include "AliL3Transform.h" |
4cafa5fc | 10 | #include "AliL3DigitData.h" |
93657878 | 11 | #include "AliL3HistogramAdaptive.h" |
4de874d1 | 12 | |
b1886074 | 13 | //_____________________________________________________________ |
14 | // AliL3HoughTransformer | |
15 | // | |
16 | // Hough transformation class | |
3ef466c5 | 17 | // |
b1886074 | 18 | |
4de874d1 | 19 | ClassImp(AliL3HoughTransformer) |
20 | ||
21 | AliL3HoughTransformer::AliL3HoughTransformer() | |
22 | { | |
23 | //Default constructor | |
c52cf5d8 | 24 | fParamSpace = 0; |
c980a70c | 25 | fDoMC = kFALSE; |
1eef4efc | 26 | #ifdef do_mc |
27 | fTrackID = 0; | |
28 | #endif | |
4de874d1 | 29 | } |
30 | ||
c52cf5d8 | 31 | AliL3HoughTransformer::AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t n_eta_segments) : AliL3HoughBaseTransformer(slice,patch,n_eta_segments) |
52a2a604 | 32 | { |
3ef466c5 | 33 | //Normal constructor |
237d3f5c | 34 | fParamSpace = 0; |
c980a70c | 35 | fDoMC = kFALSE; |
1eef4efc | 36 | #ifdef do_mc |
37 | fTrackID = 0; | |
38 | #endif | |
52a2a604 | 39 | } |
40 | ||
4de874d1 | 41 | AliL3HoughTransformer::~AliL3HoughTransformer() |
42 | { | |
99e7186b | 43 | DeleteHistograms(); |
1eef4efc | 44 | #ifdef do_mc |
45 | if(fTrackID) | |
46 | { | |
47 | for(Int_t i=0; i<GetNEtaSegments(); i++) | |
48 | { | |
49 | if(!fTrackID[i]) continue; | |
50 | delete fTrackID[i]; | |
51 | } | |
52 | delete [] fTrackID; | |
53 | } | |
54 | #endif | |
4cafa5fc | 55 | } |
56 | ||
7646f3c3 | 57 | //void AliL3HoughTransformer::Init(Int_t slice=0,Int_t patch=0,Int_t n_eta_segments=100){} |
58 | ||
99e7186b | 59 | void AliL3HoughTransformer::DeleteHistograms() |
4cafa5fc | 60 | { |
99e7186b | 61 | if(!fParamSpace) |
62 | return; | |
c52cf5d8 | 63 | for(Int_t i=0; i<GetNEtaSegments(); i++) |
4fc9a6a4 | 64 | { |
65 | if(!fParamSpace[i]) continue; | |
66 | delete fParamSpace[i]; | |
67 | } | |
99e7186b | 68 | delete [] fParamSpace; |
4cafa5fc | 69 | } |
70 | ||
e26acabd | 71 | void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t pt_min, |
72 | Int_t nybin,Double_t phimin,Double_t phimax) | |
73 | { | |
3ef466c5 | 74 | //Create the histograms (parameter space). |
75 | //These are 2D histograms, span by kappa (curvature of track) and phi0 (emission angle with x-axis). | |
76 | //The arguments give the range and binning; | |
77 | //nxbin = #bins in kappa | |
78 | //nybin = #bins in phi0 | |
79 | //pt_min = mimium Pt of track (corresponding to maximum kappa) | |
80 | //phi_min = mimimum phi0 (degrees) | |
81 | //phi_max = maximum phi0 (degrees) | |
82 | ||
08a66445 | 83 | Double_t x = AliL3Transform::GetBFact()*AliL3Transform::GetBField()/pt_min; |
26abc209 | 84 | Double_t torad = AliL3Transform::Pi()/180; |
85 | CreateHistograms(nxbin,-1.*x,x,nybin,phimin*torad,phimax*torad); | |
e26acabd | 86 | } |
87 | ||
99e7186b | 88 | void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t xmin,Double_t xmax, |
89 | Int_t nybin,Double_t ymin,Double_t ymax) | |
4cafa5fc | 90 | { |
4fc9a6a4 | 91 | |
c52cf5d8 | 92 | fParamSpace = new AliL3Histogram*[GetNEtaSegments()]; |
4cafa5fc | 93 | |
99e7186b | 94 | Char_t histname[256]; |
c52cf5d8 | 95 | for(Int_t i=0; i<GetNEtaSegments(); i++) |
4de874d1 | 96 | { |
99e7186b | 97 | sprintf(histname,"paramspace_%d",i); |
93657878 | 98 | //fParamSpace[i] = new AliL3HistogramAdaptive(histname,0.1,1,0.05,64,ymin,ymax); |
99e7186b | 99 | fParamSpace[i] = new AliL3Histogram(histname,"",nxbin,xmin,xmax,nybin,ymin,ymax); |
4de874d1 | 100 | } |
1eef4efc | 101 | |
102 | #ifdef do_mc | |
c980a70c | 103 | if(fDoMC) |
104 | { | |
105 | Int_t ncells = (nxbin+2)*(nybin+2); | |
106 | cout<<"Allocating "<<GetNEtaSegments()*ncells*sizeof(TrackIndex)<<" bytes to fTrackID"<<endl; | |
107 | fTrackID = new TrackIndex*[GetNEtaSegments()]; | |
108 | for(Int_t i=0; i<GetNEtaSegments(); i++) | |
109 | fTrackID[i] = new TrackIndex[ncells]; | |
110 | } | |
1eef4efc | 111 | #endif |
4cafa5fc | 112 | } |
113 | ||
e26acabd | 114 | void AliL3HoughTransformer::Reset() |
115 | { | |
48f3c46f | 116 | //Reset all the histograms |
e26acabd | 117 | |
118 | if(!fParamSpace) | |
119 | { | |
120 | LOG(AliL3Log::kWarning,"AliL3HoughTransformer::Reset","Histograms") | |
121 | <<"No histograms to reset"<<ENDLOG; | |
122 | return; | |
123 | } | |
124 | ||
c52cf5d8 | 125 | for(Int_t i=0; i<GetNEtaSegments(); i++) |
e26acabd | 126 | fParamSpace[i]->Reset(); |
1eef4efc | 127 | #ifdef do_mc |
c980a70c | 128 | if(fDoMC) |
129 | { | |
130 | AliL3Histogram *hist = fParamSpace[0]; | |
131 | Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2); | |
132 | for(Int_t i=0; i<GetNEtaSegments(); i++) | |
133 | memset(fTrackID[i],0,ncells*sizeof(TrackIndex)); | |
134 | } | |
1eef4efc | 135 | #endif |
e26acabd | 136 | } |
137 | ||
b5a207b4 | 138 | Int_t AliL3HoughTransformer::GetEtaIndex(Double_t eta) |
139 | { | |
3ef466c5 | 140 | //Return the histogram index of the corresponding eta. |
141 | ||
c52cf5d8 | 142 | Double_t etaslice = (GetEtaMax() - GetEtaMin())/GetNEtaSegments(); |
143 | Double_t index = (eta-GetEtaMin())/etaslice; | |
b5a207b4 | 144 | return (Int_t)index; |
145 | } | |
146 | ||
7646f3c3 | 147 | inline AliL3Histogram *AliL3HoughTransformer::GetHistogram(Int_t eta_index) |
148 | { | |
149 | if(!fParamSpace || eta_index >= GetNEtaSegments() || eta_index < 0) | |
150 | return 0; | |
151 | if(!fParamSpace[eta_index]) | |
152 | return 0; | |
153 | return fParamSpace[eta_index]; | |
154 | } | |
155 | ||
afd8fed4 | 156 | Double_t AliL3HoughTransformer::GetEta(Int_t eta_index,Int_t slice) |
7646f3c3 | 157 | { |
158 | Double_t eta_slice = (GetEtaMax()-GetEtaMin())/GetNEtaSegments(); | |
159 | Double_t eta=(Double_t)((eta_index+0.5)*eta_slice); | |
afd8fed4 | 160 | if(slice>17) eta*=-1; |
7646f3c3 | 161 | return eta; |
162 | } | |
163 | ||
4fc9a6a4 | 164 | void AliL3HoughTransformer::TransformCircle() |
4de874d1 | 165 | { |
99e7186b | 166 | //Transform the input data with a circle HT. |
3ef466c5 | 167 | //The function loops over all the data, and transforms each pixel with the equations: |
168 | // | |
169 | //kappa = 2/R*sin(phi - phi0) | |
170 | // | |
171 | //where R = sqrt(x*x +y*y), and phi = arctan(y/x) | |
172 | // | |
173 | //Each pixel then transforms into a curve in the (kappa,phi0)-space. In order to find | |
174 | //which histogram in which the pixel should be transformed, the eta-value is calcluated | |
175 | //and the proper histogram index is found by GetEtaIndex(eta). | |
176 | ||
52a2a604 | 177 | |
c52cf5d8 | 178 | AliL3DigitRowData *tempPt = GetDataPointer(); |
179 | if(!tempPt) | |
4de874d1 | 180 | { |
237d3f5c | 181 | LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircle","Data") |
182 | <<"No input data "<<ENDLOG; | |
183 | return; | |
184 | } | |
99e7186b | 185 | |
3ef466c5 | 186 | //Loop over the padrows: |
26abc209 | 187 | for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++) |
4cafa5fc | 188 | { |
3ef466c5 | 189 | //Get the data on this padrow: |
99e7186b | 190 | AliL3DigitData *digPt = tempPt->fDigitData; |
191 | if(i != (Int_t)tempPt->fRow) | |
4cafa5fc | 192 | { |
d96f6a4a | 193 | cerr<<"AliL3HoughTransform::TransformCircle : Mismatching padrow numbering "<<i<<" "<<(Int_t)tempPt->fRow<<endl; |
99e7186b | 194 | continue; |
195 | } | |
3fe49b5b | 196 | |
3ef466c5 | 197 | //Loop over the data on this padrow: |
99e7186b | 198 | for(UInt_t j=0; j<tempPt->fNDigit; j++) |
199 | { | |
200 | UShort_t charge = digPt[j].fCharge; | |
201 | UChar_t pad = digPt[j].fPad; | |
202 | UShort_t time = digPt[j].fTime; | |
3bb06991 | 203 | if((Int_t)charge <= GetLowerThreshold() || (Int_t)charge > GetUpperThreshold()) |
99e7186b | 204 | continue; |
4cafa5fc | 205 | Int_t sector,row; |
99e7186b | 206 | Float_t xyz[3]; |
3ef466c5 | 207 | |
208 | //Transform data to local cartesian coordinates: | |
4ab9f8f0 | 209 | AliL3Transform::Slice2Sector(GetSlice(),i,sector,row); |
210 | AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time); | |
3ef466c5 | 211 | |
212 | //Calculate the eta: | |
4ab9f8f0 | 213 | Double_t eta = AliL3Transform::GetEta(xyz); |
3ef466c5 | 214 | |
215 | //Get the corresponding index, which determines which histogram to fill: | |
c52cf5d8 | 216 | Int_t eta_index = GetEtaIndex(eta); |
217 | if(eta_index < 0 || eta_index >= GetNEtaSegments()) | |
99e7186b | 218 | continue; |
4cafa5fc | 219 | |
e26acabd | 220 | //Get the correct histogrampointer: |
99e7186b | 221 | AliL3Histogram *hist = fParamSpace[eta_index]; |
222 | if(!hist) | |
4cafa5fc | 223 | { |
4fc9a6a4 | 224 | printf("AliL3HoughTransformer::TransformCircle : Error getting histogram in index %d\n",eta_index); |
99e7186b | 225 | continue; |
4cafa5fc | 226 | } |
4cafa5fc | 227 | |
3ef466c5 | 228 | //Do the transformation: |
229 | Float_t R = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]); | |
4ab9f8f0 | 230 | Float_t phi = AliL3Transform::GetPhi(xyz); |
4de874d1 | 231 | |
99e7186b | 232 | //Fill the histogram along the phirange |
233 | for(Int_t b=hist->GetFirstYbin(); b<=hist->GetLastYbin(); b++) | |
4de874d1 | 234 | { |
99e7186b | 235 | Float_t phi0 = hist->GetBinCenterY(b); |
236 | Float_t kappa = 2*sin(phi - phi0)/R; | |
237 | hist->Fill(kappa,phi0,charge); | |
1eef4efc | 238 | #ifdef do_mc |
c980a70c | 239 | if(fDoMC) |
1eef4efc | 240 | { |
c980a70c | 241 | Int_t bin = hist->FindBin(kappa,phi0); |
242 | for(Int_t t=0; t<3; t++) | |
243 | { | |
244 | Int_t label = digPt[j].fTrackID[t]; | |
245 | if(label < 0) break; | |
246 | UInt_t c; | |
247 | for(c=0; c<MaxTrack; c++) | |
248 | if(fTrackID[eta_index][bin].fLabel[c] == label || fTrackID[eta_index][bin].fNHits[c] == 0) | |
249 | break; | |
250 | if(c == MaxTrack-1) cerr<<"AliL3HoughTransformer::TransformCircle : Array reached maximum!! "<<c<<endl; | |
251 | fTrackID[eta_index][bin].fLabel[c] = label; | |
252 | fTrackID[eta_index][bin].fNHits[c]++; | |
253 | } | |
1eef4efc | 254 | } |
255 | #endif | |
4de874d1 | 256 | } |
4de874d1 | 257 | } |
3ef466c5 | 258 | |
259 | //Move the data pointer to the next padrow: | |
48f3c46f | 260 | AliL3MemHandler::UpdateRowPointer(tempPt); |
4de874d1 | 261 | } |
4de874d1 | 262 | } |
263 | ||
3ef466c5 | 264 | void AliL3HoughTransformer::TransformCircleC(Int_t row_range) |
b1886074 | 265 | { |
266 | //Circle transform, using combinations of every 2 points lying | |
267 | //on different padrows and within the same etaslice. | |
268 | ||
c52cf5d8 | 269 | AliL3DigitRowData *tempPt = GetDataPointer(); |
b1886074 | 270 | if(!tempPt) |
237d3f5c | 271 | LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircleC","Data") |
272 | <<"No input data "<<ENDLOG; | |
273 | ||
3ef466c5 | 274 | Int_t counter=0; |
26abc209 | 275 | for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++) |
b1886074 | 276 | { |
3ef466c5 | 277 | counter += tempPt->fNDigit; |
b1886074 | 278 | AliL3MemHandler::UpdateRowPointer(tempPt); |
279 | } | |
3ef466c5 | 280 | |
281 | struct Digit { | |
282 | Int_t row; | |
283 | Double_t r; | |
284 | Double_t phi; | |
285 | Int_t eta_index; | |
286 | Int_t charge; | |
1eef4efc | 287 | Int_t trackID[3]; |
3ef466c5 | 288 | }; |
289 | ||
290 | Digit *digits = new Digit[counter]; | |
291 | cout<<"Allocating "<<counter*sizeof(Digit)<<" bytes to digitsarray"<<endl; | |
292 | ||
293 | Int_t total_digits=counter; | |
294 | Int_t sector,row,tot_charge,pad,time,charge; | |
b1886074 | 295 | Double_t r1,r2,phi1,phi2,eta,kappa,phi_0; |
b1886074 | 296 | Float_t xyz[3]; |
3ef466c5 | 297 | |
298 | counter=0; | |
c52cf5d8 | 299 | tempPt = GetDataPointer(); |
3ef466c5 | 300 | |
26abc209 | 301 | for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++) |
b1886074 | 302 | { |
3ef466c5 | 303 | AliL3DigitData *digPt = tempPt->fDigitData; |
304 | for(UInt_t di=0; di<tempPt->fNDigit; di++) | |
b1886074 | 305 | { |
3ef466c5 | 306 | charge = digPt[di].fCharge; |
b1886074 | 307 | pad = digPt[di].fPad; |
308 | time = digPt[di].fTime; | |
4ab9f8f0 | 309 | AliL3Transform::Slice2Sector(GetSlice(),i,sector,row); |
310 | AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time); | |
311 | eta = AliL3Transform::GetEta(xyz); | |
3ef466c5 | 312 | digits[counter].row = i; |
313 | digits[counter].r = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]); | |
314 | digits[counter].phi = atan2(xyz[1],xyz[0]); | |
315 | digits[counter].eta_index = GetEtaIndex(eta); | |
316 | digits[counter].charge = charge; | |
93657878 | 317 | #ifdef do_mc |
c980a70c | 318 | if(fDoMC) |
319 | { | |
320 | digits[counter].trackID[0] = digPt[di].fTrackID[0]; | |
321 | digits[counter].trackID[1] = digPt[di].fTrackID[1]; | |
322 | digits[counter].trackID[2] = digPt[di].fTrackID[2]; | |
323 | } | |
93657878 | 324 | #endif |
3ef466c5 | 325 | counter++; |
326 | } | |
327 | AliL3MemHandler::UpdateRowPointer(tempPt); | |
328 | } | |
329 | ||
330 | for(Int_t i=0; i<total_digits; i++) | |
331 | { | |
c52cf5d8 | 332 | if(digits[i].eta_index < 0 || digits[i].eta_index >= GetNEtaSegments()) continue; |
3ef466c5 | 333 | Int_t ind = digits[i].eta_index; |
334 | ||
335 | for(Int_t j=i+1; j<total_digits; j++) | |
336 | { | |
337 | if(digits[i].row == digits[j].row) continue; | |
338 | if(digits[i].eta_index != digits[j].eta_index) continue; | |
339 | if(digits[i].row + row_range < digits[j].row) break; | |
b1886074 | 340 | |
341 | //Get the correct histogrampointer: | |
3ef466c5 | 342 | AliL3Histogram *hist = fParamSpace[ind]; |
b1886074 | 343 | if(!hist) |
344 | { | |
3ef466c5 | 345 | printf("AliL3HoughTransformer::TransformCircleC() : No histogram at index %d\n",ind); |
b1886074 | 346 | continue; |
347 | } | |
3ef466c5 | 348 | |
349 | r1 = digits[i].r; | |
350 | phi1 = digits[i].phi; | |
351 | r2 = digits[j].r; | |
352 | phi2 = digits[j].phi; | |
353 | phi_0 = atan( (r2*sin(phi1)-r1*sin(phi2))/(r2*cos(phi1)-r1*cos(phi2)) ); | |
354 | kappa = 2*sin(phi2-phi_0)/r2; | |
355 | tot_charge = digits[i].charge + digits[j].charge; | |
356 | hist->Fill(kappa,phi_0,tot_charge); | |
1eef4efc | 357 | #ifdef do_mc |
c980a70c | 358 | if(fDoMC) |
1eef4efc | 359 | { |
c980a70c | 360 | Int_t bin = hist->FindBin(kappa,phi_0); |
361 | for(Int_t l=0; l<3; l++) | |
1eef4efc | 362 | { |
c980a70c | 363 | for(Int_t m=0; m<3; m++) |
1eef4efc | 364 | { |
c980a70c | 365 | if(digits[i].trackID[l] == digits[j].trackID[m]) |
366 | { | |
367 | Int_t label = digits[i].trackID[l]; | |
368 | if(label < 0) continue; | |
369 | UInt_t c; | |
370 | for(c=0; c<MaxTrack; c++) | |
371 | if(fTrackID[ind][bin].fLabel[c] == label || fTrackID[ind][bin].fNHits[c] == 0) | |
372 | break; | |
373 | if(c == MaxTrack-1) cerr<<"AliL3HoughTransformer::TransformCircleC : Array reached maximum!! "<<c<<endl; | |
374 | fTrackID[ind][bin].fLabel[c] = label; | |
375 | fTrackID[ind][bin].fNHits[c]++; | |
376 | } | |
1eef4efc | 377 | } |
378 | } | |
379 | } | |
380 | #endif | |
b1886074 | 381 | } |
382 | } | |
3ef466c5 | 383 | delete [] digits; |
b1886074 | 384 | } |
385 | ||
4fc9a6a4 | 386 | void AliL3HoughTransformer::TransformLine() |
387 | { | |
388 | //Do a line transform on the data. | |
389 | ||
390 | ||
c52cf5d8 | 391 | AliL3DigitRowData *tempPt = GetDataPointer(); |
392 | if(!tempPt) | |
4fc9a6a4 | 393 | { |
237d3f5c | 394 | LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformLine","Data") |
395 | <<"No input data "<<ENDLOG; | |
396 | return; | |
397 | } | |
26abc209 | 398 | |
399 | for(Int_t i=AliL3Transform::GetFirstRow(GetPatch()); i<=AliL3Transform::GetLastRow(GetPatch()); i++) | |
4fc9a6a4 | 400 | { |
401 | AliL3DigitData *digPt = tempPt->fDigitData; | |
402 | if(i != (Int_t)tempPt->fRow) | |
403 | { | |
404 | printf("AliL3HoughTransform::TransformLine : Mismatching padrow numbering\n"); | |
405 | continue; | |
406 | } | |
407 | for(UInt_t j=0; j<tempPt->fNDigit; j++) | |
408 | { | |
409 | UShort_t charge = digPt[j].fCharge; | |
410 | UChar_t pad = digPt[j].fPad; | |
411 | UShort_t time = digPt[j].fTime; | |
3bb06991 | 412 | if(charge < GetLowerThreshold()) |
4fc9a6a4 | 413 | continue; |
414 | Int_t sector,row; | |
415 | Float_t xyz[3]; | |
4ab9f8f0 | 416 | AliL3Transform::Slice2Sector(GetSlice(),i,sector,row); |
417 | AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time); | |
418 | Float_t eta = AliL3Transform::GetEta(xyz); | |
b5a207b4 | 419 | Int_t eta_index = GetEtaIndex(eta);//(Int_t)(eta/etaslice); |
c52cf5d8 | 420 | if(eta_index < 0 || eta_index >= GetNEtaSegments()) |
4fc9a6a4 | 421 | continue; |
422 | ||
423 | //Get the correct histogram: | |
424 | AliL3Histogram *hist = fParamSpace[eta_index]; | |
425 | if(!hist) | |
426 | { | |
427 | printf("AliL3HoughTransformer::TransformLine : Error getting histogram in index %d\n",eta_index); | |
428 | continue; | |
429 | } | |
430 | for(Int_t xbin=hist->GetFirstXbin(); xbin<hist->GetLastXbin(); xbin++) | |
431 | { | |
432 | Double_t theta = hist->GetBinCenterX(xbin); | |
433 | Double_t rho = xyz[0]*cos(theta) + xyz[1]*sin(theta); | |
434 | hist->Fill(theta,rho,charge); | |
435 | } | |
436 | } | |
48f3c46f | 437 | AliL3MemHandler::UpdateRowPointer(tempPt); |
4fc9a6a4 | 438 | } |
439 | ||
440 | } | |
1eef4efc | 441 | |
442 | Int_t AliL3HoughTransformer::GetTrackID(Int_t eta_index,Double_t kappa,Double_t psi) | |
443 | { | |
c980a70c | 444 | if(!fDoMC) |
445 | { | |
446 | cerr<<"AliL3HoughTransformer::GetTrackID : Flag switched off"<<endl; | |
447 | return -1; | |
448 | } | |
449 | ||
1eef4efc | 450 | #ifdef do_mc |
451 | if(eta_index < 0 || eta_index > GetNEtaSegments()) | |
452 | { | |
453 | cerr<<"AliL3HoughTransformer::GetTrackID : Wrong etaindex "<<eta_index<<endl; | |
454 | return -1; | |
455 | } | |
456 | AliL3Histogram *hist = fParamSpace[eta_index]; | |
457 | Int_t bin = hist->FindBin(kappa,psi); | |
458 | Int_t label=-1; | |
459 | Int_t max=0; | |
460 | for(UInt_t i=0; i<MaxTrack; i++) | |
461 | { | |
462 | Int_t nhits=fTrackID[eta_index][bin].fNHits[i]; | |
463 | if(nhits == 0) break; | |
464 | if(nhits > max) | |
465 | { | |
466 | max = nhits; | |
467 | label = fTrackID[eta_index][bin].fLabel[i]; | |
468 | } | |
469 | } | |
470 | return label; | |
471 | #endif | |
472 | cout<<"AliL3HoughTransformer::GetTrackID : Compile with do_mc flag!"<<endl; | |
473 | return -1; | |
474 | } | |
475 |