PandaRoot
PndCAPerformanceBase.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // ************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
5 // See cxx source for full Copyright notice *
6 // *
7 //*************************************************************************
8 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
9 
10 #ifndef PNDCAPERFORMANCEBASE_H
11 #define PNDCAPERFORMANCEBASE_H
12 
13 #include "PndCACounters.h"
14 #include "PndCAMCTrack.h"
15 #include "PndCAMCPoint.h"
16 
17 //#include <fstream>
18 //#include <cstdio>
19 
20 #include <vector>
21 
22 #include <string>
23 using std::string;
24 
25 #include "TString.h"
26 
27 #include <iostream>
28 using std::istream;
29 using std::ostream;
30 
31 // class TObject;
32 // class TParticle;
33 // class PndCAMCPoint;
34 class PndCAGBTracker;
35 class TDirectory;
36 class TH1;
37 
38 class TFile;
39 
43 class PndCAPerformanceBase {
44  public:
45  struct PndCAHitLabel {
46  int fLab[3]; //* array of 3 MC labels
47  friend ostream &operator<<(ostream &out, const PndCAHitLabel &hl) { return out << hl.fLab[0] << " " << hl.fLab[1] << " " << hl.fLab[2] << " " << std::endl; }
48  friend istream &operator>>(istream &in, PndCAHitLabel &hl) { return in >> hl.fLab[0] >> hl.fLab[1] >> hl.fLab[2]; }
49  };
50 
51  PndCAPerformanceBase();
52  virtual ~PndCAPerformanceBase();
53 
54  virtual void SetNewEvent(const PndCAGBTracker *const Tracker, vector<PndCAHitLabel> *hitLabels, vector<PndCAMCTrack> *mcTracks, vector<PndCALocalMCPoint> *localMCPoints);
55 
57  virtual void CreateHistos(string histoDir = "", TFile *outFile = 0) { UNUSED_PARAM2(histoDir, outFile); };
58 
60  virtual void Exec(bool print = false);
61 
62  virtual void PrintEfficiencyStatistic()
63  {
64  fEffStat.CalcEff();
65  fEffStat.Print();
66  };
67  virtual void PrintEfficiency()
68  {
69  fEff.CalcEff();
70  fEff.Print();
71  };
72 
73  virtual void Draw(){}; // draw diff things after performance
74 
76  PndCAEfficiencies &GetEff() { return fEff; };
77  PndCAEfficiencies &GetEffStat() { return fEffStat; };
78 
79  bool IsHistoCreated() { return fIsHistoCreated; }
80  void SetHistoCreated(bool v = 1) { fIsHistoCreated = v; }
81 
82  vector<PndCAPerformanceMCTrackData> &GetMCData() { return mcData; };
83  vector<PndCAPerformanceRecoTrackData> &GetRecoData() { return recoData; };
84 
85  protected:
86  virtual void FillHistos(){};
87  TH1 *GetHisto(const char *name);
88 
89  // Check if MC track is reconstructable. Calculate set of MC track. Etc.
90  virtual void CheckMCTracks(){}; // fill mcData.
91  // Find reco-MCTracks correspondence
92  virtual void MatchTracks(){}; // fill recoData.
93  // Calculate fEfficiencies
94  virtual void EfficiencyPerformance();
95  // Print fEfficiencies
96 
97  int fStatNEvents; //* n of events proceed
98 
100  PndCAEfficiencies fEff;
101  PndCAEfficiencies fEffStat;
102 
104  int NHisto;
105  struct THistoInfo {
106  THistoInfo(){};
107  THistoInfo(const char *name_, const char *title_, Int_t nx_, Double_t left_, Double_t right_, Int_t ny_ = 0, Double_t low_ = 0, Double_t up_ = 0, TString XAxisName_ = "",
108  TString YAxisName_ = "")
109  : name(name_), title(title_), nx(nx_), left(left_), right(right_), ny(ny_), low(low_), up(up_), XAxisName(XAxisName_), YAxisName(YAxisName_){};
110 
111  const char *name;
112  const char *title;
113  Int_t nx;
114  Double_t left, right;
115  Int_t ny;
116  Double_t low, up;
117  TString XAxisName, YAxisName;
118  };
119  TH1 **fHistos; // array of histos
120  THistoInfo *fHistosInfo; // array of histos parameters
121 
123  vector<PndCAPerformanceMCTrackData> mcData; // iMCTrack to trackInfo map.
124  vector<PndCAPerformanceRecoTrackData> recoData; // iRecoTrack to trackInfo map.
125 
127  const PndCAGBTracker *fTracker; //* pointer to the tracker
128 
130  vector<PndCAHitLabel> *fHitLabels; //* array of hit MC labels
131  vector<PndCAMCTrack> *fMCTracks; //* array of MC tracks
132  vector<PndCALocalMCPoint> *fLocalMCPoints; //* array of MC points in slices CS
133 
134  int nRecoTracks, nMCTracks;
135 
136  TDirectory *fHistoDir; //* ROOT directory with histogramm
137  bool fIsHistoCreated;
138 };
139 
140 #endif
141 #endif // DO_TPCCATRACKER_EFF_PERFORMANCE
basic_istream< char, char_traits< char > > istream
std::ostream & operator<<(std::ostream &o, const PndEventInfo &)
__m128 v
Definition: P4_F32vec4.h:3
std::istream & operator>>(std::istream &stream, RhoVector3Err &verr)
basic_ostream< char, char_traits< char > > ostream
void print(std::vector< ClassifierOutPuts > const &OutPutList)