]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCAPerformance.h
coverity 17742 fixed
[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 #include <vector>
16
17 class TObject;
18 class TParticle;
19 class AliHLTTPCCAMCTrack;
20 class AliHLTTPCCAMCPoint;
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
45     virtual ~AliHLTTPCCAPerformance();
46
47     static AliHLTTPCCAPerformance &Instance();
48
49     void StartEvent();
50     void SetNHits( int NHits );
51     void SetNMCTracks( int NMCTracks );
52     void SetNMCPoints( int NMCPoints );
53
54     void ReadHitLabel( int HitID,
55                        int lab0, int lab1, int lab2 );
56     void ReadMCTrack( int index, const TParticle *part );
57     void ReadMCTPCTrack( int index, float X, float Y, float Z,
58                          float Px, float Py, float Pz );
59
60     void ReadMCPoint( int TrackID, float X, float Y, float Z, float Time, int iSlice );
61
62     void CreateHistos();
63     void WriteHistos();
64     void GetMCLabel( std::vector<int> &ClusterIDs, int &Label, float &Purity );
65     void SlicePerformance( int iSlice, bool PrintFlag  );
66     void SliceTrackletPerformance( int iSlice, bool PrintFlag );
67     void SliceTrackCandPerformance( int iSlice, bool PrintFlag );
68     void ClusterPerformance();
69     void MergerPerformance();
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     void SmearClustersMC();
91
92   protected:
93
94
95     AliHLTTPCCAHitLabel *fHitLabels; //* array of hit MC labels
96     int fNHits;                    //* number of hits
97     AliHLTTPCCAMCTrack *fMCTracks;   //* array of MC tracks
98     int fNMCTracks;                //* number of MC tracks
99     AliHLTTPCCAMCPoint *fMCPoints;   //* array of MC points
100     int fNMCPoints;                //* number of MC points
101     bool fDoClusterPulls;          //* do cluster pulls (very slow)
102     int fStatNEvents; //* n of events proceed
103     double fStatTime; //* reco time;
104
105     int fStatSeedNRecTot; //* total n of reconstructed tracks
106     int fStatSeedNRecOut; //* n of reconstructed tracks in Out set
107     int fStatSeedNGhost;//* n of reconstructed tracks in Ghost set
108     int fStatSeedNMCAll;//* n of MC tracks
109     int fStatSeedNRecAll; //* n of reconstructed tracks in All set
110     int fStatSeedNClonesAll;//* total n of reconstructed tracks in Clone set
111     int fStatSeedNMCRef; //* n of MC reference tracks
112     int fStatSeedNRecRef; //* n of reconstructed tracks in Ref set
113     int fStatSeedNClonesRef; //* n of reconstructed clones in Ref set
114
115     int fStatCandNRecTot; //* total n of reconstructed tracks
116     int fStatCandNRecOut; //* n of reconstructed tracks in Out set
117     int fStatCandNGhost;//* n of reconstructed tracks in Ghost set
118     int fStatCandNMCAll;//* n of MC tracks
119     int fStatCandNRecAll; //* n of reconstructed tracks in All set
120     int fStatCandNClonesAll;//* total n of reconstructed tracks in Clone set
121     int fStatCandNMCRef; //* n of MC reference tracks
122     int fStatCandNRecRef; //* n of reconstructed tracks in Ref set
123     int fStatCandNClonesRef; //* n of reconstructed clones in Ref set
124
125     int fStatNRecTot; //* total n of reconstructed tracks
126     int fStatNRecOut; //* n of reconstructed tracks in Out set
127     int fStatNGhost;//* n of reconstructed tracks in Ghost set
128     int fStatNMCAll;//* n of MC tracks
129     int fStatNRecAll; //* n of reconstructed tracks in All set
130     int fStatNClonesAll;//* total n of reconstructed tracks in Clone set
131     int fStatNMCRef; //* n of MC reference tracks
132     int fStatNRecRef; //* n of reconstructed tracks in Ref set
133     int fStatNClonesRef; //* n of reconstructed clones in Ref set
134
135     int fStatGBNRecTot; //* global tracker: total n of reconstructed tracks
136     int fStatGBNRecOut; //* global tracker: n of reconstructed tracks in Out set
137     int fStatGBNGhost;//* global tracker: n of reconstructed tracks in Ghost set
138     int fStatGBNMCAll;//* global tracker: n of MC tracks
139     int fStatGBNRecAll; //* global tracker: n of reconstructed tracks in All set
140     int fStatGBNClonesAll;//* global tracker: total n of reconstructed tracks in Clone set
141     int fStatGBNMCRef; //* global tracker: n of MC reference tracks
142     int fStatGBNRecRef; //* global tracker: n of reconstructed tracks in Ref set
143     int fStatGBNClonesRef; //* global tracker: n of reconstructed clones in Ref set
144
145     TDirectory *fHistoDir; //* ROOT directory with histogramms
146
147     TH1D
148     *fhResY,       //* track Y resolution at the TPC entrance
149     *fhResZ,       //* track Z resolution at the TPC entrance
150     *fhResSinPhi,  //* track SinPhi resolution at the TPC entrance
151     *fhResDzDs,    //* track DzDs resolution at the TPC entrance
152     *fhResPt,      //* track Pt relative resolution at the TPC entrance
153     *fhPullY,      //* track Y pull at the TPC entrance
154     *fhPullZ,      //* track Z pull at the TPC entrance
155     *fhPullSinPhi, //* track SinPhi pull at the TPC entrance
156     *fhPullDzDs, //* track DzDs pull at the TPC entrance
157     *fhPullQPt,    //* track Q/Pt pull at the TPC entrance
158     *fhPullYS,       //* sqrt(chi2/ndf) deviation of the track parameters Y and SinPhi at the TPC entrance
159     *fhPullZT;      //* sqrt(chi2/ndf) deviation of the track parameters Z and DzDs at the TPC entrance
160
161     TH1D
162     *fhHitErrY, //* hit error in Y
163     *fhHitErrZ,//* hit error in Z
164     *fhHitResY,//* hit resolution Y
165     *fhHitResZ,//* hit resolution Z
166     *fhHitPullY,//* hit  pull Y
167     *fhHitPullZ;//* hit  pull Z
168     TProfile *fhHitShared; //* ratio of the shared clusters
169
170     TH1D
171     *fhHitResY1,//* hit resolution Y, pt>1GeV
172     *fhHitResZ1,//* hit resolution Z, pt>1GeV
173     *fhHitPullY1,//* hit  pull Y, pt>1GeV
174     *fhHitPullZ1;//* hit  pull Z, pt>1GeV
175
176     TH1D
177     *fhCellPurity,//* cell purity
178     *fhCellNHits//* cell n hits
179     ;
180
181     TProfile
182     *fhCellPurityVsN, //* cell purity vs N hits
183     *fhCellPurityVsPt,//* cell purity vs MC Pt
184     *fhEffVsP, //* reconstruction efficiency vs P plot
185     *fhSeedEffVsP, //* reconstruction efficiency vs P plot
186     *fhCandEffVsP, //* reconstruction efficiency vs P plot
187     *fhGBEffVsP, //* global reconstruction efficiency vs P plot
188     *fhGBEffVsPt, //* global reconstruction efficiency vs P plot
189     *fhNeighQuality, // quality for neighbours finder
190     *fhNeighEff,// efficiency for neighbours finder
191     *fhNeighQualityVsPt,// quality for neighbours finder vs track Pt
192     *fhNeighEffVsPt;// efficiency for neighbours finder vs track Pt
193     TH1D
194     *fhNeighDy, // dy for neighbours
195     *fhNeighDz,// dz for neighbours
196     *fhNeighChi;// chi2^0.5 for neighbours
197     TH2D
198     *fhNeighDyVsPt, // dy for neighbours vs track Pt
199     *fhNeighDzVsPt,// dz for neighbours vs track Pt
200     *fhNeighChiVsPt, // chi2^0.5 for neighbours vs track Pt
201     *fhNeighNCombVsArea; // N neighbours in the search area
202
203     TH1D
204     *fhNHitsPerSeed, // n hits per track seed
205     *fhNHitsPerTrackCand; // n hits per track candidate
206
207     TH1D
208     *fhTrackLengthRef, // reconstructed track length, %
209     *fhRefRecoX,// parameters of non-reconstructed ref. mc track
210     *fhRefRecoY,// parameters of non-reconstructed ref. mc track
211     *fhRefRecoZ,// parameters of non-reconstructed ref. mc track
212     *fhRefRecoP, // parameters of non-reconstructed ref. mc track
213     *fhRefRecoPt,// parameters of non-reconstructed ref. mc track
214     *fhRefRecoAngleY,// parameters of non-reconstructed ref. mc track
215     *fhRefRecoAngleZ,// parameters of non-reconstructed ref. mc track
216     *fhRefRecoNHits,// parameters of non-reconstructed ref. mc track
217     *fhRefNotRecoX,// parameters of non-reconstructed ref. mc track
218     *fhRefNotRecoY,// parameters of non-reconstructed ref. mc track
219     *fhRefNotRecoZ,// parameters of non-reconstructed ref. mc track
220     *fhRefNotRecoP, // parameters of non-reconstructed ref. mc track
221     *fhRefNotRecoPt,// parameters of non-reconstructed ref. mc track
222     *fhRefNotRecoAngleY,// parameters of non-reconstructed ref. mc track
223     *fhRefNotRecoAngleZ,// parameters of non-reconstructed ref. mc track
224     *fhRefNotRecoNHits;// parameters of non-reconstructed ref. mc track
225
226     TProfile * fhLinkEff[4]; // link efficiency
227     TH1D *fhLinkAreaY[4]; // area in Y for the link finder
228     TH1D *fhLinkAreaZ[4]; // area in Z for the link finder
229     TH1D *fhLinkChiRight[4]; // sqrt(chi^2) for right neighbours
230     TH1D *fhLinkChiWrong[4]; // sqrt(chi^2) for wrong neighbours
231
232     static void WriteDir2Current( TObject *obj );
233
234 private:
235   /// copy constructor prohibited
236   AliHLTTPCCAPerformance( const AliHLTTPCCAPerformance& );
237   /// assignment operator prohibited
238   AliHLTTPCCAPerformance &operator=( const AliHLTTPCCAPerformance& ) const;
239
240 };
241
242 #endif //ALIHLTTPCCAPERFORMANCE_H