Project
Loading...
Searching...
No Matches
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
85 std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() { return mMapHist; }
86 const std::unordered_map<std::string, std::unique_ptr<TH1>>& getMapHist() const { return mMapHist; }
87
88 private:
89 float mCutAbsEta = 1.f; // Eta cut
90 int mCutMinnCls = 60; // minimum N clusters
91 float mCutMindEdxTot = 20.f; // dEdxTot min value
92 float mCutMinPtDCAr = 1.5f; // minimum pT for DCAr plots DCAr vs. phi, eta, nCluster
93 float mSamplingFractionDCAr = 0.1f; // sampling rate for calculation of DCAr
94 bool mTurnOffHistosForAsync = false; // Decide whether to turn off some histograms for async to reduce memory
95 float mCutMaxAbsDCAr = 1.f; // maximum DCAr
96 bool mUseCutMaxAbsDCArOnHistos = false; // Decide whether to use the cut on maximum DCAr for the histograms
97
98 std::unordered_map<std::string, std::unique_ptr<TH1>> mMapHist;
99 std::vector<TH1F> mHist1D{};
100 std::vector<TH2F> mHist2D{};
101 std::vector<TH1F> mHistRatio1D{};
102
103 ClassDefNV(Tracks, 2)
104};
105} // namespace qc
106} // namespace tpc
107} // namespace o2
108
109#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:330
void dumpToFile(std::string_view filename)
Dump results to a file.
Definition Tracks.cxx:342
std::unordered_map< std::string, std::unique_ptr< TH1 > > & getMapHist()
get ratios of 1D histograms
Definition Tracks.h:85
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
const std::unordered_map< std::string, std::unique_ptr< TH1 > > & getMapHist() const
Definition Tracks.h:86
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()