Project
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Tracks.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#ifndef AliceO2_TPC_QC_TRACKS_H
18#define AliceO2_TPC_QC_TRACKS_H
19
20#include <vector>
21#include <string_view>
22#include <string>
23#include <unordered_map>
24#include <memory>
25
26// root includes
27#include "TH1.h"
28#include "TH1F.h"
29#include "TH2F.h"
30
31namespace o2
32{
33namespace tpc
34{
35
36class TrackTPC;
37
38namespace qc
39{
40
48class Tracks
49{
50 public:
51 // default constructor
52 Tracks() = default;
53
56 bool processTrack(const o2::tpc::TrackTPC& track);
57
60
62 void resetHistograms();
63
65 void processEndOfCycle();
66
68 void dumpToFile(std::string_view filename);
69
70 // To set the elementary track cuts
71 void setTrackCuts(float AbsEta = 1.,
72 int nClusterCut = 60, float dEdxTot = 20, float cutPtForDCAr = 1.5, float samplingFractionDCAr = 0.1, bool turnOffHistosForAsync = false, float cutMaxAbsDCAr = 0.1, bool useCutMaxAbsDCArOnHistos = false)
73 {
74 mCutAbsEta = AbsEta;
75 mCutMinnCls = nClusterCut;
76 mCutMindEdxTot = dEdxTot;
77 mCutMinPtDCAr = cutPtForDCAr;
78 mSamplingFractionDCAr = samplingFractionDCAr;
79 mTurnOffHistosForAsync = turnOffHistosForAsync;
80 mCutMaxAbsDCAr = cutMaxAbsDCAr;
81 mUseCutMaxAbsDCArOnHistos = useCutMaxAbsDCArOnHistos;
82 }
83
84 // Set PV position
86 {
87 mPositionOfPV = meanVtxPoint3D;
88 }
89
91 std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() { return mMapHist; }
92 const std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() const { return mMapHist; }
93
94 private:
95 float mCutAbsEta = 1.f; // Eta cut
96 int mCutMinnCls = 60; // minimum N clusters
97 float mCutMindEdxTot = 20.f; // dEdxTot min value
98 float mCutMinPtDCAr = 1.5f; // minimum pT for DCAr plots DCAr vs. phi, eta, nCluster
99 float mSamplingFractionDCAr = 0.1f; // sampling rate for calculation of DCAr
100 bool mTurnOffHistosForAsync = false; // Decide whether to turn off some histograms for async to reduce memory
101 float mCutMaxAbsDCAr = 1.f; // maximum DCAr
102 bool mUseCutMaxAbsDCArOnHistos = false; // Decide whether to use the cut on maximum DCAr for the histograms
103 o2::math_utils::Point3D<float> mPositionOfPV{}; // Position of the PV
104
105 std::unordered_map<std::string, std::unique_ptr<TH1>> mMapHist;
106 std::vector<TH1F> mHist1D{};
107 std::vector<TH2F> mHist2D{};
108 std::vector<TH1F> mHistRatio1D{};
109
110 ClassDefNV(Tracks, 2)
111};
112} // namespace qc
113} // namespace tpc
114} // namespace o2
115
116#endif
Tracks quality control class.
Definition Tracks.h:49
void initializeHistograms()
Initialize all histograms.
Definition Tracks.cxx:45
void processEndOfCycle()
Function to be called at each endOfCycle.
Definition Tracks.cxx:329
void dumpToFile(std::string_view filename)
Dump results to a file.
Definition Tracks.cxx:341
std::unordered_map< std::string, std::unique_ptr< TH1 > > & getMapHist()
get ratios of 1D histograms
Definition Tracks.h:91
void setTrackCuts(float AbsEta=1., int nClusterCut=60, float dEdxTot=20, float cutPtForDCAr=1.5, float samplingFractionDCAr=0.1, bool turnOffHistosForAsync=false, float cutMaxAbsDCAr=0.1, bool useCutMaxAbsDCArOnHistos=false)
Definition Tracks.h:71
bool processTrack(const o2::tpc::TrackTPC &track)
Definition Tracks.cxx:123
void resetHistograms()
Reset all histograms.
Definition Tracks.cxx:116
void setPVposition(const o2::math_utils::Point3D< float > meanVtxPoint3D)
Definition Tracks.h:85
const std::unordered_map< std::string, std::unique_ptr< TH1 > > & getMapHist() const
Definition Tracks.h:92
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()