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