FairRoot/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::ostream;
29 using std::istream;
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 {
45  public:
46 
47  struct PndCAHitLabel {
48  int fLab[3]; //* array of 3 MC labels
49  friend ostream& operator<<(ostream& out, const PndCAHitLabel& hl)
50  { return out << hl.fLab[0] << " " << hl.fLab[1] << " "<< hl.fLab[2] << " " << std::endl;}
51  friend istream& operator>>(istream& in, PndCAHitLabel& hl)
52  { return in >> hl.fLab[0] >> hl.fLab[1] >> hl.fLab[2];}
53  };
54 
55  PndCAPerformanceBase();
56  virtual ~PndCAPerformanceBase();
57 
58  virtual void SetNewEvent( const PndCAGBTracker * const Tracker,
59  vector<PndCAHitLabel> *hitLabels,
60  vector<PndCAMCTrack> *mcTracks,
61  vector<PndCALocalMCPoint> *localMCPoints);
62 
64  virtual void CreateHistos(string histoDir = "", TFile* outFile = 0){ UNUSED_PARAM2(histoDir, outFile); };
65 
67  virtual void Exec(bool print = false);
68 
69  virtual void PrintEfficiencyStatistic(){ fEffStat.CalcEff(); fEffStat.Print(); };
70  virtual void PrintEfficiency() { fEff.CalcEff(); fEff.Print(); };
71 
72  virtual void Draw(){}; // draw diff things after performance
73 
75  PndCAEfficiencies &GetEff() { return fEff; };
76  PndCAEfficiencies &GetEffStat(){ return fEffStat; };
77 
78  bool IsHistoCreated() { return fIsHistoCreated; }
79  void SetHistoCreated(bool v = 1) { fIsHistoCreated = v; }
80 
81  vector<PndCAPerformanceMCTrackData> &GetMCData() { return mcData; };
82  vector<PndCAPerformanceRecoTrackData> &GetRecoData(){ return recoData; };
83 
84  protected:
85 
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 
98  int fStatNEvents; //* n of events proceed
99 
101  PndCAEfficiencies fEff;
102  PndCAEfficiencies fEffStat;
103 
104 
106  int NHisto;
107  struct THistoInfo {
108  THistoInfo(){};
109  THistoInfo( const char *name_, const char *title_, Int_t nx_, Double_t left_, Double_t right_,
110  Int_t ny_ = 0, Double_t low_ = 0, Double_t up_ = 0, TString XAxisName_="", TString YAxisName_="")
111  :name(name_),title(title_),nx(nx_),left(left_),right(right_),ny(ny_),low(low_),up(up_),XAxisName(XAxisName_),YAxisName(YAxisName_){};
112 
113  const char *name;
114  const char *title;
115  Int_t nx;
116  Double_t left,right;
117  Int_t ny;
118  Double_t low,up;
119  TString XAxisName, YAxisName;
120  };
121  TH1 **fHistos; // array of histos
122  THistoInfo *fHistosInfo; // array of histos parameters
123 
125  vector<PndCAPerformanceMCTrackData> mcData; // iMCTrack to trackInfo map.
126  vector<PndCAPerformanceRecoTrackData> recoData; // iRecoTrack to trackInfo map.
127 
129  const PndCAGBTracker *fTracker; //* pointer to the tracker
130 
132  vector<PndCAHitLabel> *fHitLabels; //* array of hit MC labels
133  vector<PndCAMCTrack> *fMCTracks; //* array of MC tracks
134  vector<PndCALocalMCPoint> *fLocalMCPoints; //* array of MC points in slices CS
135 
136  int nRecoTracks, nMCTracks;
137 
138  TDirectory *fHistoDir; //* ROOT directory with histogramm
139  bool fIsHistoCreated;
140 };
141 
142 #endif
143 #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)