]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCAPerformance.h
d58c8fe8d9cd0df6f9645d3434efc7b941507a35
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCAPerformance.h
1 //-*- Mode: C++ -*-
2 // $Id$
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                               *
7 //                                                                        *
8 //*************************************************************************
9
10 #ifndef ALIHLTTPCCAPERFORMANCE_H
11 #define ALIHLTTPCCAPERFORMANCE_H
12
13 #include "AliHLTTPCCADef.h"
14 #include "Riostream.h"
15
16 class TObject;
17 class TParticle;
18 class AliHLTTPCCAMCTrack;
19 class AliHLTTPCCAMCPoint;
20 class AliHLTTPCCAGBTracker;
21 class TDirectory;
22 class TH1D;
23 class TH2D;
24 class TProfile;
25
26 /**
27  * @class AliHLTTPCCAPerformance
28  *
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
32  *
33  */
34 class AliHLTTPCCAPerformance
35 {
36
37   public:
38
39     struct AliHLTTPCCAHitLabel {
40       int fLab[3]; //* array of 3 MC labels
41     };
42
43     AliHLTTPCCAPerformance();
44     AliHLTTPCCAPerformance( const AliHLTTPCCAPerformance& );
45     const AliHLTTPCCAPerformance &operator=( const AliHLTTPCCAPerformance& ) const;
46
47     virtual ~AliHLTTPCCAPerformance();
48
49     static AliHLTTPCCAPerformance &Instance();
50
51     void SetTracker( AliHLTTPCCAGBTracker * const Tracker );
52     void StartEvent();
53     void SetNHits( int NHits );
54     void SetNMCTracks( int NMCTracks );
55     void SetNMCPoints( int NMCPoints );
56
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 );
62
63     void ReadMCPoint( int TrackID, float X, float Y, float Z, float Time, int iSlice );
64
65     void CreateHistos();
66     void WriteHistos();
67     void SlicePerformance( int iSlice, bool PrintFlag  );
68     void SliceTrackletPerformance( int iSlice, bool PrintFlag );
69     void SliceTrackCandPerformance( int iSlice, bool PrintFlag );
70
71     void Performance( fstream *StatFile = 0 );
72
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; }
82
83     TH1D *HNHitsPerSeed() const { return fhNHitsPerSeed;}
84     TH1D *HNHitsPerTrackCand() const { return fhNHitsPerTrackCand; }
85
86     TH1D *LinkChiRight( int i ) const { return fhLinkChiRight[i]; }
87     TH1D *LinkChiWrong( int i ) const { return fhLinkChiWrong[i]; }
88
89     void LinkPerformance( int iSlice );
90
91   protected:
92
93     AliHLTTPCCAGBTracker *fTracker; //* pointer to the tracker
94
95
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;
105
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
115
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
125
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
135
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
145
146     TDirectory *fHistoDir; //* ROOT directory with histogramms
147
148     TH1D
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
161
162     TProfile *fhCluShared; //* ratio of the shared clusters
163
164     TH1D
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
187
188
189     TH1D
190     *fhCellPurity,//* cell purity
191     *fhCellNHits//* cell n hits
192     ;
193
194     TProfile
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
206     TH1D
207     *fhNeighDy, // dy for neighbours
208     *fhNeighDz,// dz for neighbours
209     *fhNeighChi;// chi2^0.5 for neighbours
210     TH2D
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
215
216     TH1D
217     *fhNHitsPerSeed, // n hits per track seed
218     *fhNHitsPerTrackCand; // n hits per track candidate
219
220     TH1D
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
238
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
244
245     static void WriteDir2Current( TObject *obj );
246
247 };
248
249 #endif