-
Notifications
You must be signed in to change notification settings - Fork 510
Expand file tree
/
Copy pathPID.h
More file actions
130 lines (108 loc) · 4.51 KB
/
Copy pathPID.h
File metadata and controls
130 lines (108 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// @file PID.h
/// @author Thomas Klemenz, thomas.klemenz@tum.de
///
#ifndef AliceO2_TPC_QC_PID_H
#define AliceO2_TPC_QC_PID_H
#include <vector>
#include <unordered_map>
#include <memory>
#include <string_view>
// root includes
#include "TH1.h"
// Decapricated to be removed in next PR
#include "TCanvas.h"
// o2 includes
#include "DataFormatsTPC/Defs.h"
namespace o2
{
namespace tpc
{
class TrackTPC;
namespace qc
{
/// @brief PID quality control class
///
/// This class is used to extract PID related variables
/// from TrackTPC objects and store it in histograms.
///
/// origin: TPC
/// @author Thomas Klemenz, thomas.klemenz@tum.de
class PID
{
public:
/// \brief Constructor.
PID() = default;
/// bool extracts intormation from track and fills it to histograms
/// @return true if information can be extracted and filled to histograms
bool processTrack(const o2::tpc::TrackTPC& track, size_t nTracks);
// dummy version to make it compatible with old QC version
bool processTrack(const o2::tpc::TrackTPC& track);
/// Initialize all histograms
void initializeHistograms();
/// Reset all histograms
void resetHistograms();
/// Dump results to a file
void dumpToFile(std::string filename);
// To set the elementary track cuts
void setPIDCuts(int minnCls = 60, float absTgl = 1., float mindEdxTot = 10.0,
float maxdEdxTot = 70., float minpTPC = 0.05, float maxpTPC = 20., float minpTPCMIPs = 0.45, float maxpTPCMIPs = 0.55, bool turnOffHistosForAsync = false, bool getdEdxVspHypoHist = false)
{
mCutMinnCls = minnCls;
mCutAbsTgl = absTgl;
mCutMindEdxTot = mindEdxTot;
mCutMaxdEdxTot = maxdEdxTot;
mCutMinpTPC = minpTPC;
mCutMaxpTPC = maxpTPC;
mCutMinpTPCMIPs = minpTPCMIPs;
mCutMaxpTPCMIPs = maxpTPCMIPs;
mTurnOffHistosForAsync = turnOffHistosForAsync;
mGetdEdxVspHypoHist = getdEdxVspHypoHist;
}
// Decapricated to be removed in next PR
void setCreateCanvas(int createCanvas = 1)
{
mCreateCanvas = createCanvas;
}
std::unordered_map<std::string_view, std::vector<std::unique_ptr<TH1>>>& getMapOfHisto() { return mMapHist; }
const std::unordered_map<std::string_view, std::vector<std::unique_ptr<TH1>>>& getMapOfHisto() const { return mMapHist; }
// Decapricated to be removed in next PR
std::unordered_map<std::string_view, std::vector<std::unique_ptr<TCanvas>>>& getMapOfCanvas() { return mMapCanvas; }
TCanvas* getSeparationPowerCanvas() { return mSeparationPowerCanvas.get(); }
const std::unordered_map<std::string_view, std::vector<std::unique_ptr<TCanvas>>>& getMapOfCanvas() const { return mMapCanvas; }
private:
int mCutMinnCls = 60; // minimum N clusters
float mCutAbsTgl = 1.f; // AbsTgl max cut
float mCutMindEdxTot = 10.f; // dEdxTot min value
float mCutMaxdEdxTot = 70.f; // dEdxTot max value
float mCutMinpTPC = 0.05f; // pTPC min value
float mCutMaxpTPC = 20.f; // pTPC max value
float mCutMinpTPCMIPs = 0.45f; // pTPC min value for MIPs
float mCutMaxpTPCMIPs = 0.55f; // pTPC max value for MIPs
bool mTurnOffHistosForAsync = false; // Decide whether to turn off some histograms for async to reduce memory
bool mGetdEdxVspHypoHist = false; // Decide whether to generate the EdxVspHypo histograms
// Decapricated to be removed in next PR
bool mCreateCanvas = true; // Decide whether to create the TCanvas Object as it cannot be merged
std::unordered_map<std::string_view, std::vector<std::unique_ptr<TH1>>> mMapHist;
// Decapricated to be removed in next PR
// Map for Canvases to be published
std::unordered_map<std::string_view, std::vector<std::unique_ptr<TCanvas>>> mMapCanvas;
// Map for Histograms which will be put onto the canvases, and not published separately
std::unordered_map<std::string_view, std::vector<std::unique_ptr<TH1>>> mMapHistCanvas;
std::unique_ptr<TCanvas> mSeparationPowerCanvas;
ClassDefNV(PID, 1)
};
} // namespace qc
} // namespace tpc
} // namespace o2
#endif