]>
Commit | Line | Data |
---|---|---|
7e914051 | 1 | // $Id$ |
ff2f0f94 | 2 | |
892210c7 | 3 | //************************************************************************** |
4 | //* This file is property of and copyright by the ALICE HLT Project * | |
5 | //* ALICE Experiment at CERN, All rights reserved. * | |
6 | //* * | |
7 | //* Primary Authors: J. Wagner <jwagner@cern.ch> * | |
8 | //* for The ALICE HLT Project. * | |
9 | //* * | |
10 | //* Permission to use, copy, modify and distribute this software and its * | |
11 | //* documentation strictly for non-commercial purposes is hereby granted * | |
12 | //* without fee, provided that the above copyright notice appears in all * | |
13 | //* copies and that both the copyright notice and this permission notice * | |
14 | //* appear in the supporting documentation. The authors make no claims * | |
15 | //* about the suitability of this software for any purpose. It is * | |
16 | //* provided "as is" without express or implied warranty. * | |
17 | //************************************************************************** | |
ff2f0f94 | 18 | |
19 | /** @file AliHLTTPCCompModelAnalysis.cxx | |
20 | @author J. Wagner jwagner@cern.ch | |
21 | @date 17-11-2007 | |
22 | @brief A processing analysis component for the HLT */ | |
23 | ||
24 | #if __GNUC__ >= 3 | |
25 | using namespace std; | |
26 | #endif | |
27 | ||
28 | #include "AliHLTTPCCompModelAnalysis.h" | |
29 | #include "AliHLTTPCTransform.h" | |
30 | #include "AliHLTTPCModelTrack.h" | |
31 | #include "AliHLTTPCCompDataCompressorHelper.h" | |
32 | #include "TFile.h" | |
33 | #include "TH1.h" | |
34 | #include <cerrno> | |
35 | ||
36 | /** constructor **/ | |
37 | AliHLTTPCCompModelAnalysis::AliHLTTPCCompModelAnalysis(Bool_t modelanalysis, Bool_t trackanalysis, TString dumpfilename, TString graphfilename): | |
38 | fModelAnalysis(modelanalysis), | |
39 | fTrackAnalysis(trackanalysis), | |
40 | fDumpFileName(dumpfilename), | |
41 | fGraphFileName(graphfilename), | |
42 | fFirstTrackArray(), | |
43 | fSecondTrackArray(), | |
44 | fFirstTrackList(NULL), | |
45 | fSecondTrackList(NULL), | |
46 | fFirstTrashTracks(0), | |
47 | fSecondTrashTracks(0), | |
48 | fTotalComparedTracks(0), | |
49 | fMatchedFirstTrashTracks(0), | |
50 | fMatchedSecondTrashTracks(0), | |
51 | fFirstUnmatchedTracks(0), | |
52 | fSecondUnmatchedTracks(0), | |
53 | fToleranceDeviation(0.0), | |
54 | fTrackListPointer(NULL), | |
55 | fTotalDiscardedClusters(0), | |
56 | fValuableDiscardedClusters(0), | |
57 | fTrashTracks(0) | |
58 | { | |
59 | // see header file for class documentation | |
978e5544 | 60 | // or |
61 | // refer to README to build package | |
62 | // or | |
63 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
ff2f0f94 | 64 | } |
65 | ||
66 | /** destructor **/ | |
67 | AliHLTTPCCompModelAnalysis::~AliHLTTPCCompModelAnalysis() | |
68 | { | |
978e5544 | 69 | // see header file for class documentation |
ff2f0f94 | 70 | for ( UInt_t slice=0; slice<36; slice++ ) |
71 | for ( UInt_t patch=0; patch<6; patch++ ) | |
72 | { | |
e61d1d2a | 73 | if ( fDiscardedClusters[slice][patch]!=NULL ) |
ff2f0f94 | 74 | { |
75 | delete [] fDiscardedClusters[slice][patch]; | |
e61d1d2a | 76 | fDiscardedClusters[slice][patch]=NULL; |
ff2f0f94 | 77 | } |
78 | } | |
79 | } | |
80 | ||
81 | /** initialise arrays for tracks/ discarded clusters depending on model-flags **/ | |
82 | Int_t AliHLTTPCCompModelAnalysis::Init() | |
83 | { | |
84 | // see header file for class documentation | |
85 | ||
86 | if(fTrackAnalysis) // track quantities are to be initialised | |
87 | { | |
88 | fFirstTrackArray.Reset(); | |
89 | fSecondTrackArray.Reset(); | |
90 | ||
91 | fFirstTrackList = NULL; | |
92 | fSecondTrackList = NULL; | |
93 | ||
94 | fFirstTrashTracks = 0; | |
95 | fSecondTrashTracks = 0; | |
96 | ||
97 | fTotalComparedTracks = 0; | |
98 | fMatchedFirstTrashTracks = 0; | |
99 | fMatchedSecondTrashTracks = 0; | |
100 | ||
101 | fFirstUnmatchedTracks = 0; | |
102 | fSecondUnmatchedTracks = 0; | |
103 | ||
104 | fToleranceDeviation = 0.001; | |
105 | ||
106 | } | |
107 | ||
108 | if(fModelAnalysis) // cluster array to be initialised | |
109 | { | |
110 | for ( UInt_t slice=0; slice<36; slice++ ) | |
111 | { | |
112 | for ( UInt_t patch=0; patch<6; patch++ ) | |
113 | { | |
114 | fDiscardedClusters[slice][patch] = NULL; | |
115 | } | |
116 | } | |
117 | ||
118 | // initialise trash track list to store discarded tracks | |
119 | fTrackListPointer = NULL; | |
120 | ||
121 | // set all counters to zero: | |
122 | fTrashTracks = 0; | |
123 | fTotalDiscardedClusters = 0; | |
124 | fValuableDiscardedClusters = 0; | |
125 | } | |
126 | ||
127 | return 0; | |
128 | } | |
129 | ||
130 | Int_t AliHLTTPCCompModelAnalysis::DisplayResults() | |
131 | { | |
132 | // see header file for class documentation | |
133 | HLTInfo("--------------------DISPLAYING RESULTS---------------------"); | |
134 | // if model loss analysis, then display these results, else display track results | |
135 | if (fModelAnalysis) | |
136 | { | |
137 | DisplayModelResults(); | |
138 | }; | |
139 | ||
140 | if (fTrackAnalysis) | |
141 | { | |
142 | DisplayTrackResults(); | |
143 | }; | |
144 | ||
145 | // error message: if no analysis flag is switched on | |
146 | if( (!fModelAnalysis) && (!fTrackAnalysis) ) | |
147 | { | |
148 | HLTError("Error! Display Results called without any analysis flag switched on."); | |
149 | return 1; | |
150 | } | |
151 | ||
152 | return 0; | |
153 | } | |
154 | ||
155 | Int_t AliHLTTPCCompModelAnalysis::SetTracks(AliHLTTPCTrackletData* tracklets, Bool_t fillingfirsttracks) | |
156 | { | |
157 | // see header file for class documentation | |
158 | // if fFillingFirstTrackArray is true (i.e. first input file in component is processed) | |
159 | // first input track array is filled | |
160 | // else the second track array is filled | |
161 | ||
162 | if(fillingfirsttracks) | |
163 | { | |
164 | HLTDebug( "Reading %u tracks in first array", (unsigned) tracklets->fTrackletCnt ); | |
165 | ||
166 | if(tracklets->fTrackletCnt == 0) | |
167 | { | |
168 | HLTError("Error! No tracklets to fill into first track array!"); | |
169 | return EINVAL; | |
170 | } | |
171 | else | |
172 | { | |
173 | fFirstTrackArray.FillTracks(tracklets->fTrackletCnt, tracklets->fTracklets ); | |
174 | } | |
175 | ||
176 | } | |
177 | else | |
178 | { | |
179 | if(tracklets->fTrackletCnt == 0) | |
180 | { | |
181 | HLTError("Error! No tracklets to fill into second track array!"); | |
182 | return EINVAL; | |
183 | } | |
184 | else | |
185 | { | |
186 | fSecondTrackArray.FillTracks(tracklets->fTrackletCnt, tracklets->fTracklets ); | |
187 | } | |
188 | // read in tracks in second array (tracks from clusters after Vestbo in second tracking process) | |
189 | HLTDebug( "Reading %u tracks in second array", (unsigned) tracklets->fTrackletCnt ); | |
190 | ||
191 | } | |
192 | ||
193 | return 0; | |
194 | } | |
195 | ||
892210c7 | 196 | Int_t AliHLTTPCCompModelAnalysis::SetClusters(AliHLTTPCClusterData* clusters, UInt_t slice, UInt_t patch, Bool_t fillingfirstclusters) |
197 | { | |
198 | // see header file for class documentation | |
199 | if(fillingfirstclusters == 1) | |
200 | { | |
201 | if ( slice>=36 || patch>=6 ) | |
202 | return EINVAL; | |
203 | if ( fOriginalClusters[slice][patch] ) | |
204 | return EBUSY; | |
205 | fOriginalClusters[slice][patch] = clusters; | |
206 | ||
207 | //HLTDebug( "Filling %u clusters in first array", (unsigned)clusters->fSpacePointCnt); | |
208 | } | |
209 | else | |
210 | { | |
211 | if ( slice>=36 || patch>=6 ) | |
212 | return EINVAL; | |
213 | if ( fSecondaryClusters[slice][patch] ) | |
214 | return EBUSY; | |
215 | fSecondaryClusters[slice][patch] = clusters; | |
216 | ||
217 | //HLTDebug( "Filling %u clusters in second array", (unsigned)clusters->fSpacePointCnt); | |
218 | } | |
219 | return 0; | |
220 | } | |
221 | ||
ff2f0f94 | 222 | Int_t AliHLTTPCCompModelAnalysis::CompareTracks() |
223 | { | |
224 | // see header file for class documentation | |
225 | // define variables for number of tracks in track arrays: | |
226 | Int_t firsttracks = fFirstTrackArray.GetNTracks(); | |
227 | Int_t secondtracks = fSecondTrackArray.GetNTracks(); | |
228 | ||
229 | // error checking: if second array has been filled or not: | |
230 | if(firsttracks == 0) | |
231 | { | |
232 | HLTError("No tracks in first track array!"); | |
e61d1d2a | 233 | return -EINVAL; |
ff2f0f94 | 234 | }; |
235 | ||
236 | ||
237 | if(secondtracks == 0) | |
238 | { | |
239 | HLTError("No tracks in second track array!"); | |
e61d1d2a | 240 | return -EINVAL; |
ff2f0f94 | 241 | }; |
242 | ||
243 | // take track from first tracking, | |
244 | for(Int_t ii=0; ii < firsttracks; ii++) | |
245 | { | |
f720fdfc | 246 | if (fFirstTrackArray.GetCheckedTrack(ii)==NULL) continue; |
247 | ||
ff2f0f94 | 248 | // build track list for all tracks in first array |
e61d1d2a | 249 | // FIXME: I can't find the cleanup of the linked list fFirstTrackList |
ff2f0f94 | 250 | AliHLTTPCTrackList* currenttrackentry = new AliHLTTPCTrackList; |
e61d1d2a | 251 | if (!currenttrackentry) return -ENOMEM; |
978e5544 | 252 | currenttrackentry->fTrack = *(fFirstTrackArray.GetCheckedTrack(ii)); |
ff2f0f94 | 253 | |
254 | // get its pythia information, | |
978e5544 | 255 | currenttrackentry->fPythiatrack = GetComparableTrackPythiaInfo(currenttrackentry->fTrack); |
ff2f0f94 | 256 | |
978e5544 | 257 | currenttrackentry->fMatchingindicator = 0; |
ff2f0f94 | 258 | |
259 | // put this element as first in list | |
978e5544 | 260 | currenttrackentry->fNext = fFirstTrackList; |
ff2f0f94 | 261 | fFirstTrackList = currenttrackentry; |
262 | ||
263 | // count tracks below 0.1GeV | |
978e5544 | 264 | if(currenttrackentry->fTrack.GetPt()<0.1) |
ff2f0f94 | 265 | { |
266 | ++fFirstTrashTracks; | |
267 | } | |
268 | ||
269 | } | |
270 | ||
271 | // take track from second tracking, | |
272 | for(Int_t ii=0; ii < secondtracks; ii++) | |
273 | { | |
274 | // build track list for all tracks in second array | |
e61d1d2a | 275 | // FIXME: I can't find the cleanup of the linked list fSecondTrackArray |
ff2f0f94 | 276 | AliHLTTPCTrackList* currenttrackentry = new AliHLTTPCTrackList; |
e61d1d2a | 277 | if (!currenttrackentry) return -ENOMEM; |
978e5544 | 278 | currenttrackentry->fTrack = *(fSecondTrackArray.GetCheckedTrack(ii)); |
ff2f0f94 | 279 | |
280 | // get its pythia information, | |
978e5544 | 281 | currenttrackentry->fPythiatrack = GetComparableTrackPythiaInfo(currenttrackentry->fTrack); |
ff2f0f94 | 282 | |
283 | // put this element as first in list | |
978e5544 | 284 | currenttrackentry->fNext = fSecondTrackList; |
ff2f0f94 | 285 | fSecondTrackList = currenttrackentry; |
286 | ||
287 | // count tracks below 0.1GeV | |
978e5544 | 288 | if(currenttrackentry->fTrack.GetPt()<0.1) |
ff2f0f94 | 289 | { |
290 | ++fSecondTrashTracks; | |
291 | } | |
292 | ||
293 | } | |
294 | ||
295 | // search for matching track from secondary tracking | |
296 | AliHLTTPCTrackList* firstmatchpointer = fFirstTrackList; | |
297 | ||
298 | while(firstmatchpointer != NULL) | |
299 | { | |
300 | AliHLTTPCTrackList* secondmatchpointer = fSecondTrackList; | |
301 | ||
302 | while(secondmatchpointer != NULL) | |
303 | { | |
304 | ||
305 | // compare paramters of the two tracks, | |
306 | // match only when coincidence >= 50% in fToleranceDeviation range! | |
307 | if ((CompareTrackInfo(firstmatchpointer, secondmatchpointer) > 4)) | |
308 | { | |
309 | ||
978e5544 | 310 | if((CompareTrackInfo(firstmatchpointer, secondmatchpointer) > firstmatchpointer->fMatchingindicator)) |
ff2f0f94 | 311 | { |
312 | // look if current better matching track has already been matched before | |
978e5544 | 313 | if((CompareTrackInfo(firstmatchpointer, secondmatchpointer) > secondmatchpointer->fMatchingindicator)) |
ff2f0f94 | 314 | { |
315 | ||
316 | // set previously assigned matchingindicator (if there was one) of secondary track back to zero | |
978e5544 | 317 | if(firstmatchpointer->fMatchingindicator > 0) |
ff2f0f94 | 318 | { |
978e5544 | 319 | firstmatchpointer->fMatchingtrack->fMatchingindicator = 0; |
320 | firstmatchpointer->fMatchingtrack->fMatchingtrack = NULL; | |
ff2f0f94 | 321 | } |
322 | ||
978e5544 | 323 | if(secondmatchpointer->fMatchingindicator > 0) |
ff2f0f94 | 324 | { |
978e5544 | 325 | secondmatchpointer->fMatchingtrack->fMatchingindicator = 0; |
326 | secondmatchpointer->fMatchingtrack->fMatchingtrack = NULL; | |
ff2f0f94 | 327 | } |
328 | ||
329 | // compare according to tracks themselves (other possibility: compare pythiatracks - better!) | |
978e5544 | 330 | secondmatchpointer->fMatchingindicator = CompareTrackInfo(firstmatchpointer, secondmatchpointer) ; |
331 | firstmatchpointer->fMatchingindicator = CompareTrackInfo(firstmatchpointer, secondmatchpointer); | |
ff2f0f94 | 332 | |
333 | // remember which track matches which | |
978e5544 | 334 | secondmatchpointer->fMatchingtrack = firstmatchpointer; |
335 | firstmatchpointer->fMatchingtrack = secondmatchpointer; | |
ff2f0f94 | 336 | |
337 | } // end if compare > second matching indicator | |
338 | ||
339 | } // end if compare > first matching indicator | |
340 | ||
341 | }// end if compare > 4 | |
342 | ||
978e5544 | 343 | secondmatchpointer = secondmatchpointer->fNext; |
ff2f0f94 | 344 | } |
345 | ||
346 | // go on with next original track | |
978e5544 | 347 | firstmatchpointer = firstmatchpointer->fNext; |
ff2f0f94 | 348 | } |
349 | ||
350 | // count not matched tracks in first and second track list | |
351 | AliHLTTPCTrackList* nomatchcounter = fFirstTrackList; | |
352 | ||
353 | while(nomatchcounter != NULL) | |
354 | { | |
978e5544 | 355 | if(nomatchcounter->fMatchingindicator == 0) |
ff2f0f94 | 356 | { |
357 | ++fFirstUnmatchedTracks; | |
358 | } | |
359 | else | |
360 | { | |
361 | ++fTotalComparedTracks; | |
362 | ||
363 | // count matched trash tracks | |
978e5544 | 364 | if(nomatchcounter->fTrack.GetPt() < 0.1) |
ff2f0f94 | 365 | { |
366 | ++fMatchedFirstTrashTracks; | |
367 | }; | |
368 | } | |
978e5544 | 369 | nomatchcounter = nomatchcounter->fNext; |
ff2f0f94 | 370 | } |
371 | ||
372 | nomatchcounter = fSecondTrackList; | |
373 | while(nomatchcounter != NULL) | |
374 | { | |
978e5544 | 375 | if(nomatchcounter->fMatchingindicator == 0) |
ff2f0f94 | 376 | { |
377 | ++fSecondUnmatchedTracks; | |
378 | } | |
379 | else | |
380 | { | |
381 | // count matched trash tracks | |
978e5544 | 382 | if(nomatchcounter->fTrack.GetPt() < 0.1) |
ff2f0f94 | 383 | { |
384 | ++fMatchedSecondTrashTracks; | |
385 | }; | |
386 | } | |
387 | ||
978e5544 | 388 | nomatchcounter = nomatchcounter->fNext; |
ff2f0f94 | 389 | } |
390 | ||
391 | // consistency check: fFirstUnmatchedTracks + fTotalComparedTracks = # of tracks in first array | |
392 | // ...and analogously for second array: | |
393 | if(fFirstUnmatchedTracks + fTotalComparedTracks != firsttracks) | |
394 | { | |
395 | HLTWarning("Warning! Possible inconsistency in original track array: Number of compared and unmatched tracks not equal to total number of tracks!"); | |
396 | }; | |
397 | ||
398 | if(fSecondUnmatchedTracks + fTotalComparedTracks != secondtracks) | |
399 | { | |
400 | HLTWarning("Warning! Possible inconsistency in second track array: Number of compared and unmatched tracks not equal to total number of tracks!"); | |
401 | }; | |
402 | ||
403 | return 0; | |
404 | } | |
405 | ||
892210c7 | 406 | Int_t AliHLTTPCCompModelAnalysis::CompareClusters(Bool_t relativedifferences) |
407 | { | |
408 | ||
409 | Int_t totaloriginal = 0; | |
410 | Int_t totalsecondary = 0; | |
411 | Int_t usedclusters = 0; | |
412 | Int_t comparedclusters = 0; | |
413 | Int_t notcomparedclusters = 0; | |
414 | ||
415 | // create graphs out of differences and leave loop | |
5eefc803 | 416 | TFile* clustergraphrootfile = NULL; |
892210c7 | 417 | if(!fGraphFileName.IsNull()) |
418 | { | |
419 | clustergraphrootfile = new TFile(fGraphFileName, "recreate"); | |
420 | } | |
421 | ||
422 | // specifications of histograms | |
423 | Double_t clusterdifffxmin, clusterdifffxmax; | |
424 | Double_t clusterdifffymin, clusterdifffymax; | |
425 | Double_t clusterdifffzmin, clusterdifffzmax; | |
426 | Int_t clusterdifffxbins, clusterdifffybins, clusterdifffzbins; | |
427 | ||
428 | Double_t clusterdifffsigmay2min, clusterdifffsigmay2max; | |
429 | Double_t clusterdifffsigmaz2min, clusterdifffsigmaz2max; | |
430 | Int_t clusterdifffsigmay2bins, clusterdifffsigmaz2bins; | |
431 | ||
432 | if (!relativedifferences) // not tested yet! | |
433 | { | |
434 | clusterdifffxmin = -1; | |
435 | clusterdifffxmax = +1; | |
436 | clusterdifffxbins = (Int_t) ((clusterdifffxmax - clusterdifffxmin)/0.0001); | |
437 | ||
438 | clusterdifffymin = -1; | |
439 | clusterdifffymax = +1; | |
440 | clusterdifffybins = (Int_t) ((clusterdifffymax - clusterdifffymin)/0.0001); | |
441 | ||
442 | clusterdifffzmin = -1; | |
443 | clusterdifffzmax = +1; | |
444 | clusterdifffzbins = (Int_t) ((clusterdifffzmax - clusterdifffzmin)/0.0001); | |
445 | ||
446 | clusterdifffsigmay2min = -1; | |
447 | clusterdifffsigmay2max = +1; | |
448 | clusterdifffsigmay2bins = (Int_t) ((clusterdifffsigmay2max - clusterdifffsigmay2min)/0.0001); | |
449 | ||
450 | clusterdifffsigmaz2min = -1; | |
451 | clusterdifffsigmaz2max = +1; | |
452 | clusterdifffsigmaz2bins = (Int_t) ((clusterdifffsigmaz2max - clusterdifffsigmaz2min)/0.0001); | |
453 | } | |
454 | else | |
455 | { | |
456 | clusterdifffxmin = -1; | |
457 | clusterdifffxmax = +1; | |
458 | clusterdifffxbins = (Int_t) ((clusterdifffxmax - clusterdifffxmin)/0.0001); | |
459 | ||
460 | clusterdifffymin = -1; | |
461 | clusterdifffymax = +1; | |
462 | clusterdifffybins = (Int_t) ((clusterdifffymax - clusterdifffymin)/0.0001); | |
463 | ||
464 | clusterdifffzmin = -1; | |
465 | clusterdifffzmax = +1; | |
466 | clusterdifffzbins = (Int_t) ((clusterdifffzmax - clusterdifffzmin)/0.0001); | |
467 | ||
468 | clusterdifffsigmay2min = -1; | |
469 | clusterdifffsigmay2max = +1; | |
470 | clusterdifffsigmay2bins = (Int_t) ((clusterdifffsigmay2max - clusterdifffsigmay2min)/0.0001); | |
471 | ||
472 | clusterdifffsigmaz2min = -1; | |
473 | clusterdifffsigmaz2max = +1; | |
474 | clusterdifffsigmaz2bins = (Int_t) ((clusterdifffsigmaz2max - clusterdifffsigmaz2min)/0.0001); | |
475 | } | |
476 | ||
477 | // intialise histogramms | |
478 | TH1F* clusterfxhisto = new TH1F("Differences of x (original - secondary) clusters", "Differences of x (original - secondary) clusters", clusterdifffxbins, clusterdifffxmin, clusterdifffxmax); | |
479 | TH1F* clusterfyhisto = new TH1F("Differences of y (original - secondary) clusters", "Differences of y (original - secondary) clusters", clusterdifffybins, clusterdifffymin, clusterdifffymax); | |
480 | TH1F* clusterfzhisto = new TH1F("Differences of z (original - secondary) clusters", "Differences of z (original - secondary) clusters", clusterdifffzbins, clusterdifffzmin, clusterdifffzmax); | |
481 | TH1F* clusterfsigmay2histo = new TH1F("Differences of sigmay2 (original - secondary) clusters", "Differences of sigmay2 (original - secondary) clusters", clusterdifffsigmay2bins, clusterdifffsigmay2min, clusterdifffsigmay2max); | |
482 | TH1F* clusterfsigmaz2histo = new TH1F("Differences of sigmaz2 (original - secondary) clusters", "Differences of sigmaz2 (original - secondary) clusters", clusterdifffsigmaz2bins, clusterdifffsigmaz2min, clusterdifffsigmaz2max); | |
483 | ||
484 | ||
485 | // see headerfile for class documentation | |
486 | // compare for each slice and patch the clusters in the original cluster array | |
487 | // to the ones of the secondary cluster array | |
488 | for(Int_t slicecntr = 0; slicecntr < 36; slicecntr++) | |
489 | { | |
490 | for (Int_t patchcntr = 0; patchcntr < 6; patchcntr++) | |
491 | { | |
492 | if(!fOriginalClusters[slicecntr][patchcntr]) | |
493 | { | |
494 | // HLTDebug("No original clusters for slice %d patch %d", slicecntr, patchcntr); | |
495 | continue; | |
496 | } | |
497 | ||
498 | if(!fSecondaryClusters[slicecntr][patchcntr]) | |
499 | { | |
500 | //HLTDebug("No secondary clusters for slice %d patch %d", slicecntr, patchcntr); | |
501 | continue; | |
502 | } | |
503 | ||
504 | for ( unsigned long ii=0; ii<fOriginalClusters[slicecntr][patchcntr]->fSpacePointCnt; ii++ ) | |
505 | { | |
506 | ++totaloriginal; | |
507 | ||
508 | // search matching secondary cluster by charge and padrow, | |
509 | // fill histograms if cluster has been used in tracking process | |
510 | Int_t found = 0; | |
511 | ||
512 | for(unsigned long jj=0; jj<fSecondaryClusters[slicecntr][patchcntr]->fSpacePointCnt; jj++) | |
513 | { | |
514 | // if fTrackN != -1 -> draw histograms out of used clusters | |
515 | // if fTrackN == -1 -> draw histograms out of unused clusters | |
516 | if (fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fTrackN == -1) | |
517 | { | |
518 | if((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fCharge == fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fCharge) && (fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fPadRow == fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fPadRow) ) | |
519 | { | |
520 | ||
521 | if (relativedifferences == 1) | |
522 | { | |
523 | // check whether first entries in cluster array are zero | |
524 | if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX == 0) | |
525 | { | |
526 | HLTWarning("Warning! x value of original cluster is zero, relative differences cannot be calculated!"); | |
527 | }; | |
528 | ||
529 | if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY == 0) | |
530 | { | |
531 | HLTWarning("Warning! y value of original cluster is zero, relative differences cannot be calculated!"); | |
532 | }; | |
533 | ||
534 | if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ == 0) | |
535 | { | |
536 | HLTWarning("Warning! z value of original cluster is zero, relative differences cannot be calculated!"); | |
537 | }; | |
538 | ||
539 | if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2 == 0) | |
540 | { | |
541 | HLTWarning("Warning! sigmay2 value of original cluster is zero, relative differences cannot be calculated!"); | |
542 | }; | |
543 | ||
544 | if(fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2 == 0) | |
545 | { | |
546 | HLTWarning("Warning! sigmaz2 value of original cluster is zero, relative differences cannot be calculated!"); | |
547 | }; | |
548 | ||
549 | // fill relative differences in histograms | |
550 | clusterfxhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fX)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX,1); | |
551 | clusterfyhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fY)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY,1); | |
552 | clusterfzhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fZ)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ,1); | |
553 | clusterfsigmay2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaY2)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2,1); | |
554 | clusterfsigmaz2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaZ2)/fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2,1); | |
555 | } | |
556 | else | |
557 | { | |
558 | // fill absolute differences histograms | |
559 | clusterfxhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fX - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fX),1); | |
560 | clusterfyhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fY - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fY),1); | |
561 | clusterfzhisto->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fZ - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fZ),1); | |
562 | clusterfsigmay2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaY2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaY2),1); | |
563 | clusterfsigmaz2histo->Fill((fOriginalClusters[slicecntr][patchcntr]->fSpacePoints[ii].fSigmaZ2 - fSecondaryClusters[slicecntr][patchcntr]->fSpacePoints[jj].fSigmaZ2),1); | |
564 | } | |
565 | ||
566 | found = 1; | |
567 | ++comparedclusters; | |
568 | break; | |
569 | } | |
570 | } | |
571 | } | |
572 | ||
573 | if(found == 0) | |
574 | { | |
575 | ++notcomparedclusters; | |
576 | } | |
577 | ||
578 | } | |
579 | } | |
580 | } | |
581 | ||
582 | // write graphs to rootfile | |
583 | if(!fGraphFileName.IsNull()) | |
584 | { | |
585 | clustergraphrootfile->WriteObject(clusterfxhisto, "clusterfxhistogram"); | |
586 | clustergraphrootfile->WriteObject(clusterfyhisto, "clusterfyhistogram"); | |
587 | clustergraphrootfile->WriteObject(clusterfzhisto, "clusterfzhistogram"); | |
588 | clustergraphrootfile->WriteObject(clusterfsigmay2histo, "clusterfsigmay2histogram"); | |
589 | clustergraphrootfile->WriteObject(clusterfsigmaz2histo, "clusterfsigmaz2histogram"); | |
590 | clustergraphrootfile->Close(); | |
591 | } | |
592 | ||
593 | // count clusters used for tracking | |
594 | for (Int_t slicecount=0; slicecount<36; slicecount++) | |
595 | { | |
596 | for(Int_t patchcount=0; patchcount<6; patchcount++) | |
597 | { | |
598 | ||
599 | if(!fSecondaryClusters[slicecount][patchcount]) | |
600 | { | |
601 | //HLTDebug("No secondary clusters for slice %d patch %d", slicecntr, patchcntr); | |
602 | continue; | |
603 | } | |
604 | ||
5eefc803 | 605 | for(Int_t count=0; count < (Int_t) fSecondaryClusters[slicecount][patchcount]->fSpacePointCnt; count++) |
892210c7 | 606 | { |
607 | ||
608 | ++totalsecondary; | |
609 | ||
610 | if(fSecondaryClusters[slicecount][patchcount]->fSpacePoints[count].fTrackN != -1) | |
611 | { | |
612 | ++usedclusters; | |
613 | }; | |
614 | } | |
615 | } | |
616 | } | |
617 | ||
618 | // Display results of cluster analysis | |
619 | HLTInfo("Number of original clusters: %d", totaloriginal); | |
620 | HLTInfo("Number of 2ndary clusters: %d", totalsecondary); | |
621 | HLTInfo("Number of 2ndary clusters used for tracking: %d", usedclusters); | |
622 | HLTInfo("Number of compared (tracked) original clusters: %d", comparedclusters); | |
623 | HLTInfo("Number of uncompared (tracked) original clusters: %d", notcomparedclusters); | |
624 | ||
625 | ////////////////////////////////////////////////////// | |
626 | FILE* clusterfile = fopen("/afsuser/jwagner/TrackerTest_25092007/cosmics/fullanalysis/clusteranalysis.out", "a"); | |
627 | ||
628 | fprintf(clusterfile, "%d \t %d \t %d \t %d \t %d \t %d \n", totaloriginal, totalsecondary, usedclusters, comparedclusters, notcomparedclusters, totaloriginal-comparedclusters-notcomparedclusters); | |
629 | ||
630 | fclose(clusterfile); | |
631 | //////////////////////////////////////////////////////// | |
632 | ||
633 | // consistency check | |
634 | if(comparedclusters + notcomparedclusters != totaloriginal) | |
635 | { | |
636 | HLTWarning("Possible inconsistency: number of compared clusters %d + number of not compared clusters %d not equal to total number of original clusters %d", comparedclusters, notcomparedclusters, totaloriginal); | |
637 | } | |
638 | ||
639 | return 0; | |
640 | } | |
641 | ||
e61d1d2a | 642 | AliHLTTPCTrack AliHLTTPCCompModelAnalysis::GetComparableTrackPythiaInfo(const AliHLTTPCTrack& comparabletrack) const |
ff2f0f94 | 643 | { |
644 | // see headerfile for class documentation | |
645 | ||
646 | AliHLTTPCTrack pythiatrack = comparabletrack; | |
647 | ||
648 | return pythiatrack; | |
649 | } | |
650 | ||
651 | Int_t AliHLTTPCCompModelAnalysis::MarkTrashTrack(AliHLTTPCTrack *lowpttrack) | |
652 | { | |
653 | // see header file for class documentation | |
654 | ||
655 | // save track first in lowpttrack list (all lowpttracks are displayed in display function altogether) | |
656 | AliHLTTPCTrackList* tracklistentry = new AliHLTTPCTrackList; | |
978e5544 | 657 | tracklistentry->fTrack = *lowpttrack; |
658 | tracklistentry->fWronglydiscarded = GetTrashTrackPythiaInfo(lowpttrack); | |
659 | tracklistentry->fMatchingindicator = 0; // not needed here, therefore initialised to zero | |
660 | tracklistentry->fNext = fTrackListPointer; | |
661 | tracklistentry->fMatchingtrack = NULL; // not needed here, therefore initialised to NULL | |
ff2f0f94 | 662 | fTrackListPointer = tracklistentry; |
663 | ||
664 | ++fTrashTracks; | |
665 | ||
666 | return 0; | |
667 | } | |
668 | ||
669 | Int_t AliHLTTPCCompModelAnalysis::MarkTrashCluster(AliHLTTPCClusterData *discardedcluster, UInt_t slice, UInt_t patch) | |
670 | { | |
671 | // see header file for class documentation | |
672 | ||
673 | // get Pythia information of discarded cluster | |
674 | Bool_t wronglydiscarded = GetClusterPythiaInfo(discardedcluster); | |
675 | ||
676 | // if cluster has been discarded wrongly, save information | |
677 | if(wronglydiscarded) | |
678 | { | |
679 | // store cluster | |
680 | fDiscardedClusters[slice][patch] = discardedcluster; | |
681 | // increase number of valuable discarded clusters | |
682 | ++fValuableDiscardedClusters; | |
683 | } | |
684 | ||
685 | ++fTotalDiscardedClusters; | |
686 | ||
687 | return 0; | |
688 | } | |
689 | ||
e61d1d2a | 690 | Bool_t AliHLTTPCCompModelAnalysis::GetTrashTrackPythiaInfo(const AliHLTTPCTrack* /*discardedtrack*/ ) const |
ff2f0f94 | 691 | { |
692 | // see header file for class documentation | |
693 | // store information from pythia in current track list entry | |
694 | // fTrackListPointer.pythiatrack = FillFromPythia... | |
695 | ||
696 | return 0; | |
697 | } | |
698 | ||
e61d1d2a | 699 | Bool_t AliHLTTPCCompModelAnalysis::GetClusterPythiaInfo(const AliHLTTPCClusterData* /*discardedcluster*/) const |
ff2f0f94 | 700 | { |
701 | // see header file for class documentation | |
702 | // Pythia information can be | |
703 | // either: cluster belongs to discarded track with pt < 0.1 Gev (--> cluster correctly discarded) | |
704 | // or: cluster is discarded and does not belong to any pythia track (--> correctly discarded) | |
705 | // or: cluster is discarded but belongs to pythia track (--> cluster WRONGLY discarded!!!) | |
706 | ||
707 | return 0; | |
708 | } | |
709 | ||
710 | Int_t AliHLTTPCCompModelAnalysis::CompareTrackInfo(AliHLTTPCTrackList* firsttracklistelement, AliHLTTPCTrackList* secondtracklistelement) | |
711 | { | |
712 | // see header file for class documentation | |
713 | // calculate matching indicator accoring to the track information | |
714 | // ++matchingindicator for every paramter that matches | |
715 | ||
716 | Int_t currentmatchingindicator = 0; | |
717 | ||
718 | // tolerance range of 1 percent deviation for each quantity | |
719 | ||
720 | // compare start point (x,y,z) | |
978e5544 | 721 | if(abs((firsttracklistelement->fTrack.GetFirstPointX() - secondtracklistelement->fTrack.GetFirstPointX()))/firsttracklistelement->fTrack.GetFirstPointX() <= fToleranceDeviation) |
ff2f0f94 | 722 | ++currentmatchingindicator; |
723 | ||
978e5544 | 724 | if(abs((firsttracklistelement->fTrack.GetFirstPointY() - secondtracklistelement->fTrack.GetFirstPointY()))/firsttracklistelement->fTrack.GetFirstPointY() <= fToleranceDeviation) |
ff2f0f94 | 725 | ++currentmatchingindicator; |
726 | ||
978e5544 | 727 | if(abs((firsttracklistelement->fTrack.GetFirstPointZ() - secondtracklistelement->fTrack.GetFirstPointZ()))/firsttracklistelement->fTrack.GetFirstPointZ() <= fToleranceDeviation) |
ff2f0f94 | 728 | ++currentmatchingindicator; |
729 | ||
730 | // compare end point | |
978e5544 | 731 | if(abs((firsttracklistelement->fTrack.GetLastPointX() - secondtracklistelement->fTrack.GetLastPointX()))/firsttracklistelement->fTrack.GetLastPointX() <= fToleranceDeviation) |
ff2f0f94 | 732 | ++currentmatchingindicator; |
733 | ||
978e5544 | 734 | if(abs((firsttracklistelement->fTrack.GetLastPointY() - secondtracklistelement->fTrack.GetLastPointY()))/firsttracklistelement->fTrack.GetLastPointY() <= fToleranceDeviation) |
ff2f0f94 | 735 | ++currentmatchingindicator; |
736 | ||
978e5544 | 737 | if(abs((firsttracklistelement->fTrack.GetLastPointZ() - secondtracklistelement->fTrack.GetLastPointZ()))/firsttracklistelement->fTrack.GetLastPointZ() <= fToleranceDeviation) |
ff2f0f94 | 738 | ++currentmatchingindicator; |
739 | ||
740 | // compare pt, psi, tgl | |
978e5544 | 741 | if(abs((firsttracklistelement->fTrack.GetPt() - secondtracklistelement->fTrack.GetPt()))/firsttracklistelement->fTrack.GetPt() <= fToleranceDeviation) |
ff2f0f94 | 742 | ++currentmatchingindicator; |
743 | ||
978e5544 | 744 | if(abs((firsttracklistelement->fTrack.GetPsi() - secondtracklistelement->fTrack.GetPsi()))/firsttracklistelement->fTrack.GetPsi() <= fToleranceDeviation) |
ff2f0f94 | 745 | ++currentmatchingindicator; |
746 | ||
978e5544 | 747 | if(abs((firsttracklistelement->fTrack.GetTgl() - secondtracklistelement->fTrack.GetTgl()))/firsttracklistelement->fTrack.GetTgl() <= fToleranceDeviation) |
ff2f0f94 | 748 | ++currentmatchingindicator; |
749 | ||
750 | // compare number of assigned cluster hits | |
978e5544 | 751 | if(abs((firsttracklistelement->fTrack.GetNHits() - secondtracklistelement->fTrack.GetNHits()))/firsttracklistelement->fTrack.GetNHits() <= fToleranceDeviation) |
ff2f0f94 | 752 | ++currentmatchingindicator; |
753 | ||
754 | return currentmatchingindicator; | |
755 | } | |
756 | ||
757 | Int_t AliHLTTPCCompModelAnalysis::ComparePythiaTrackInfo(AliHLTTPCTrackList* firsttracklistelement, AliHLTTPCTrackList* secondtracklistelement) | |
758 | { | |
759 | // see header file for class documentation | |
760 | // calculate matching indicator accoring to the track information | |
761 | // ++matchingindicator for every paramter that matches | |
762 | ||
763 | Int_t currentmatchingindicator = 0; | |
764 | ||
765 | // tolerance range of 1 percent deviation for each quantity | |
766 | ||
767 | // compare start point (x,y,z) | |
978e5544 | 768 | if(firsttracklistelement->fPythiatrack.GetFirstPointX() == secondtracklistelement->fPythiatrack.GetFirstPointX()) |
ff2f0f94 | 769 | ++currentmatchingindicator; |
770 | ||
978e5544 | 771 | if(firsttracklistelement->fPythiatrack.GetFirstPointY() == secondtracklistelement->fPythiatrack.GetFirstPointY()) |
ff2f0f94 | 772 | ++currentmatchingindicator; |
773 | ||
978e5544 | 774 | if(firsttracklistelement->fPythiatrack.GetFirstPointZ() == secondtracklistelement->fPythiatrack.GetFirstPointZ()) |
ff2f0f94 | 775 | ++currentmatchingindicator; |
776 | ||
777 | // compare end point | |
978e5544 | 778 | if(firsttracklistelement->fPythiatrack.GetLastPointX() == secondtracklistelement->fPythiatrack.GetLastPointX()) |
ff2f0f94 | 779 | ++currentmatchingindicator; |
780 | ||
978e5544 | 781 | if(firsttracklistelement->fPythiatrack.GetLastPointY() == secondtracklistelement->fPythiatrack.GetLastPointY()) |
ff2f0f94 | 782 | ++currentmatchingindicator; |
783 | ||
978e5544 | 784 | if(firsttracklistelement->fPythiatrack.GetLastPointZ() == secondtracklistelement->fPythiatrack.GetLastPointZ()) |
ff2f0f94 | 785 | ++currentmatchingindicator; |
786 | ||
787 | // compare pt, psi, tgl | |
978e5544 | 788 | if(firsttracklistelement->fPythiatrack.GetPt() == secondtracklistelement->fPythiatrack.GetPt()) |
ff2f0f94 | 789 | ++currentmatchingindicator; |
790 | ||
978e5544 | 791 | if(firsttracklistelement->fPythiatrack.GetPsi() == secondtracklistelement->fPythiatrack.GetPsi()) |
ff2f0f94 | 792 | ++currentmatchingindicator; |
793 | ||
978e5544 | 794 | if(firsttracklistelement->fPythiatrack.GetTgl() == secondtracklistelement->fPythiatrack.GetTgl()) |
ff2f0f94 | 795 | ++currentmatchingindicator; |
796 | ||
797 | // compare number of assigned cluster hits | |
978e5544 | 798 | if(firsttracklistelement->fPythiatrack.GetNHits() == secondtracklistelement->fPythiatrack.GetNHits()) |
ff2f0f94 | 799 | ++currentmatchingindicator; |
800 | ||
801 | return currentmatchingindicator; | |
802 | } | |
803 | ||
804 | Int_t AliHLTTPCCompModelAnalysis::CreateGraphs(Bool_t relativedifferences) | |
805 | { | |
806 | // see header file for class documentation | |
807 | AliHLTTPCTrackList* tracklistpointer = fFirstTrackList; | |
808 | ||
809 | AliHLTTPCTrackList* trackmatchingpointer; | |
810 | ||
811 | // set up histogram ranges | |
812 | Double_t difffirstxmin, difffirstxmax; | |
813 | Double_t difffirstymin, difffirstymax; | |
814 | Double_t difffirstzmin, difffirstzmax; | |
815 | Int_t difffirstxbins, difffirstybins, difffirstzbins; | |
816 | ||
817 | Double_t difflastxmin, difflastxmax; | |
818 | Double_t difflastymin, difflastymax; | |
819 | Double_t difflastzmin, difflastzmax; | |
820 | Int_t difflastxbins, difflastybins, difflastzbins; | |
821 | ||
822 | Double_t diffptmin, diffptmax; | |
823 | Double_t diffpsimin, diffpsimax; | |
824 | Double_t difftglmin, difftglmax; | |
825 | Int_t diffptbins, diffpsibins, difftglbins; | |
826 | ||
827 | Double_t diffclustermin, diffclustermax; | |
828 | Int_t diffclusterbins; | |
829 | ||
830 | // resolution histograms (currently not working since pterr = 0 for every track!) | |
831 | Double_t diffpterrmin, diffpterrmax; | |
832 | Double_t diffpsierrmin, diffpsierrmax; | |
833 | Double_t difftglerrmin, difftglerrmax; | |
834 | Int_t diffpterrbins, diffpsierrbins, difftglerrbins; | |
835 | ||
836 | if(!relativedifferences) | |
837 | { | |
838 | difffirstxmin = -2; | |
839 | difffirstxmax = +2; | |
840 | difffirstxbins = (Int_t) ((difffirstxmax - difffirstxmin)/0.0001); | |
841 | ||
842 | difffirstymin = -2; | |
843 | difffirstymax = +2; | |
844 | difffirstybins = (Int_t) ((difffirstymax - difffirstymin)/0.0001); | |
845 | ||
846 | difffirstzmin = -2; | |
847 | difffirstzmax = +2; | |
848 | difffirstzbins = (Int_t) ((difffirstzmax - difffirstzmin)/0.0001); | |
849 | ||
850 | difflastxmin = -2; | |
851 | difflastxmax = +2; | |
852 | difflastxbins = (Int_t) ((difflastxmax - difflastxmin)/0.0001); | |
853 | ||
854 | difflastymin = -2; | |
855 | difflastymax = +2; | |
856 | difflastybins = (Int_t) ((difflastymax - difflastymin)/0.0001); | |
857 | ||
858 | difflastzmin = -2; | |
859 | difflastzmax = +2; | |
860 | difflastzbins = (Int_t) ((difflastzmax - difflastzmin)/0.0001); | |
861 | ||
862 | diffptmin = -1; | |
863 | diffptmax = +1; | |
864 | diffptbins = (Int_t) ((diffptmax - diffptmin)/0.0001); | |
865 | ||
866 | diffpsimin = -1; | |
867 | diffpsimax = +1; | |
868 | diffpsibins = (Int_t) ((diffpsimax - diffpsimin)/0.0001); | |
869 | ||
870 | difftglmin = -1; | |
871 | difftglmax = +1; | |
872 | difftglbins = (Int_t) ((difftglmax - difftglmin)/0.0001); | |
873 | ||
874 | diffclustermin = -50; | |
875 | diffclustermax = +50; | |
876 | diffclusterbins = (Int_t) ((diffclustermax - diffclustermin)/1); | |
877 | ||
892210c7 | 878 | //#if 0 |
ff2f0f94 | 879 | diffpterrmin = -1; |
880 | diffpterrmax = 1; | |
881 | diffpterrbins = (Int_t) ((diffpterrmax - diffpterrmin)/1); | |
882 | ||
883 | diffpsierrmin = -1; | |
884 | diffpsierrmax = 1; | |
885 | diffpsierrbins = (Int_t) ((diffpsierrmax - diffpsierrmin)/1); | |
886 | ||
887 | difftglerrmin = -1; | |
888 | difftglerrmax = 1; | |
889 | difftglerrbins = (Int_t) ((difftglerrmax - difftglerrmin)/1); | |
892210c7 | 890 | //#endif |
ff2f0f94 | 891 | |
892 | } | |
893 | else | |
894 | { | |
895 | difffirstxmin = -1; | |
896 | difffirstxmax = +1; | |
897 | difffirstxbins = (Int_t) ((difffirstxmax - difffirstxmin)/0.0001); | |
898 | ||
899 | difffirstymin = -1; | |
900 | difffirstymax = +1; | |
901 | difffirstybins = (Int_t) ((difffirstymax - difffirstymin)/0.0001); | |
902 | ||
903 | difffirstzmin = -1; | |
904 | difffirstzmax = +1; | |
905 | difffirstzbins = (Int_t) ((difffirstzmax - difffirstzmin)/0.0001); | |
906 | ||
907 | difflastxmin = -1; | |
908 | difflastxmax = +1; | |
909 | difflastxbins = (Int_t) ((difflastxmax - difflastxmin)/0.0001); | |
910 | ||
911 | difflastymin = -1; | |
912 | difflastymax = +1; | |
913 | difflastybins = (Int_t) ((difflastymax - difflastymin)/0.0001); | |
914 | ||
915 | difflastzmin = -1; | |
916 | difflastzmax = +1; | |
917 | difflastzbins = (Int_t) ((difflastzmax - difflastzmin)/0.0001); | |
918 | ||
919 | diffptmin = -1; | |
920 | diffptmax = +1; | |
921 | diffptbins = (Int_t) ((diffptmax - diffptmin)/0.0001); | |
922 | ||
923 | diffpsimin = -1; | |
924 | diffpsimax = +1; | |
925 | diffpsibins = (Int_t) ((diffpsimax - diffpsimin)/0.0001); | |
926 | ||
927 | difftglmin = -1; | |
928 | difftglmax = +1; | |
929 | difftglbins = (Int_t) ((difftglmax - difftglmin)/0.0001); | |
930 | ||
931 | diffclustermin = -1; | |
932 | diffclustermax = +1; | |
933 | diffclusterbins = (Int_t) ((diffclustermax - diffclustermin)/0.0001); | |
934 | ||
892210c7 | 935 | //#if 0 |
ff2f0f94 | 936 | diffpterrmin = -1; |
937 | diffpterrmax = 1; | |
938 | diffpterrbins = (Int_t) ((diffpterrmax - diffpterrmin)/0.0001); | |
939 | ||
940 | diffpsierrmin = -1; | |
941 | diffpsierrmax = 1; | |
942 | diffpsierrbins = (Int_t) ((diffpsierrmax - diffpsierrmin)/0.0001); | |
943 | ||
944 | difftglerrmin = -1; | |
945 | difftglerrmax = 1; | |
946 | difftglerrbins = (Int_t) ((difftglerrmax - difftglerrmin)/0.0001); | |
892210c7 | 947 | //#endif |
ff2f0f94 | 948 | } |
949 | ||
950 | // intialise histogramms | |
951 | TH1F* firstxhisto = new TH1F("Differences of first x (original - secondary) track", "Differences of first x (original - secondary) track", difffirstxbins, difffirstxmin, difffirstxmax); | |
952 | TH1F* firstyhisto = new TH1F("Differences of first y (original - secondary) track", "Differences of first y (original - secondary) track", difffirstybins, difffirstymin, difffirstymax); | |
953 | TH1F* firstzhisto = new TH1F("Differences of first z (original - secondary) track", "Differences of first z (original - secondary) track", difffirstzbins, difffirstzmin, difffirstzmax); | |
954 | TH1F* lastxhisto = new TH1F("Differences of last x (original - secondary) track", "Differences of last x (original - secondary) track", difflastxbins, difflastxmin, difflastxmax); | |
955 | TH1F* lastyhisto = new TH1F("Differences of last y (original - secondary) track", "Differences of last y (original - secondary) track", difflastybins, difflastymin, difflastymax); | |
956 | TH1F* lastzhisto = new TH1F("Differences of last z (original - secondary) track", "Differences of last z (original - secondary) track", difflastzbins, difflastzmin, difflastzmax); | |
957 | TH1F* pthisto = new TH1F("Differences of pt (original - secondary) track", "Differences of pt (original - secondary) track", diffptbins, diffptmin, diffptmax); | |
958 | TH1F* psihisto = new TH1F("Differences of psi (original - secondary) track", "Differences of psi (original - secondary) track", diffpsibins, diffpsimin, diffpsimax); | |
959 | TH1F* tglhisto = new TH1F("Differences of tgl (original - secondary) track", "Differences of tgl (original - secondary) track", difftglbins, difftglmin, difftglmax); | |
960 | TH1F* clusterhisto = new TH1F("Differences of asserted clusters (original - secondary) track", "Differences of asserted clusters (original - secondary) track", diffclusterbins, diffclustermin, diffclustermax); | |
961 | ||
892210c7 | 962 | //#if 0 |
ff2f0f94 | 963 | // commented out since pterr is zero for every track! |
964 | TH1F* pterrhisto = new TH1F("Differences of pt error (original - secondary) track", "Differences of pt error (original - secondary) track", diffpterrbins, diffpterrmin, diffpterrmax); | |
965 | TH1F* psierrhisto = new TH1F("Differences of psi error (original - secondary) track", "Differences of psi error (original - secondary) track", diffpsierrbins, diffpsierrmin, diffpsierrmax); | |
966 | TH1F* tglerrhisto = new TH1F("Differences of tgl error (original - secondary) track", "Differences of tgl error (original - secondary) track", difftglerrbins, difftglerrmin, difftglerrmax); | |
967 | ||
892210c7 | 968 | //#endif |
969 | ||
970 | // initialise histograms for tracking efficiency against pt | |
971 | // relative p_t resolution: 1.2% -> take 0.1GeV * 1.2 % --> binsize 0.001 sufficient to grant correct resolution for low pt | |
972 | TH1F* firsttracks = new TH1F("pt occurrence original", "Occurrence of pt in original tracks", 10000, 0, 10); | |
973 | TH1F* matchedtrackeff = new TH1F("matchedtreffeff", "Occurrence of 2ndary tracks with good pt", 10000, 0, 10); | |
974 | TH1F* trackeff = new TH1F("tracking efficiency vs. pt", "Tracking efficiency vs. pt", 10000, 0, 10); | |
ff2f0f94 | 975 | |
976 | // evaluate quality of fit: | |
977 | TH1I* matchinghisto = new TH1I("Matching indicator (5 - 10)", "Matching indicator (5 - 10)", 11, 0, 11); | |
978 | ||
979 | while(tracklistpointer != NULL) | |
980 | { | |
981 | // if currently processed track is matched, store differences of their parameters in histogram | |
978e5544 | 982 | if(tracklistpointer->fMatchingindicator > 0) |
ff2f0f94 | 983 | { |
984 | // matching track | |
978e5544 | 985 | trackmatchingpointer = tracklistpointer->fMatchingtrack; |
ff2f0f94 | 986 | |
892210c7 | 987 | // fill histograms for trackingefficiency vs. pt |
978e5544 | 988 | firsttracks->Fill(tracklistpointer->fTrack.GetPt(),1); |
892210c7 | 989 | |
978e5544 | 990 | if(abs(tracklistpointer->fTrack.GetPt()-trackmatchingpointer->fTrack.GetPt()) < 0.012*tracklistpointer->fTrack.GetPt()) |
892210c7 | 991 | { |
978e5544 | 992 | matchedtrackeff->Fill(tracklistpointer->fTrack.GetPt(),1); |
892210c7 | 993 | } |
994 | ||
978e5544 | 995 | //tracklistpointer = tracklistpointer->fNext; // only efficiency is considered... |
892210c7 | 996 | //continue; // only efficiency is considered... |
997 | ||
ff2f0f94 | 998 | if(relativedifferences == 1) // fill histogram with relative differences |
999 | { | |
892210c7 | 1000 | |
1001 | // check if first track parameters are not zero! | |
978e5544 | 1002 | if (tracklistpointer->fTrack.GetFirstPointX()==0) |
892210c7 | 1003 | { |
1004 | HLTWarning("Warning! First x of original track is zero, relative differences cannot be calculated!"); | |
1005 | }; | |
978e5544 | 1006 | if (tracklistpointer->fTrack.GetFirstPointY()==0) |
892210c7 | 1007 | { |
1008 | HLTWarning("Warning! First y of original track is zero, relative differences cannot be calculated!"); | |
1009 | }; | |
978e5544 | 1010 | if (tracklistpointer->fTrack.GetFirstPointZ()==0) |
892210c7 | 1011 | { |
1012 | HLTWarning("Warning! First z of original track is zero, relative differences cannot be calculated!"); | |
1013 | }; | |
978e5544 | 1014 | if (tracklistpointer->fTrack.GetLastPointX()==0) |
892210c7 | 1015 | { |
1016 | HLTWarning("Warning! Last x of original track is zero, relative differences cannot be calculated!"); | |
1017 | }; | |
978e5544 | 1018 | if (tracklistpointer->fTrack.GetLastPointY()==0) |
892210c7 | 1019 | { |
1020 | HLTWarning("Warning! Last y of original track is zero, relative differences cannot be calculated!"); | |
1021 | }; | |
978e5544 | 1022 | if (tracklistpointer->fTrack.GetLastPointZ()==0) |
892210c7 | 1023 | { |
1024 | HLTWarning("Warning! Last z of original track is zero, relative differences cannot be calculated!"); | |
1025 | }; | |
978e5544 | 1026 | if (tracklistpointer->fTrack.GetPt()==0) |
892210c7 | 1027 | { |
1028 | HLTWarning("Warning! Pt of original track is zero, relative differences cannot be calculated!"); | |
1029 | }; | |
978e5544 | 1030 | if (tracklistpointer->fTrack.GetPsi()==0) |
892210c7 | 1031 | { |
1032 | HLTWarning("Warning! Psi of original track is zero, relative differences cannot be calculated!"); | |
1033 | }; | |
978e5544 | 1034 | if (tracklistpointer->fTrack.GetTgl()==0) |
892210c7 | 1035 | { |
1036 | HLTWarning("Warning! Tgl of original track is zero, relative differences cannot be calculated!"); | |
1037 | }; | |
978e5544 | 1038 | firstxhisto->Fill((tracklistpointer->fTrack.GetFirstPointX()-trackmatchingpointer->fTrack.GetFirstPointX())/tracklistpointer->fTrack.GetFirstPointX(),1); |
1039 | firstyhisto->Fill((tracklistpointer->fTrack.GetFirstPointY()-trackmatchingpointer->fTrack.GetFirstPointY())/tracklistpointer->fTrack.GetFirstPointY(),1); | |
1040 | firstzhisto->Fill((tracklistpointer->fTrack.GetFirstPointZ()-trackmatchingpointer->fTrack.GetFirstPointZ())/tracklistpointer->fTrack.GetFirstPointZ(),1); | |
1041 | lastxhisto->Fill((tracklistpointer->fTrack.GetLastPointX()-trackmatchingpointer->fTrack.GetLastPointX())/tracklistpointer->fTrack.GetLastPointX(),1); | |
1042 | lastyhisto->Fill((tracklistpointer->fTrack.GetLastPointY()-trackmatchingpointer->fTrack.GetLastPointY())/tracklistpointer->fTrack.GetLastPointY(),1); | |
1043 | lastzhisto->Fill((tracklistpointer->fTrack.GetLastPointZ()-trackmatchingpointer->fTrack.GetLastPointZ())/tracklistpointer->fTrack.GetLastPointZ(),1); | |
1044 | pthisto->Fill((tracklistpointer->fTrack.GetPt()-trackmatchingpointer->fTrack.GetPt())/tracklistpointer->fTrack.GetPt(),1); | |
1045 | psihisto->Fill((tracklistpointer->fTrack.GetPsi()-trackmatchingpointer->fTrack.GetPsi())/tracklistpointer->fTrack.GetPsi(),1); | |
1046 | tglhisto->Fill((tracklistpointer->fTrack.GetTgl()-trackmatchingpointer->fTrack.GetTgl())/tracklistpointer->fTrack.GetTgl(),1); | |
1047 | clusterhisto->Fill((tracklistpointer->fTrack.GetNHits()-trackmatchingpointer->fTrack.GetNHits())/tracklistpointer->fTrack.GetNHits(),1); | |
ff2f0f94 | 1048 | |
892210c7 | 1049 | //#if 0 |
978e5544 | 1050 | pterrhisto->Fill((tracklistpointer->fTrack.GetPterr()-trackmatchingpointer->fTrack.GetPterr())/tracklistpointer->fTrack.GetPterr(),1); |
1051 | psierrhisto->Fill((tracklistpointer->fTrack.GetPsierr()-trackmatchingpointer->fTrack.GetPsierr())/tracklistpointer->fTrack.GetPsierr(),1); | |
1052 | tglerrhisto->Fill((tracklistpointer->fTrack.GetTglerr()-trackmatchingpointer->fTrack.GetTglerr())/tracklistpointer->fTrack.GetTglerr(),1); | |
ff2f0f94 | 1053 | |
978e5544 | 1054 | //HLTInfo("Pterr: 1st:%f 2nd:%f value:%f",tracklistpointer->fTrack.GetPterr(),trackmatchingpointer->fTrack.GetPterr(),(tracklistpointer->fTrack.GetPterr()-trackmatchingpointer->fTrack.GetPterr())/tracklistpointer->fTrack.GetPterr()); |
1055 | //HLTInfo("Psierr: 1st:%f 2nd:%f value:%f",tracklistpointer->fTrack.GetPsierr(),trackmatchingpointer->fTrack.GetPsierr(),(tracklistpointer->fTrack.GetPsierr()-trackmatchingpointer->fTrack.GetPsierr())/tracklistpointer->fTrack.GetPsierr()); | |
1056 | //HLTInfo("Tglerr: 1st:%f 2nd:%f value:%f",tracklistpointer->fTrack.GetTglerr(),trackmatchingpointer->fTrack.GetTglerr(),(tracklistpointer->fTrack.GetTglerr()-trackmatchingpointer->fTrack.GetTglerr())/tracklistpointer->fTrack.GetTglerr()); | |
892210c7 | 1057 | //#endif |
ff2f0f94 | 1058 | } |
1059 | else // otherwise fill histogram with absolute differences | |
1060 | { | |
978e5544 | 1061 | firstxhisto->Fill(tracklistpointer->fTrack.GetFirstPointX()-trackmatchingpointer->fTrack.GetFirstPointX(),1); |
1062 | firstyhisto->Fill(tracklistpointer->fTrack.GetFirstPointY()-trackmatchingpointer->fTrack.GetFirstPointY(),1); | |
1063 | firstzhisto->Fill(tracklistpointer->fTrack.GetFirstPointZ()-trackmatchingpointer->fTrack.GetFirstPointZ(),1); | |
1064 | lastxhisto->Fill(tracklistpointer->fTrack.GetLastPointX()-trackmatchingpointer->fTrack.GetLastPointX(),1); | |
1065 | lastyhisto->Fill(tracklistpointer->fTrack.GetLastPointY()-trackmatchingpointer->fTrack.GetLastPointY(),1); | |
1066 | lastzhisto->Fill(tracklistpointer->fTrack.GetLastPointZ()-trackmatchingpointer->fTrack.GetLastPointZ(),1); | |
1067 | pthisto->Fill(tracklistpointer->fTrack.GetPt()-trackmatchingpointer->fTrack.GetPt(),1); | |
1068 | psihisto->Fill(tracklistpointer->fTrack.GetPsi()-trackmatchingpointer->fTrack.GetPsi(),1); | |
1069 | tglhisto->Fill(tracklistpointer->fTrack.GetTgl()-trackmatchingpointer->fTrack.GetTgl(),1); | |
1070 | clusterhisto->Fill(tracklistpointer->fTrack.GetNHits()-trackmatchingpointer->fTrack.GetNHits(),1); | |
892210c7 | 1071 | //#if 0 |
ff2f0f94 | 1072 | // commented out since pterr is always zero for every track! |
978e5544 | 1073 | pterrhisto->Fill(tracklistpointer->fTrack.GetPterr()-trackmatchingpointer->fTrack.GetPterr(),1); |
1074 | psierrhisto->Fill(tracklistpointer->fTrack.GetPsierr()-trackmatchingpointer->fTrack.GetPsierr(),1); | |
1075 | tglerrhisto->Fill(tracklistpointer->fTrack.GetTglerr()-trackmatchingpointer->fTrack.GetTglerr(),1); | |
892210c7 | 1076 | //#endif |
ff2f0f94 | 1077 | } |
1078 | ||
1079 | // fill histogram that determines the quality of the fit | |
978e5544 | 1080 | matchinghisto->Fill(tracklistpointer->fMatchingindicator,1); |
ff2f0f94 | 1081 | } |
1082 | ||
978e5544 | 1083 | tracklistpointer = tracklistpointer->fNext; |
ff2f0f94 | 1084 | } |
1085 | ||
892210c7 | 1086 | trackeff->Divide(matchedtrackeff, firsttracks,1,1,""); |
1087 | ||
ff2f0f94 | 1088 | // write histograms to root file specified in command line argument -graphs <filename>.ROOT |
1089 | if(!fGraphFileName.IsNull()) | |
1090 | { | |
892210c7 | 1091 | TFile* graphrootfile = new TFile(fGraphFileName, "update"); |
ff2f0f94 | 1092 | graphrootfile->WriteObject(firstxhisto,"firstxhistogram"); |
1093 | //firstxhisto->Write(); | |
1094 | graphrootfile->WriteObject(firstyhisto,"firstyhistogram"); | |
1095 | //firstyhisto->Write(); | |
1096 | graphrootfile->WriteObject(firstzhisto,"firstzhistogram"); | |
1097 | //firstzhisto->Write(); | |
1098 | graphrootfile->WriteObject(lastxhisto,"lastxhistogram"); | |
1099 | //lastxhisto->Write(); | |
1100 | graphrootfile->WriteObject(lastyhisto,"lastyhistogram"); | |
1101 | //lastyhisto->Write(); | |
1102 | graphrootfile->WriteObject(lastzhisto,"lastzhistogram"); | |
1103 | //lastzhisto->Write(); | |
1104 | graphrootfile->WriteObject(pthisto,"pthistogram"); | |
1105 | //pthisto->Write(); | |
1106 | graphrootfile->WriteObject(psihisto,"psihistogram"); | |
1107 | //psihisto->Write(); | |
1108 | graphrootfile->WriteObject(tglhisto,"tglhistogram"); | |
1109 | //tglhisto->Write(); | |
1110 | graphrootfile->WriteObject(clusterhisto,"clusterhistogram"); | |
1111 | //clusterhisto->Write(); | |
1112 | graphrootfile->WriteObject(matchinghisto,"matchinghistogram"); | |
1113 | //matchinghisto->Write(); | |
892210c7 | 1114 | graphrootfile->WriteObject(firsttracks, "firsttrackeff"); |
1115 | graphrootfile->WriteObject(matchedtrackeff, "secondtrackeff"); | |
1116 | graphrootfile->WriteObject(trackeff, "trackingefficiency"); | |
1117 | ||
ff2f0f94 | 1118 | // errors in tracking (commented out since pterr is always 0 for every track!) |
1119 | graphrootfile->WriteObject(pterrhisto, "pterrhistogram"); | |
1120 | //pterrhisto->Write(); | |
1121 | graphrootfile->WriteObject(psierrhisto, "psierrhistogram"); | |
1122 | //psierrhisto->Write(); | |
1123 | graphrootfile->WriteObject(tglerrhisto, "tglerrhistogram"); | |
1124 | //tglerrhisto->Write(); | |
ff2f0f94 | 1125 | graphrootfile->Close(); |
1126 | } | |
1127 | else | |
1128 | { | |
1129 | HLTError("Error! No file for graphical output specified."); | |
1130 | return EINVAL; | |
1131 | } | |
1132 | ||
1133 | return 0; | |
1134 | } | |
1135 | ||
1136 | Int_t AliHLTTPCCompModelAnalysis::DisplayModelResults() | |
1137 | { | |
1138 | // see header file for class documentation | |
1139 | ||
1140 | //print out parameters of discarded track: | |
1141 | AliHLTTPCTrackList* trackprintpointer = fTrackListPointer; | |
1142 | AliHLTTPCTrackList* tracklistdeleter= trackprintpointer; | |
1143 | ||
1144 | FILE* dumpfile = NULL; | |
1145 | ||
1146 | if(!fDumpFileName.IsNull()) | |
1147 | { | |
1148 | // open new file specified by command line argument | |
1149 | dumpfile = fopen(fDumpFileName.Data(),"a"); | |
1150 | fprintf(dumpfile,"---------------MODEL ANALYSIS--------------- \n"); | |
1151 | fprintf(dumpfile,"---------------DISCARDED TRACKS: %d --------------- \n", fTrashTracks); | |
1152 | }; | |
1153 | ||
1154 | if(fTrackListPointer == NULL) | |
1155 | { | |
1156 | HLTInfo("No tracks discarded"); | |
1157 | HLTInfo("--------------"); | |
1158 | } | |
1159 | else | |
1160 | { | |
1161 | ||
1162 | HLTInfo("---------------DISCARDED TRACKS: %d ---------------", fTrashTracks); | |
1163 | ||
1164 | Int_t trashtrackcounter = 1; | |
1165 | ||
1166 | while(trackprintpointer != NULL) | |
1167 | { | |
1168 | ||
1169 | // infos about found track | |
978e5544 | 1170 | HLTInfo("%d : Discarding track with %d clusters.", trashtrackcounter, trackprintpointer->fTrack.GetNHits()); |
ff2f0f94 | 1171 | //PYTHIA INFORMATION ABOUT PARTICLE ID |
1172 | HLTInfo("Track parameters of discarded track:"); | |
978e5544 | 1173 | HLTInfo("First x: %9.6f \t first y: %9.6f \t first z: %9.6f",trackprintpointer->fTrack.GetFirstPointX(),trackprintpointer->fTrack.GetFirstPointY(),trackprintpointer->fTrack.GetFirstPointZ()); |
1174 | HLTInfo(" Last x: %9.6f \t last y: %9.6f \t last z: %9.6f", trackprintpointer->fTrack.GetLastPointX(),trackprintpointer->fTrack.GetLastPointY(),trackprintpointer->fTrack.GetLastPointZ()); | |
1175 | HLTInfo(" Pt: %9.6f \t Psi: %9.6f \t Tgl: %9.6f", trackprintpointer->fTrack.GetPt(), trackprintpointer->fTrack.GetPsi(), trackprintpointer->fTrack.GetTgl()); | |
ff2f0f94 | 1176 | |
1177 | // write results to file if specified by command line argument | |
1178 | if(!fDumpFileName.IsNull()) | |
1179 | { | |
978e5544 | 1180 | fprintf(dumpfile,"%d : Discarding track with %d clusters. \n", trashtrackcounter, trackprintpointer->fTrack.GetNHits()); |
ff2f0f94 | 1181 | fprintf(dumpfile,"Track parameters of discarded track: \n"); |
978e5544 | 1182 | fprintf(dumpfile,"First x: %9.6f \t first y: %9.6f \t first z: %9.6f \n",trackprintpointer->fTrack.GetFirstPointX(),trackprintpointer->fTrack.GetFirstPointY(),trackprintpointer->fTrack.GetFirstPointZ()); |
1183 | fprintf(dumpfile," Last x: %9.6f \t last y: %9.6f \t last z: %9.6f \n", trackprintpointer->fTrack.GetLastPointX(),trackprintpointer->fTrack.GetLastPointY(),trackprintpointer->fTrack.GetLastPointZ()); | |
1184 | fprintf(dumpfile," Pt: %9.6f \t Psi: %9.6f \t Tgl: %9.6f \n", trackprintpointer->fTrack.GetPt(), trackprintpointer->fTrack.GetPsi(), trackprintpointer->fTrack.GetTgl()); | |
ff2f0f94 | 1185 | }; |
1186 | ||
1187 | // comparison with pythia information | |
978e5544 | 1188 | if(trackprintpointer->fWronglydiscarded) |
ff2f0f94 | 1189 | { |
1190 | HLTInfo("Found track has been wrongly discarded according to Pythia information."); | |
1191 | ||
1192 | // write results to file if specified by command line argument | |
1193 | if(!fDumpFileName.IsNull()) | |
1194 | { | |
1195 | fprintf(dumpfile,"Found track has been wrongly discarded accoring to Pythia information. \n"); | |
1196 | }; | |
1197 | ||
1198 | }; | |
1199 | ||
1200 | // found pt must be in range pt_pythia \pm 10% to be accepted | |
978e5544 | 1201 | Double_t ptmin = trackprintpointer->fPythiatrack.GetPt() - 0.1*trackprintpointer->fPythiatrack.GetPt(); |
1202 | Double_t ptmax = trackprintpointer->fPythiatrack.GetPt() + 0.1*trackprintpointer->fPythiatrack.GetPt(); | |
ff2f0f94 | 1203 | |
978e5544 | 1204 | if( (trackprintpointer->fTrack.GetPt() < ptmin) ||(trackprintpointer->fTrack.GetPt() > ptmax) ) |
ff2f0f94 | 1205 | { |
978e5544 | 1206 | HLTInfo("Pt of found track %f differs more than 10 %% from pt of pythia track %f.",trackprintpointer->fTrack.GetPt(), trackprintpointer->fPythiatrack.GetPt()); |
ff2f0f94 | 1207 | |
1208 | if(!fDumpFileName.IsNull()) | |
1209 | { | |
1210 | // write result to file if specified by command line argument | |
978e5544 | 1211 | fprintf(dumpfile,"Pt of found track %f differs more than 10 %% from pt of pythia track %f. \n",trackprintpointer->fTrack.GetPt(), trackprintpointer->fPythiatrack.GetPt()); |
ff2f0f94 | 1212 | }; |
1213 | ||
1214 | }; | |
1215 | ||
1216 | HLTInfo("--------------"); | |
1217 | ||
1218 | if(!fDumpFileName.IsNull()) | |
1219 | { | |
1220 | fprintf(dumpfile,"-------------- \n"); | |
1221 | }; | |
1222 | ||
1223 | ||
1224 | // go to next element in trash track list | |
1225 | tracklistdeleter = trackprintpointer; | |
978e5544 | 1226 | trackprintpointer = trackprintpointer->fNext; |
ff2f0f94 | 1227 | |
1228 | ++trashtrackcounter; | |
1229 | ||
1230 | // free space | |
1231 | delete tracklistdeleter; | |
1232 | tracklistdeleter = NULL; | |
1233 | ||
1234 | } // end of while(trackpointer != NULL) | |
1235 | ||
1236 | } // end of else | |
1237 | ||
1238 | // print out number of noise clusters (not assigned to any track and not valid) | |
1239 | HLTInfo("Number of discarded clusters not assigned to any track: %d", fTotalDiscardedClusters); | |
1240 | HLTInfo("--------------"); | |
1241 | ||
1242 | // write results to file if specified by command line argument | |
1243 | if(!fDumpFileName.IsNull()) | |
1244 | { | |
1245 | fprintf(dumpfile,"Number of discarded clusters not assigned to any track: %d \n", fTotalDiscardedClusters); | |
1246 | fprintf(dumpfile,"-------------- \n"); | |
1247 | }; | |
1248 | ||
1249 | // print out paramters of discarded valuable clusters | |
1250 | HLTInfo("Number of discarded VALUABLE clusters: %d", fValuableDiscardedClusters); | |
1251 | ||
1252 | HLTInfo("--------------"); | |
1253 | ||
1254 | if(!fDumpFileName.IsNull()) | |
1255 | { | |
1256 | ||
1257 | fprintf(dumpfile,"Number of discarded VALUABLE clusters: %d \n", fValuableDiscardedClusters); | |
1258 | fclose(dumpfile); | |
1259 | }; | |
1260 | ||
1261 | return 0; | |
1262 | } | |
1263 | ||
1264 | Int_t AliHLTTPCCompModelAnalysis::DisplayTrackResults() | |
1265 | { | |
1266 | // see header file for class documentation | |
892210c7 | 1267 | HLTInfo("---------------CLUSTER ANALYSIS---------------"); |
1268 | if(CompareClusters(1) != 0) | |
1269 | { | |
1270 | return EINVAL; | |
1271 | } | |
1272 | ||
ff2f0f94 | 1273 | // start with comparison |
1274 | if(CompareTracks() != 0) | |
1275 | { | |
1276 | return EINVAL; | |
1277 | }; | |
1278 | ||
1279 | // if dumptofile is activated, append results to output analysis file | |
1280 | FILE* dumpfile = NULL; | |
1281 | ||
1282 | if(!fDumpFileName.IsNull()) | |
1283 | { | |
1284 | // open new file specified by command line argument | |
1285 | dumpfile = fopen(fDumpFileName.Data(),"a"); | |
1286 | ||
1287 | fprintf(dumpfile,"---------------TRACK ANALYSIS--------------- \n"); | |
1288 | ||
1289 | } | |
1290 | ||
1291 | // print out number of compared tracks | |
892210c7 | 1292 | HLTInfo("---------------TRACK ANALYSIS---------------"); |
ff2f0f94 | 1293 | HLTInfo("---------------ORIGINAL TRACKS: %d ---------------", fFirstTrackArray.GetNTracks()); |
1294 | HLTInfo("Number of tracks with pt < 0.1 GeV: %d", fFirstTrashTracks); | |
1295 | HLTInfo("Number of matched tracks with pt < 0.1 GeV: %d", fMatchedFirstTrashTracks); | |
1296 | //PYTHIA INFORMATION ABOUT PARTICLE IDs | |
1297 | HLTInfo("---------------2NDARY TRACKS: %d ---------------", fSecondTrackArray.GetNTracks()); | |
1298 | HLTInfo("Number of tracks with pt < 0.1 GeV: %d", fSecondTrashTracks); | |
1299 | HLTInfo("Number of matched tracks with pt < 0.1 GeV: %d", fMatchedSecondTrashTracks); | |
1300 | //PYTHIA INFORMATION ABOUT PARTICLE IDs | |
1301 | HLTInfo("--------------"); | |
1302 | HLTInfo("Comparison of tracks within parameter precision: %f", fToleranceDeviation); | |
1303 | HLTInfo("Number of compared tracks: %d", fTotalComparedTracks); | |
1304 | HLTInfo("Number of unmatched original tracks: %d", fFirstUnmatchedTracks); | |
1305 | HLTInfo("Number of unmatched secondary tracks: %d", fSecondUnmatchedTracks); | |
1306 | HLTInfo("--------------"); | |
1307 | ||
1308 | // print results to file | |
1309 | if(!fDumpFileName.IsNull()) | |
1310 | { | |
1311 | fprintf(dumpfile, "---------------%d ORIGINAL TRACKS---------------\n", fFirstTrackArray.GetNTracks()); | |
1312 | fprintf(dumpfile,"Number of tracks with pt < 0.1 GeV: %d \n", fFirstTrashTracks); | |
1313 | fprintf(dumpfile,"Number of matched tracks with pt < 0.1 GeV: %d \n", fMatchedFirstTrashTracks); | |
1314 | fprintf(dumpfile,"---------------%d 2NDARY TRACKS---------------\n", fSecondTrackArray.GetNTracks()); | |
1315 | fprintf(dumpfile,"Number of tracks with pt < 0.1 GeV: %d \n", fSecondTrashTracks); | |
1316 | fprintf(dumpfile,"Number of matched tracks with pt < 0.1 GeV: %d \n", fMatchedSecondTrashTracks); | |
1317 | fprintf(dumpfile,"--------------\n"); | |
1318 | fprintf(dumpfile,"Comparison of tracks within parameter precision: %f \n", fToleranceDeviation); | |
1319 | fprintf(dumpfile,"Number of compared tracks: %d \n", fTotalComparedTracks); | |
1320 | fprintf(dumpfile,"Number of unmatched original tracks: %d \n", fFirstUnmatchedTracks); | |
1321 | fprintf(dumpfile,"Number of unmatched secondary tracks: %d \n", fSecondUnmatchedTracks); | |
1322 | fprintf(dumpfile,"--------------\n"); | |
1323 | } | |
1324 | ||
1325 | ////////////////////////////////////////////////////////////////////// | |
1326 | // additional files temporarily necessary for output information | |
892210c7 | 1327 | FILE* infofile = fopen("/afsuser/jwagner/TrackerTest_25092007/pp-ca/fullanalysis08012008/trackingefficiency.out","a"); |
1328 | FILE* info2file = fopen("/afsuser/jwagner/TrackerTest_25092007/pp-ca/fullanalysis08012008/parameters.out", "a"); | |
ff2f0f94 | 1329 | |
1330 | // consistent = 0 if tracks and second tracks match perfectly, i.e. no doubly assigned tracks,etc. | |
1331 | Int_t consistentfirst = fFirstTrackArray.GetNTracks() - fTotalComparedTracks - fFirstUnmatchedTracks; | |
1332 | Int_t consistentsecond = fSecondTrackArray.GetNTracks() - fTotalComparedTracks - fSecondUnmatchedTracks; | |
1333 | ||
1334 | //fprintf(infofile, "1st tracks, 2nd tracks, compared, 1st uncompared, 2nd uncompared, cons.1st, cons.2nd \n"); | |
1335 | fprintf(info2file, " %d \t %d \t %d \t %d \t %d \t %d \t %d \n", fFirstTrackArray.GetNTracks(), fSecondTrackArray.GetNTracks(), fTotalComparedTracks, fFirstUnmatchedTracks, fSecondUnmatchedTracks, consistentfirst, consistentsecond); | |
1336 | ||
1337 | //fprintf(infofile, "1st trash tracks, 2nd trash tracks, 1st matched trash tracks, 2nd matched trash tracks \n"); | |
1338 | fprintf(infofile, "%d \t %d \t %d \t %d \n", fFirstTrashTracks, fSecondTrashTracks, fMatchedFirstTrashTracks, fMatchedSecondTrashTracks); | |
1339 | ||
1340 | fclose(infofile); | |
1341 | fclose(info2file); | |
1342 | //////////////////////////////////////////////////////////////////// | |
1343 | ||
1344 | // print out deviations | |
1345 | Int_t tracknumber = 1; | |
1346 | AliHLTTPCTrackList* listprintpointer = fFirstTrackList; | |
1347 | while(listprintpointer != NULL) | |
1348 | { | |
1349 | // print out parameters of original track in comparison to secondary track: | |
1350 | ||
978e5544 | 1351 | if(listprintpointer->fMatchingindicator != 0) |
ff2f0f94 | 1352 | { |
1353 | ||
1354 | #if 0 | |
1355 | HLTInfo("Track %d:", tracknumber); | |
978e5544 | 1356 | HLTInfo("Original track matched to secondary track with matchingindicator %d", listprintpointer->fMatchingindicator); |
ff2f0f94 | 1357 | |
1358 | HLTInfo("Parameter comparison: Original vs. Secondary"); | |
1359 | ||
978e5544 | 1360 | HLTInfo("Clusters: %d \t %d ",listprintpointer->fTrack.GetNHits(), listprintpointer->fMatchingtrack->fTrack.GetNHits()); |
1361 | HLTInfo("First x: %9.6f \t %9.6f", listprintpointer->fTrack.GetFirstPointX(), listprintpointer->fMatchingtrack->fTrack.GetFirstPointX()); | |
1362 | HLTInfo("First y: %9.6f \t %9.6f", listprintpointer->fTrack.GetFirstPointY(), listprintpointer->fMatchingtrack->fTrack.GetFirstPointY()); | |
1363 | HLTInfo("First z: %9.6f \t %9.6f", listprintpointer->fTrack.GetFirstPointZ(), listprintpointer->fMatchingtrack->fTrack.GetFirstPointZ()); | |
1364 | HLTInfo("Last x: %9.6f \t %9.6f", listprintpointer->fTrack.GetLastPointX(), listprintpointer->fMatchingtrack->fTrack.GetLastPointX()); | |
1365 | HLTInfo("Last y: %9.6f \t %9.6f", listprintpointer->fTrack.GetLastPointY(), listprintpointer->fMatchingtrack->fTrack.GetLastPointY()); | |
1366 | HLTInfo("Last z: %9.6f \t %9.6f", listprintpointer->fTrack.GetLastPointZ(), listprintpointer->fMatchingtrack->fTrack.GetLastPointZ()); | |
1367 | HLTInfo(" Pt: %9.6f \t %9.6f", listprintpointer->fTrack.GetPt(), listprintpointer->fMatchingtrack->fTrack.GetPt()); | |
1368 | HLTInfo(" Psi: %9.6f \t %9.6f", listprintpointer->fTrack.GetPsi(), listprintpointer->fMatchingtrack->fTrack.GetPsi()); | |
1369 | HLTInfo(" Tgl: %9.6f \t %9.6f", listprintpointer->fTrack.GetTgl(), listprintpointer->fMatchingtrack->fTrack.GetTgl()); | |
1370 | ||
1371 | HLTInfo(" Pterr: %9.6f \t %9.6f", listprintpointer->fTrack.GetPterr(), listprintpointer->fMatchingtrack->fTrack.GetPterr()); | |
1372 | HLTInfo("Psierr: %9.6f \t %9.6f", listprintpointer->fTrack.GetPsierr(), listprintpointer->fMatchingtrack->fTrack.GetPsierr()); | |
1373 | HLTInfo("Tglerr: %9.6f \t %9.6f", listprintpointer->fTrack.GetTglerr(), listprintpointer->fMatchingtrack->fTrack.GetTglerr()); | |
ff2f0f94 | 1374 | |
1375 | HLTInfo("--------------"); | |
1376 | #endif | |
1377 | // print these results to file | |
1378 | if(!fDumpFileName.IsNull()) | |
1379 | { | |
1380 | fprintf(dumpfile, "Track %d: \n", tracknumber); | |
978e5544 | 1381 | fprintf(dumpfile, "Original track matched to secondary track with matchingindicator %d \n", listprintpointer->fMatchingindicator); |
ff2f0f94 | 1382 | fprintf(dumpfile, "Parameter comparison: Original vs. Secondary \n"); |
978e5544 | 1383 | fprintf(dumpfile, "Clusters: %d \t %d \n ",listprintpointer->fTrack.GetNHits(), listprintpointer->fMatchingtrack->fTrack.GetNHits()); |
1384 | fprintf(dumpfile, "First x: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetFirstPointX(), listprintpointer->fMatchingtrack->fTrack.GetFirstPointX()); | |
1385 | fprintf(dumpfile, "First y: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetFirstPointY(), listprintpointer->fMatchingtrack->fTrack.GetFirstPointY()); | |
1386 | fprintf(dumpfile, "First z: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetFirstPointZ(), listprintpointer->fMatchingtrack->fTrack.GetFirstPointZ()); | |
1387 | fprintf(dumpfile, "Last x: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetLastPointX(), listprintpointer->fMatchingtrack->fTrack.GetLastPointX()); | |
1388 | fprintf(dumpfile, "Last y: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetLastPointY(), listprintpointer->fMatchingtrack->fTrack.GetLastPointY()); | |
1389 | fprintf(dumpfile, "Last z: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetLastPointZ(), listprintpointer->fMatchingtrack->fTrack.GetLastPointZ()); | |
1390 | fprintf(dumpfile, " Pt: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetPt(), listprintpointer->fMatchingtrack->fTrack.GetPt()); | |
1391 | fprintf(dumpfile, " Psi: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetPsi(), listprintpointer->fMatchingtrack->fTrack.GetPsi()); | |
1392 | fprintf(dumpfile, " Tgl: %9.6f \t %9.6f \n", listprintpointer->fTrack.GetTgl(), listprintpointer->fMatchingtrack->fTrack.GetTgl()); | |
ff2f0f94 | 1393 | fprintf(dumpfile, "--------------\n"); |
1394 | } | |
1395 | ++tracknumber; | |
1396 | } | |
1397 | ||
978e5544 | 1398 | listprintpointer = listprintpointer->fNext; |
ff2f0f94 | 1399 | } |
1400 | ||
1401 | ||
1402 | // print out not matched tracks from first track array: | |
1403 | listprintpointer = fFirstTrackList; | |
1404 | Int_t notmatchedtracknumber = 1; | |
1405 | ||
1406 | while(listprintpointer != NULL) | |
1407 | { | |
978e5544 | 1408 | if(listprintpointer->fMatchingindicator == 0) |
ff2f0f94 | 1409 | { |
1410 | #if 0 | |
1411 | HLTInfo("Original Track, not matched with secondary track %d:", notmatchedtracknumber); | |
978e5544 | 1412 | HLTInfo("Clusters: %d",listprintpointer->fTrack.GetNHits()); |
ff2f0f94 | 1413 | //PYTHIA INFORMATION ABOUT PARTICLE ID |
978e5544 | 1414 | HLTInfo("First x: %9.6f \t first y: %9.6f \t first z: %9.6f",listprintpointer->fTrack.GetFirstPointX(),listprintpointer->fTrack.GetFirstPointY(),listprintpointer->fTrack.GetFirstPointZ()); |
1415 | HLTInfo(" Last x: %9.6f \t last y: %9.6f \t last z: %9.6f", listprintpointer->fTrack.GetLastPointX(),listprintpointer->fTrack.GetLastPointY(),listprintpointer->fTrack.GetLastPointZ()); | |
1416 | HLTInfo(" Pt: %9.6f \t Psi: %9.6f \t Tgl: %9.6f", listprintpointer->fTrack.GetPt(), listprintpointer->fTrack.GetPsi(), listprintpointer->fTrack.GetTgl()); | |
ff2f0f94 | 1417 | HLTInfo("--------------"); |
1418 | #endif | |
1419 | ||
1420 | // print these results to file | |
1421 | if(!fDumpFileName.IsNull()) | |
1422 | { | |
1423 | fprintf(dumpfile, "Original Track, not matched with secondary track %d: \n", notmatchedtracknumber); | |
978e5544 | 1424 | fprintf(dumpfile, "Clusters: %d \n",listprintpointer->fTrack.GetNHits()); |
1425 | fprintf(dumpfile, "First x: %9.6f \t first y: %9.6f \t first z: %9.6f \n",listprintpointer->fTrack.GetFirstPointX(),listprintpointer->fTrack.GetFirstPointY(),listprintpointer->fTrack.GetFirstPointZ()); | |
1426 | fprintf(dumpfile, " Last x: %9.6f \t last y: %9.6f \t last z: %9.6f \n", listprintpointer->fTrack.GetLastPointX(),listprintpointer->fTrack.GetLastPointY(),listprintpointer->fTrack.GetLastPointZ()); | |
1427 | fprintf(dumpfile, " Pt: %9.6f \t Psi: %9.6f \t Tgl: %9.6f \n", listprintpointer->fTrack.GetPt(), listprintpointer->fTrack.GetPsi(), listprintpointer->fTrack.GetTgl()); | |
ff2f0f94 | 1428 | fprintf(dumpfile, "--------------\n"); |
1429 | } | |
1430 | ||
1431 | ++notmatchedtracknumber; | |
1432 | } | |
1433 | ||
978e5544 | 1434 | listprintpointer = listprintpointer->fNext; |
ff2f0f94 | 1435 | } |
1436 | ||
1437 | // print out not matched tracks from second track array: | |
1438 | listprintpointer = fSecondTrackList; | |
1439 | notmatchedtracknumber = 1; | |
1440 | ||
1441 | while(listprintpointer != NULL) | |
1442 | { | |
978e5544 | 1443 | if(listprintpointer->fMatchingindicator == 0) |
ff2f0f94 | 1444 | { |
1445 | #if 0 | |
1446 | HLTInfo("Secondary Track, not matched with original track %d:", notmatchedtracknumber); | |
978e5544 | 1447 | HLTInfo("Clusters: %d",listprintpointer->fTrack.GetNHits()); |
ff2f0f94 | 1448 | //PYTHIA INFORMATION ABOUT PARTICLE ID |
978e5544 | 1449 | HLTInfo("First x: %9.6f \t first y: %9.6f \t first z: %9.6f",listprintpointer->fTrack.GetFirstPointX(),listprintpointer->fTrack.GetFirstPointY(),listprintpointer->fTrack.GetFirstPointZ()); |
1450 | HLTInfo(" Last x: %9.6f \t last y: %9.6f \t last z: %9.6f", listprintpointer->fTrack.GetLastPointX(),listprintpointer->fTrack.GetLastPointY(),listprintpointer->fTrack.GetLastPointZ()); | |
1451 | HLTInfo(" Pt: %9.6f \t Psi: %9.6f \t Tgl: %9.6f", listprintpointer->fTrack.GetPt(), listprintpointer->fTrack.GetPsi(), listprintpointer->fTrack.GetTgl()); | |
ff2f0f94 | 1452 | HLTInfo("--------------"); |
892210c7 | 1453 | #endif |
ff2f0f94 | 1454 | // print these results to file |
1455 | if(!fDumpFileName.IsNull()) | |
1456 | { | |
1457 | fprintf(dumpfile, "Secondary Track, not matched with original track %d: \n", notmatchedtracknumber); | |
978e5544 | 1458 | fprintf(dumpfile, "Clusters: %d \n",listprintpointer->fTrack.GetNHits()); |
1459 | fprintf(dumpfile, "First x: %9.6f \t first y: %9.6f \t first z: %9.6f \n",listprintpointer->fTrack.GetFirstPointX(),listprintpointer->fTrack.GetFirstPointY(),listprintpointer->fTrack.GetFirstPointZ()); | |
1460 | fprintf(dumpfile, " Last x: %9.6f \t last y: %9.6f \t last z: %9.6f \n", listprintpointer->fTrack.GetLastPointX(),listprintpointer->fTrack.GetLastPointY(),listprintpointer->fTrack.GetLastPointZ()); | |
1461 | fprintf(dumpfile, " Pt: %9.6f \t Psi: %9.6f \t Tgl: %9.6f \n", listprintpointer->fTrack.GetPt(), listprintpointer->fTrack.GetPsi(), listprintpointer->fTrack.GetTgl()); | |
ff2f0f94 | 1462 | fprintf(dumpfile, "--------------\n"); |
1463 | } | |
1464 | ||
1465 | ++notmatchedtracknumber; | |
1466 | } | |
1467 | ||
978e5544 | 1468 | listprintpointer = listprintpointer->fNext; |
ff2f0f94 | 1469 | } |
1470 | ||
1471 | // close output analysis file | |
1472 | if(!fDumpFileName.IsNull()) | |
1473 | { | |
1474 | fclose(dumpfile); | |
1475 | }; | |
1476 | ||
1477 | // if results should be written to graphical output: | |
1478 | if(!fGraphFileName.IsNull()) | |
1479 | { | |
1480 | CreateGraphs(1); // specifiy if absolute or rel. differences should be saved (CreateGraphs(0) or CreateGraphs()/ CreateGraphs(1) | |
1481 | }; | |
1482 | ||
1483 | // free reserved space | |
1484 | ||
1485 | return 0; | |
1486 | } |