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