FairRoot/PandaRoot
PndFTSPerformanceBase.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 PNDFTSPERFORMANCEBASE_H
11 #define PNDFTSPERFORMANCEBASE_H
12 
13 #include "PndFTSCounters.h"
14 
15 #include "PndFTSCADef.h"
16 #include "PndFTSArray.h"
17 #include "PndFTSCAMCTrack.h"
18 #include "PndFTSCAMCPoint.h"
19 #include <fstream>
20 #include <cstdio>
21 #include <map>
22 
23 #include <string>
24 using std::string;
25 
26 #include "TString.h"
27 
28 #include <iostream>
29 using std::ostream;
30 using std::istream;
31 
32 class TObject;
33 class TParticle;
34 class PndFTSCAMCPoint;
35 class PndFTSCAGBTracker;
36 class TDirectory;
37 class TH1;
38 
39 class TFile;
40 
44 class PndFTSPerformanceBase
45 {
46  public:
47 
48  struct PndFTSCAHitLabel {
49  int fLab[3]; //* array of 3 MC labels
50  friend ostream& operator<<(ostream& out, const PndFTSCAHitLabel& hl)
51  { return out << hl.fLab[0] << " " << hl.fLab[1] << " "<< hl.fLab[2] << " " << std::endl;}
52  friend istream& operator>>(istream& in, PndFTSCAHitLabel& hl)
53  { return in >> hl.fLab[0] >> hl.fLab[1] >> hl.fLab[2];}
54  };
55 
56  PndFTSPerformanceBase();
57  virtual ~PndFTSPerformanceBase();
58 
59  virtual void SetNewEvent( const PndFTSCAGBTracker * const Tracker,
63 
65  virtual void CreateHistos(string histoDir = "", TFile* outFile = 0){ UNUSED_PARAM2(histoDir, outFile); };
66 
68  virtual void Exec(bool print = false);
69 
70  virtual void PrintEfficiencyStatistic(){ fEffStat.CalcEff(); fEffStat.Print(); };
71  virtual void PrintEfficiency() { fEff.CalcEff(); fEff.Print(); };
72 
73  virtual void Draw(){}; // draw diff things after performance
74 
76  PndFTSEfficiencies &GetEff() { return fEff; };
77  PndFTSEfficiencies &GetEffStat(){ return fEffStat; };
78 
79  bool IsHistoCreated() { return fIsHistoCreated; }
80  void SetHistoCreated(bool v = 1) { fIsHistoCreated = v; }
81 
82  void SetHitLabels();
83  void SetMCTracks();
84  void SetMCPoints();
85 
86  vector<PndFTSCAPerformanceMCTrackData> &GetMCData() { return mcData; };
87  vector<PndFTSCAPerformanceRecoTrackData> &GetRecoData(){ return recoData; };
88 
89  public:
90 
91  virtual void FillHistos(){};
92  TH1 *GetHisto(const char* name);
93 
94  // Check if MC track is reconstructable. Calculate set of MC track. Etc.
95  virtual void CheckMCTracks(){}; // fill mcData.
96  // Find reco-MCTracks correspondence
97  virtual void MatchTracks(){}; // fill recoData.
98  // Calculate fEfficiencies
99  virtual void EfficiencyPerformance();
100  // Print fEfficiencies
101 
102 
103  int fStatNEvents; //* n of events proceed
104 
106  PndFTSEfficiencies fEff;
107  PndFTSEfficiencies fEffStat;
108 
109 
111  int NHisto;
112  struct THistoInfo {
113  THistoInfo(){};
114  THistoInfo( const char *name_, const char *title_, Int_t nx_, Double_t left_, Double_t right_,
115  Int_t ny_ = 0, Double_t low_ = 0, Double_t up_ = 0, TString XAxisName_="", TString YAxisName_="")
116  :name(name_),title(title_),nx(nx_),left(left_),right(right_),ny(ny_),low(low_),up(up_),XAxisName(XAxisName_),YAxisName(YAxisName_){};
117 
118  const char *name;
119  const char *title;
120  Int_t nx;
121  Double_t left,right;
122  Int_t ny;
123  Double_t low,up;
124  TString XAxisName, YAxisName;
125  };
126  TH1 **fHistos; // array of histos
127  THistoInfo *fHistosInfo; // array of histos parameters
128 
130  vector<PndFTSCAPerformanceMCTrackData> mcData; // iMCTrack to trackInfo map.
131  vector<PndFTSCAPerformanceRecoTrackData> recoData; // iRecoTrack to trackInfo map.
132 
134  const PndFTSCAGBTracker *fTracker; //* pointer to the tracker
135 
137  PndFTSResizableArray<PndFTSCAHitLabel> *fHitLabels; //* array of hit MC labels
138  PndFTSResizableArray<PndFTSCAMCTrack> *fMCTracks; //* array of MC tracks
139  PndFTSResizableArray<PndFTSCALocalMCPoint> *fLocalMCPoints; //* array of MC points in slices CS
140 
141  int nRecoTracks, nMCTracks;
142 
143  TDirectory *fHistoDir; //* ROOT directory with histogramm
144  bool fIsHistoCreated;
145 };
146 
147 #endif
148 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE
int low
Definition: anaMvdDigi.C:51
TString outFile
Definition: hit_dirc.C:17
std::ostream & operator<<(std::ostream &o, const PndEventInfo &a)
__m128 v
Definition: P4_F32vec4.h:4
tree Draw("fELoss:TMath::Sqrt(fPx_out*fPx_out+ fPy_out*fPy_out+ fPz_out*fPz_out)", ppos &&"fELoss < 0.04")
basic_ostream< char, char_traits< char > > ostream
Double_t
TFile * out
Definition: reco_muo.C:20
basic_istream< char, char_traits< char > > istream
TString name
TBuffer & operator>>(TBuffer &buf, PndAnaPidSelector *&obj)