3 // ************************************************************************
4 // This file is property of and copyright by the ALICE HLT Project *
5 // ALICE Experiment at CERN, All rights reserved. *
6 // See cxx source for full Copyright notice *
8 //*************************************************************************
10 #ifndef ALIHLTTPCCAPERFORMANCE_H
11 #define ALIHLTTPCCAPERFORMANCE_H
13 #include "AliHLTTPCCADef.h"
14 #include "Riostream.h"
18 class AliHLTTPCCAMCTrack;
19 class AliHLTTPCCAMCPoint;
20 class AliHLTTPCCAGBTracker;
27 * @class AliHLTTPCCAPerformance
29 * Does performance evaluation of the HLT Cellular Automaton-based tracker
30 * It checks performance for AliHLTTPCCATracker slice tracker
31 * and for AliHLTTPCCAGBTracker global tracker
34 class AliHLTTPCCAPerformance
39 struct AliHLTTPCCAHitLabel {
40 int fLab[3]; //* array of 3 MC labels
43 AliHLTTPCCAPerformance();
44 AliHLTTPCCAPerformance( const AliHLTTPCCAPerformance& );
45 const AliHLTTPCCAPerformance &operator=( const AliHLTTPCCAPerformance& ) const;
47 virtual ~AliHLTTPCCAPerformance();
49 static AliHLTTPCCAPerformance &Instance();
51 void SetTracker( AliHLTTPCCAGBTracker * const Tracker );
53 void SetNHits( int NHits );
54 void SetNMCTracks( int NMCTracks );
55 void SetNMCPoints( int NMCPoints );
57 void ReadHitLabel( int HitID,
58 int lab0, int lab1, int lab2 );
59 void ReadMCTrack( int index, const TParticle *part );
60 void ReadMCTPCTrack( int index, float X, float Y, float Z,
61 float Px, float Py, float Pz );
63 void ReadMCPoint( int TrackID, float X, float Y, float Z, float Time, int iSlice );
67 void SlicePerformance( int iSlice, bool PrintFlag );
68 void SliceTrackletPerformance( int iSlice, bool PrintFlag );
69 void SliceTrackCandPerformance( int iSlice, bool PrintFlag );
71 void Performance( fstream *StatFile = 0 );
73 void WriteMCEvent( ostream &out ) const;
74 void ReadMCEvent( istream &in );
75 void WriteMCPoints( ostream &out ) const;
76 void ReadMCPoints( istream &in );
77 bool DoClusterPulls() const { return fDoClusterPulls; }
78 void SetDoClusterPulls( bool v ) { fDoClusterPulls = v; }
79 AliHLTTPCCAHitLabel *HitLabels() const { return fHitLabels;}
80 AliHLTTPCCAMCTrack *MCTracks() const { return fMCTracks; }
81 int NMCTracks() const { return fNMCTracks; }
83 TH1D *HNHitsPerSeed() const { return fhNHitsPerSeed;}
84 TH1D *HNHitsPerTrackCand() const { return fhNHitsPerTrackCand; }
86 TH1D *LinkChiRight( int i ) const { return fhLinkChiRight[i]; }
87 TH1D *LinkChiWrong( int i ) const { return fhLinkChiWrong[i]; }
89 void LinkPerformance( int iSlice );
93 AliHLTTPCCAGBTracker *fTracker; //* pointer to the tracker
96 AliHLTTPCCAHitLabel *fHitLabels; //* array of hit MC labels
97 int fNHits; //* number of hits
98 AliHLTTPCCAMCTrack *fMCTracks; //* array of MC tracks
99 int fNMCTracks; //* number of MC tracks
100 AliHLTTPCCAMCPoint *fMCPoints; //* array of MC points
101 int fNMCPoints; //* number of MC points
102 bool fDoClusterPulls; //* do cluster pulls (very slow)
103 int fStatNEvents; //* n of events proceed
104 double fStatTime; //* reco time;
106 int fStatSeedNRecTot; //* total n of reconstructed tracks
107 int fStatSeedNRecOut; //* n of reconstructed tracks in Out set
108 int fStatSeedNGhost;//* n of reconstructed tracks in Ghost set
109 int fStatSeedNMCAll;//* n of MC tracks
110 int fStatSeedNRecAll; //* n of reconstructed tracks in All set
111 int fStatSeedNClonesAll;//* total n of reconstructed tracks in Clone set
112 int fStatSeedNMCRef; //* n of MC reference tracks
113 int fStatSeedNRecRef; //* n of reconstructed tracks in Ref set
114 int fStatSeedNClonesRef; //* n of reconstructed clones in Ref set
116 int fStatCandNRecTot; //* total n of reconstructed tracks
117 int fStatCandNRecOut; //* n of reconstructed tracks in Out set
118 int fStatCandNGhost;//* n of reconstructed tracks in Ghost set
119 int fStatCandNMCAll;//* n of MC tracks
120 int fStatCandNRecAll; //* n of reconstructed tracks in All set
121 int fStatCandNClonesAll;//* total n of reconstructed tracks in Clone set
122 int fStatCandNMCRef; //* n of MC reference tracks
123 int fStatCandNRecRef; //* n of reconstructed tracks in Ref set
124 int fStatCandNClonesRef; //* n of reconstructed clones in Ref set
126 int fStatNRecTot; //* total n of reconstructed tracks
127 int fStatNRecOut; //* n of reconstructed tracks in Out set
128 int fStatNGhost;//* n of reconstructed tracks in Ghost set
129 int fStatNMCAll;//* n of MC tracks
130 int fStatNRecAll; //* n of reconstructed tracks in All set
131 int fStatNClonesAll;//* total n of reconstructed tracks in Clone set
132 int fStatNMCRef; //* n of MC reference tracks
133 int fStatNRecRef; //* n of reconstructed tracks in Ref set
134 int fStatNClonesRef; //* n of reconstructed clones in Ref set
136 int fStatGBNRecTot; //* global tracker: total n of reconstructed tracks
137 int fStatGBNRecOut; //* global tracker: n of reconstructed tracks in Out set
138 int fStatGBNGhost;//* global tracker: n of reconstructed tracks in Ghost set
139 int fStatGBNMCAll;//* global tracker: n of MC tracks
140 int fStatGBNRecAll; //* global tracker: n of reconstructed tracks in All set
141 int fStatGBNClonesAll;//* global tracker: total n of reconstructed tracks in Clone set
142 int fStatGBNMCRef; //* global tracker: n of MC reference tracks
143 int fStatGBNRecRef; //* global tracker: n of reconstructed tracks in Ref set
144 int fStatGBNClonesRef; //* global tracker: n of reconstructed clones in Ref set
146 TDirectory *fHistoDir; //* ROOT directory with histogramms
149 *fhResY, //* track Y resolution at the TPC entrance
150 *fhResZ, //* track Z resolution at the TPC entrance
151 *fhResSinPhi, //* track SinPhi resolution at the TPC entrance
152 *fhResDzDs, //* track DzDs resolution at the TPC entrance
153 *fhResPt, //* track Pt relative resolution at the TPC entrance
154 *fhPullY, //* track Y pull at the TPC entrance
155 *fhPullZ, //* track Z pull at the TPC entrance
156 *fhPullSinPhi, //* track SinPhi pull at the TPC entrance
157 *fhPullDzDs, //* track DzDs pull at the TPC entrance
158 *fhPullQPt, //* track Q/Pt pull at the TPC entrance
159 *fhPullYS, //* sqrt(chi2/ndf) deviation of the track parameters Y and SinPhi at the TPC entrance
160 *fhPullZT; //* sqrt(chi2/ndf) deviation of the track parameters Z and DzDs at the TPC entrance
162 TProfile *fhCluShared; //* ratio of the shared clusters
165 *fhCluResY, //* cluster resolution Y
166 *fhCluResZ, //* cluster resolution Z
167 *fhCluErrY, //* cluster error in Y
168 *fhCluErrZ, //* cluster error in Z
169 *fhCluPullY, //* cluster pull Y
170 *fhCluPullZ, //* cluster pull Z
171 *fhCluResY1, //* cluster resolution Y, Pt>1
172 *fhCluResZ1, //* cluster resolution Z, Pt>1
173 *fhCluErrY1, //* cluster error in Y, Pt>1
174 *fhCluErrZ1, //* cluster error in Z, Pt>1
175 *fhCluPullY1,//* cluster pull Y, Pt>1
176 *fhCluPullZ1,//* cluster pull Z, Pt>1
177 *fhCluOrigErrY, //* cluster original error in Y
178 *fhCluOrigErrZ, //* cluster original error in Z
179 *fhCluOrigPullY, //* cluster original pull Y
180 *fhCluOrigPullZ, //* cluster original pull Z
181 *fhCluOrigResY1, //* cluster original resolution Y, Pt>1
182 *fhCluOrigResZ1, //* cluster original resolution Z, Pt>1
183 *fhCluOrigErrY1, //* cluster original error in Y, Pt>1
184 *fhCluOrigErrZ1, //* cluster original error in Z, Pt>1
185 *fhCluOrigPullY1,//* cluster original pull Y, Pt>1
186 *fhCluOrigPullZ1;//* cluster original pull Z, Pt>1
190 *fhCellPurity,//* cell purity
191 *fhCellNHits//* cell n hits
195 *fhCellPurityVsN, //* cell purity vs N hits
196 *fhCellPurityVsPt,//* cell purity vs MC Pt
197 *fhEffVsP, //* reconstruction efficiency vs P plot
198 *fhSeedEffVsP, //* reconstruction efficiency vs P plot
199 *fhCandEffVsP, //* reconstruction efficiency vs P plot
200 *fhGBEffVsP, //* global reconstruction efficiency vs P plot
201 *fhGBEffVsPt, //* global reconstruction efficiency vs P plot
202 *fhNeighQuality, // quality for neighbours finder
203 *fhNeighEff,// efficiency for neighbours finder
204 *fhNeighQualityVsPt,// quality for neighbours finder vs track Pt
205 *fhNeighEffVsPt;// efficiency for neighbours finder vs track Pt
207 *fhNeighDy, // dy for neighbours
208 *fhNeighDz,// dz for neighbours
209 *fhNeighChi;// chi2^0.5 for neighbours
211 *fhNeighDyVsPt, // dy for neighbours vs track Pt
212 *fhNeighDzVsPt,// dz for neighbours vs track Pt
213 *fhNeighChiVsPt, // chi2^0.5 for neighbours vs track Pt
214 *fhNeighNCombVsArea; // N neighbours in the search area
217 *fhNHitsPerSeed, // n hits per track seed
218 *fhNHitsPerTrackCand; // n hits per track candidate
221 *fhTrackLengthRef, // reconstructed track length, %
222 *fhRefRecoX,// parameters of non-reconstructed ref. mc track
223 *fhRefRecoY,// parameters of non-reconstructed ref. mc track
224 *fhRefRecoZ,// parameters of non-reconstructed ref. mc track
225 *fhRefRecoP, // parameters of non-reconstructed ref. mc track
226 *fhRefRecoPt,// parameters of non-reconstructed ref. mc track
227 *fhRefRecoAngleY,// parameters of non-reconstructed ref. mc track
228 *fhRefRecoAngleZ,// parameters of non-reconstructed ref. mc track
229 *fhRefRecoNHits,// parameters of non-reconstructed ref. mc track
230 *fhRefNotRecoX,// parameters of non-reconstructed ref. mc track
231 *fhRefNotRecoY,// parameters of non-reconstructed ref. mc track
232 *fhRefNotRecoZ,// parameters of non-reconstructed ref. mc track
233 *fhRefNotRecoP, // parameters of non-reconstructed ref. mc track
234 *fhRefNotRecoPt,// parameters of non-reconstructed ref. mc track
235 *fhRefNotRecoAngleY,// parameters of non-reconstructed ref. mc track
236 *fhRefNotRecoAngleZ,// parameters of non-reconstructed ref. mc track
237 *fhRefNotRecoNHits;// parameters of non-reconstructed ref. mc track
239 TProfile * fhLinkEff[4]; // link efficiency
240 TH1D *fhLinkAreaY[4]; // area in Y for the link finder
241 TH1D *fhLinkAreaZ[4]; // area in Z for the link finder
242 TH1D *fhLinkChiRight[4]; // sqrt(chi^2) for right neighbours
243 TH1D *fhLinkChiWrong[4]; // sqrt(chi^2) for wrong neighbours
245 static void WriteDir2Current( TObject *obj );