FairRoot/PandaRoot
PndFTSPerformanceBase.cxx
Go to the documentation of this file.
1 // $Id: PndFTSCAPerformanceBase.cxx,v 1.11 2010/08/26 15:05:50 ikulakov Exp $
2 // **************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
5 // *
6 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
7 // Ivan Kisel <kisel@kip.uni-heidelberg.de> *
8 // for The ALICE HLT Project. *
9 // *
10 // Developed by: Igor Kulakov <I.Kulakov@gsi.de> *
11 // Maksym Zyzak <M.Zyzak@gsi.de> *
12 // *
13 // Permission to use, copy, modify and distribute this software and its *
14 // documentation strictly for non-commercial purposes is hereby granted *
15 // without fee, provided that the above copyright notice appears in all *
16 // copies and that both the copyright notice and this permission notice *
17 // appear in the supporting documentation. The authors make no claims *
18 // about the suitability of this software for any purpose. It is *
19 // provided "as is" without express or implied warranty. *
20 // *
21 //***************************************************************************
22 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
23 
24 #include "PndFTSCounters.h"
25 
26 #include "PndFTSPerformanceBase.h"
27 #include "PndFTSCAGBHit.h"
28 #include "PndFTSCAMCTrack.h"
29 #ifndef HLTCA_STANDALONE
30 #include "PndFTSCAMCPoint.h"
31 #endif
32 #include "PndFTSCAGBTrack.h"
33 #include "PndFTSCAGBTracker.h"
34 
35 #include "PndFTSCADisplay.h"
36 
37 
38 #include "TMath.h"
39 #include "TROOT.h"
40 #include "Riostream.h"
41 #include "TFile.h"
42 #include "TH1.h"
43 #include "TH2.h"
44 #include "TProfile.h"
45 #include "TStyle.h"
46 
47 #include <string>
48 using std::string;
49 
50 void PndFTSPerformanceBase::SetNewEvent( const PndFTSCAGBTracker * const tracker,
54 {
55  fTracker = tracker;
56 
57  fHitLabels = hitLabels;
58  fMCTracks = mcTracks;
59  fLocalMCPoints = localMCPoints;
60 
61  nMCTracks = (*fMCTracks).Size();
62 
63  fEff = PndFTSEfficiencies();
64  mcData.resize(0);
65  recoData.resize(0);
66 } // void PndFTSPerformanceBase::SetNewEvent
67 
68 PndFTSPerformanceBase::PndFTSPerformanceBase():
69  fStatNEvents(0),NHisto(0),fTracker(0),fHitLabels(0),fMCTracks(0),fLocalMCPoints(0),nRecoTracks(0),nMCTracks(0),fHistoDir(0)
70 {
71 
72 }
73 
74 PndFTSPerformanceBase::~PndFTSPerformanceBase()
75 {
76  if (fHistoDir == 0) // don't write in file
77  for( int i = 0; i < NHisto; i++ ){
78  if (fHistos[i]) delete fHistos[i];
79  }
80 
81  if(fHistosInfo) delete [] fHistosInfo;
82  if(fHistos) delete [] fHistos;
83 }
84 
85 
86 void PndFTSPerformanceBase::Exec( bool PrintFlag )
87 {
88  assert( fTracker != 0 );
89 
90  // Efficiency
91  CheckMCTracks();
92  MatchTracks();
93  EfficiencyPerformance();
94  if (PrintFlag) PrintEfficiency();
95 
96  // Histos
97  FillHistos();
98  Draw();
99  fStatNEvents++;
100 } // Exec
101 
102 
103 void PndFTSPerformanceBase::EfficiencyPerformance() // TODO add common parts of code
104 {
105  fEff.IncNEvents();
106  fEffStat += fEff;
107 }
108 
109 
110 TH1 *PndFTSPerformanceBase::GetHisto(const char* name)
111 {
112  int iHisto;
113  for (iHisto = 0; iHisto < NHisto; iHisto++){
114  if (string(fHistosInfo[iHisto].name) == string(name)){
115  break;
116  };
117  }
118 
119  assert ( (iHisto != NHisto) || (string("") == string(" wrong histo name ")) );
120  if (iHisto == NHisto){
121  cout << "ERROR: wrong histo name: " << name << endl;
122  exit(1);
123  }
124 
125  return fHistos[iHisto];
126 }
127 
128 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE
129 
Int_t i
Definition: run_full.C:25
exit(0)
tree Draw("fELoss:TMath::Sqrt(fPx_out*fPx_out+ fPy_out*fPy_out+ fPz_out*fPz_out)", ppos &&"fELoss < 0.04")
TString name