Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFParticlePerformanceBase.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFParticlePerformanceBase.h
1 /*
2  * This file is part of KFParticle package
3  * Copyright (C) 2007-2019 FIAS Frankfurt Institute for Advanced Studies
4  * 2007-2019 Goethe University of Frankfurt
5  * 2007-2019 Ivan Kisel <I.Kisel@compeng.uni-frankfurt.de>
6  * 2007-2019 Maksym Zyzak
7  *
8  * KFParticle is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * KFParticle is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
23 
24 #ifndef KFParticlePERFORMANCEBASE_H
25 #define KFParticlePERFORMANCEBASE_H
26 
27 #ifdef KFPWITHTRACKER
28 #include "AliHLTTPCCounters.h"
29 
30 #include "AliHLTTPCPerformanceBase.h"
31 
32 #include "AliHLTTPCCADef.h"
33 #include "AliHLTArray.h"
34 #include "AliHLTTPCCAMCTrack.h"
35 #include "AliHLTTPCCAMCPoint.h"
36 #endif
37 
38 #include "KFPartEfficiencies.h"
39 #include "KFPVEfficiencies.h"
40 
41 #include <map>
42 #include <string>
43 
44 class TDirectory;
45 class TH1F;
46 class TH2F;
47 class TH3F;
48 
49 class KFParticle;
50 class TProfile;
51 class TProfile2D;
52 
68 class KFParticlePerformanceBase
69 #ifdef KFPWITHTRACKER
70 : public AliHLTTPCPerformanceBase
71 #endif
72 {
73  public:
74 
75  KFParticlePerformanceBase();
76  virtual ~KFParticlePerformanceBase(){};
77 
79  virtual void CreateHistos(std::string histoDir = "", TDirectory* outFile = 0, std::map<int,bool> decays = std::map<int,bool>());
80  TDirectory* GetHistosDirectory() { return fHistoDir; }
81 
84  void DoNotStoreMCHistograms() { fStoreMCHistograms = 0; }
87  void DoNotStorePrimSecHistograms() { fStorePrimSecHistograms = 0; }
90  void DoNotStoreZRHistograms() { fStoreZRHistograms = 0; }
91 
93  const TH1F* GetDecayResidual(const int iDecay, const int iParameter) const { return hFitQA[iDecay][iParameter]; }
95  const TH1F* GetDecayPull(const int iDecay, const int iParameter) const { return hFitQA[iDecay][iParameter+nFitQA/2]; }
96 
97 // efficiencies
98  KFPartEfficiencies fParteff;
99  KFPVEfficiencies fPVeff;
100  KFPVEfficiencies fPVeffMCReconstructable;
101 
102  protected:
103  TString outfileName;
104  TDirectory* histodir;
105 
106  int fNEvents;
107  bool fStoreMCHistograms;
108  bool fStorePrimSecHistograms;
109  bool fStoreZRHistograms;
110 
111 //histos
112  static const int nFitQA = 16;
113  TH1F *hFitDaughtersQA[KFPartEfficiencies::nParticles][nFitQA];
114  TH1F *hFitQA[KFPartEfficiencies::nParticles][nFitQA];
115  TH1F *hFitQANoConstraint[KFPartEfficiencies::nParticles][nFitQA];
116  TH1F *hFitQAMassConstraint[KFPartEfficiencies::nParticles][nFitQA];
117  TH1F *hFitQATopoConstraint[KFPartEfficiencies::nParticles][nFitQA];
118  TH1F *hFitQATopoMassConstraint[KFPartEfficiencies::nParticles][nFitQA];
119 
120  static const int nDSToParticleQA = 7;
121  TH1F *hDSToParticleQA[KFPartEfficiencies::nParticles][nDSToParticleQA];
122 
125  static const int nHistoPartParam = 18;
128  static const int nParametersSet = 7;
129  TH1F *hPartParam[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam];
130  TH1F *hPartParamPrimary[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam];
131  TH1F *hPartParamPrimaryMass[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam];
132  TH1F *hPartParamPrimaryTopo[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam];
133  TH1F *hPartParamPrimaryTopoMass[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam];
134  TH1F *hPartParamSecondary[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam];
135  TH1F *hPartParamSecondaryMass[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam];
136 
137  static const int nHistoPartParam2D = 4;
138  TH2F *hPartParam2D[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D];
139  TH2F *hPartParam2DPrimary[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D];
140  TH2F *hPartParam2DPrimaryMass[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D];
141  TH2F *hPartParam2DPrimaryTopo[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D];
142  TH2F *hPartParam2DPrimaryTopoMass[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D];
143  TH2F *hPartParam2DSecondary[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D];
144  TH2F *hPartParam2DSecondaryMass[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D];
145 
146  static const int nHistoPartParam3D = 6;
147  TH3F *hPartParam3D[1][KFPartEfficiencies::nParticles][nHistoPartParam3D];
148 
149  static const int nPartEfficiency = 9;
150  TProfile* hPartEfficiency[KFPartEfficiencies::nParticles][3][nPartEfficiency];
151  static const int nPartEfficiency2D = 2;
152  TProfile2D* hPartEfficiency2D[KFPartEfficiencies::nParticles][3][nPartEfficiency2D];
153 
154  static const int nHistosPV = 7;
155  TH1F *hPVFitQa[2][nHistosPV];
156  TH2F *hPVFitQa2D[2][2][nHistosPV-1];
157 
160  static const int nHistosPVParam = 15;
161  TH1F *hPVParam[nHistosPVParam];
162  TH1F *hPVParamGhost[nHistosPVParam];
163  TH1F *hPVParamSignal[nHistosPVParam];
164  TH1F *hPVParamPileup[nHistosPVParam];
165  TH1F *hPVParamBG[nHistosPVParam];
166  static const int nHistosPVParam2D = 1;
167  TH2F *hPVParam2D[nHistosPVParam2D];
168 
169  static const int nFitPVTracksQA = 12;
170  TH1F *hFitPVTracksQA[nFitPVTracksQA];
171 
172  static const int nHistosTP = KFPartEfficiencies::nParticles + 8;
173 
175  TH1F *hTrackParameters[nHistosTP];
176 
177  static const int nPVefficiency = 6;
178  TProfile* hPVefficiency[4][nPVefficiency];
179 
180  TDirectory *fHistoDir;
181 
182  bool IsCollectZRHistogram(int iParticle) const;
183  bool IsCollect3DHistogram(int iParticle) const;
184  bool IsCollectArmenteros(int iParticle) const;
185 
186  private:
187  const KFParticlePerformanceBase& operator = (const KFParticlePerformanceBase&);
188  KFParticlePerformanceBase(const KFParticlePerformanceBase&);
189 
190  void CreateFitHistograms(TH1F* histo[nFitQA], int iPart);
191  void CreateEfficiencyHistograms(TProfile* histo[3][nPartEfficiency], TProfile2D* histo2[3][nPartEfficiency2D]);
192  void CreateParameterHistograms(TH1F* histoParameters[KFPartEfficiencies::nParticles][nHistoPartParam],
193  TH2F *histoParameters2D[KFPartEfficiencies::nParticles][nHistoPartParam2D],
194  TH3F *histoParameters3D[KFPartEfficiencies::nParticles][nHistoPartParam3D],
195  int iPart, bool drawZR = 0);
196  void CreateParameterSubfolder(TString folderName,
197  TH1F* histoParameters[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam],
198  TH2F* histoParameters2D[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D],
199  TH1F* histoFit[KFPartEfficiencies::nParticles][nFitQA], int iPart, bool withWrongPVHypothesis = 0);
200 
201  TString GetDirectoryPath();
202 };
203 
204 #endif
205 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE