4 #ifndef ALIHLTTPCCOMPMODELANALYSIS_H
5 #define ALIHLTTPCCOMPMODELANALYSIS_H
6 //* This file is property of and copyright by the ALICE HLT Project *
7 //* ALICE Experiment at CERN, All rights reserved. *
8 //* See cxx source for full Copyright notice *
10 /** @file AliHLTTPCCompModelAnalysis.h
13 @brief A HLT processing component for the Vestbo-compression-model */
15 #include "AliHLTTPCTrackArray.h"
16 #include "AliHLTTPCTrackletDataFormat.h"
17 #include "AliHLTTPCClusterDataFormat.h"
18 #include "AliHLTTPCTrack.h"
19 #include "AliHLTTPCModelTrack.h"
22 #include "AliHLTLogging.h"
25 * @class AliHLTTPCCompModelAnalysis
26 * @brief A HLT processing component for the Vestbo-compression-model
28 * An implementiation of a class that is used to analyse the
29 * loss due to the conversion / compression in the Vestbo-model
30 * resolution change due to Vestbo-model on tracking performance
33 class AliHLTTPCCompModelAnalysis: public AliHLTLogging
38 /** type needed to build list with discarded tracks or tracks to compare */
39 struct AliHLTTPCTrackList
41 AliHLTTPCTrackList() :
44 wronglydiscarded(kFALSE),
50 AliHLTTPCTrackList (const AliHLTTPCTrackList&);
51 AliHLTTPCTrackList& operator= (const AliHLTTPCTrackList&);
53 AliHLTTPCTrack track; // store information of found discarded track
54 AliHLTTPCTrack pythiatrack; // store pythia information about this found discarded track
55 Bool_t wronglydiscarded; // flag to mark if track and pythia track information match together
56 Int_t matchingindicator; // only for trackanalysis the higher the number, the more probable it is that tracks match
57 AliHLTTPCTrackList* next; // pointer to next struct
58 AliHLTTPCTrackList* matchingtrack; // pointer to matching track (only used in trackanalysis)
60 typedef struct AliHLTTPCTrackList AliHLTTPCTrackList;
62 AliHLTTPCCompModelAnalysis(Bool_t modelanalysis, Bool_t trackanalysis, TString dumpfilename, TString graphfilename);
63 virtual ~AliHLTTPCCompModelAnalysis();
65 /** initialise track or cluster arrays depending on the analysis to be made
66 * @return 0 upon success
70 /** display results for respective analysis type (track comparison or model loss analysis)
71 * @return 0 upon success
73 Int_t DisplayResults();
75 /** function to retrieve private member variable fModelAnalysis used in ModelConverter
76 * @return 0 if fModelAnalysis is switched off
77 * @return 1 if fModelAnalysis is switched on
79 Bool_t GetfModelAnalysis() {return fModelAnalysis;};
81 /** function to retrieve private member variable fTrackAnalysis used in ModelConverter
82 * @return 0 if fTrackAnalysis is switched off
83 * @return 1 if fTrackAnalysis is switched on
85 Bool_t GetfTrackAnalysis() {return fTrackAnalysis;};
87 /** fill track arrays with track data from original and secondary tracking
88 * @param tracklets pointer to track array to be filled
89 * @param fillingfirsttracks boolean to decide which track array is to be filled (1 for first, 0 for second)
90 * @return 0 upon success
92 Int_t SetTracks(AliHLTTPCTrackletData* tracklets, Bool_t fillingfirsttracks);
94 /** fill cluster arrays with cluster data from original and secondary clusters
95 * @param clusters pointer to cluster data array to be filled
96 * @param slice slice number where clusters come from
97 * @param patch patch number where clusters come from
98 * @param fillingfirstclusters boolean to decide which track array is to be filled (1 for first, 0 for second)
99 * @return 0 upon success
101 Int_t SetClusters(AliHLTTPCClusterData* clusters, UInt_t slice, UInt_t patch, Bool_t fillingfirstclusters);
103 /** store discarded tracks in model analysis to be displayed in @ref DisplayModelResults(),
104 * uses @ref GetTrashTrackPythiaInfo
105 * @param lowpttrack pointer to discarded track which is to be remembered for analysis
106 * @return 0 upon success
108 Int_t MarkTrashTrack(AliHLTTPCTrack* lowpttrack);
110 /** store discarded cluster not assigned to any track in model analysis to be displayed in @ref DisplayModelResults(),
111 * uses @ref GetClusterPythiaInfo
112 * @param discardedcluster cluster data of discarded cluster
113 * @param slice slice where discarded cluster occurrs
114 * @param patch patch where discarded cluster occurrs
115 * @return 0 upon success
117 Int_t MarkTrashCluster(AliHLTTPCClusterData *discardedcluster, UInt_t slice, UInt_t patch);
120 /** copy constructor prohibited */
121 AliHLTTPCCompModelAnalysis (const AliHLTTPCCompModelAnalysis&);
123 /** assignment operator prohibited */
124 AliHLTTPCCompModelAnalysis& operator= (const AliHLTTPCCompModelAnalysis&);
126 /** private function to display results from model loss analysis
127 * @return 0 upon success
129 Int_t DisplayModelResults();
131 /** private function to display results from track comparison
132 * @return 0 upon success
134 Int_t DisplayTrackResults();
136 /** compare tracks and store differences to be displayed in @ref DisplayTrackResults()
137 * @return 0 upon success
139 Int_t CompareTracks();
141 /** compare clusters for all tracks and create graphs out of the differences
142 * function used in @ref DisplayTrackResults()
143 * @return 0 upon success
145 Int_t CompareClusters(Bool_t relativedifferences = 1);
147 /** get Pythia information about tracks in track comparison
148 * @param comparabletrack track to look for pythia information
149 * @return pythiatrack track information from pythia lookup
151 AliHLTTPCTrack GetComparableTrackPythiaInfo(AliHLTTPCTrack comparabletrack);
153 /** compare discarded track parameters with parameters from Pythia event
154 * @param discardedtrack pointer to a discarded track (usually with low pt)
155 * @return 0 upon correct decision (track with low pt accoridng to Pythia, i.e. track = delta-electron or similar noise)
156 * @return 1 upon wrong decision (track wrongly discarded, should by taken into account according to Pythia information)
158 Bool_t GetTrashTrackPythiaInfo(AliHLTTPCTrack* discardedtrack);
160 /** compare information of a cluster not assigned to any track with its Pythia information
161 * @param discardedcluster pointer to discarded cluster
162 * @return 0 upon correct decision (cluster not assigned to any track is true in Pythia, i.e. cluster = noise cluster)
163 * @return 1 upon wrong decision (cluster wrongly discarded, i.e. it belongs to a valuable track according to Pythia)
165 Bool_t GetClusterPythiaInfo(AliHLTTPCClusterData* discardedcluster);
167 /** compare two tracks in order to find if the match
168 * @param firsttracklistelement track from orignal tracking, stored in AliHLTTPCTrackList
169 * @param secondtracklistelement track from secondary tracking, stored in AliHLTTPCTrackList
170 * @return matchingindicator if all parameters are equal: matchingindicator = 10
172 Int_t CompareTrackInfo(AliHLTTPCTrackList* firsttracklistelement, AliHLTTPCTrackList* secondtracklistelement);
174 /** compare two pythia tracks in order to find if the match
175 * @param firsttracklistelement track from orignal tracking, stored in AliHLTTPCTrackList
176 * @param secondtracklistelement track from secondary tracking, stored in AliHLTTPCTrackList
177 * @return matchingindicator if all pythia parameters are equal: matchingindicator = 10 (should be so!)
179 Int_t ComparePythiaTrackInfo(AliHLTTPCTrackList* firsttracklistelement, AliHLTTPCTrackList* secondtracklistelement);
181 /** if -graphfile <filename>.root is given as input parameter, histrograms are created
182 * @param relativedifferences boolean to decide whether to plot histograms
183 * with relative differences in track paramters (1) or not (0), 1 by default
184 * @return 0 upon success
186 Int_t CreateGraphs(Bool_t relativedifferences = 1);
188 /** flag to decide wheter to do track or model loss analysis */
189 Bool_t fModelAnalysis; // switch on model analysis
190 Bool_t fTrackAnalysis; // switch on track analysis
192 /** name of humanly readable dump file for analysis results */
193 TString fDumpFileName;
194 /** name of root file name to store histograms of track comparison */
195 TString fGraphFileName;
197 /** members for track analysis: */
198 /** array with original tracks from first tracking */
199 AliHLTTPCTrackArray fFirstTrackArray; // array to store tracks of first tracking
200 /** array with tracks from secondary tracking with Vestbo-decompressed clusters */
201 AliHLTTPCTrackArray fSecondTrackArray; // array to store tracks of second tracking (after compression/expansion of model)
202 /** pointer to first element of first track list containing tracks and their pythia information */
203 AliHLTTPCTrackList* fFirstTrackList;
204 /** pointer to first element of second track list containing tracks and their pythia information */
205 AliHLTTPCTrackList* fSecondTrackList;
206 /** array of original clusters for deviation analysis to secondary clusters */
207 AliHLTTPCClusterData* fOriginalClusters[36][6];
208 /** array of secondary clusters for deviation analysis to origin clusters */
209 AliHLTTPCClusterData* fSecondaryClusters[36][6];
210 /** number of tracks with pt < 0.1GeV in first array */
211 Int_t fFirstTrashTracks;
212 /** number of tracks with pt < 0.1GeV in second array */
213 Int_t fSecondTrashTracks;
214 /** total number of compared tracks */
215 Int_t fTotalComparedTracks;
216 /** number of matched tracks under 0.1 GeV in first array */
217 Int_t fMatchedFirstTrashTracks;
218 /** number of matched tracks under 0.1 GeV in second array */
219 Int_t fMatchedSecondTrashTracks;
220 /** number of original tracks that do not have secondary track matches */
221 Int_t fFirstUnmatchedTracks;
222 /** number of secondary tracks that do not have original track matches */
223 Int_t fSecondUnmatchedTracks;
224 /** tolerance limits of relative deviation of compared track quantities, set in Init() */
225 Float_t fToleranceDeviation; // (firstparameter - secondparameter)/firstparameter <= fToleranceDeviation
227 /** members for model analysis: */
228 /** pointer to list of discarded tracks */
229 AliHLTTPCTrackList* fTrackListPointer; // pointer to list of discarded tracks
230 /** array of discarded clusters */
231 AliHLTTPCClusterData* fDiscardedClusters[36][6]; // array of discarded valuable clusters
233 /** total number of discarded clusters not assigned to any track per event */
234 Int_t fTotalDiscardedClusters; // number of discarded clusters
235 /** total number of wrongly discarded clusters according to Pythia information per event */
236 Int_t fValuableDiscardedClusters; // number of discarded clusters which should be assigned to a track
237 /** total number of discarded tracks per event */
238 Int_t fTrashTracks; // number of discarded tracks (pt lower 0.1 GeV)
240 ClassDef(AliHLTTPCCompModelAnalysis, 1)