-
Notifications
You must be signed in to change notification settings - Fork 652
Expand file tree
/
Copy pathtrackSelectionRequest.h
More file actions
166 lines (151 loc) · 5.82 KB
/
trackSelectionRequest.h
File metadata and controls
166 lines (151 loc) · 5.82 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// 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.
// This class serves to aggregate track selection criteria in a standardized
// configurable that can be queried at analysis time by any service that
// could pre-apply some of these selections. It also serves as an access point
// for these cuts in a local task, where these selections are also presumed
// to be applied for safety whenever operating with multiple analyses.
//
// Following a 'request-and-reply' logic, in a certain analysis topology, all
// requests from analysis tasks should be queried by service tasks and
// the actual selection should be based on a logical || of multiple requests.
// Because of this, it is particularly important that the cuts in this object
// in an analysis!
#ifndef TRACKSELECTIONREQUEST_H
#define TRACKSELECTIONREQUEST_H
#include <iosfwd>
#include <Rtypes.h>
#include <TMath.h>
class trackSelectionRequest
{
public:
trackSelectionRequest()
: trackPhysicsType{0}, minPt{0.0}, maxPt{1e+6}, minEta{-100}, maxEta{+100}, maxDCAz{1e+6}, maxDCAxyPtDep{1e+6}, requireTPC{false}, minTPCclusters{-1}, minTPCcrossedrows{-1}, minTPCcrossedrowsoverfindable{0.0}, requireITS{false}, minITSclusters{-1}, maxITSChi2percluster{1e+6}
{
// constructor
}
void setTrackPhysicsType(int trackPhysicsType_);
int getTrackPhysicsType() const;
void setMinPt(float minPt_);
int getMinPt() const;
void setMaxPt(float maxPt_);
int getMaxPt() const;
void setMinEta(float minEta_);
int getMinEta() const;
void setMaxEta(float maxEta_);
int getMaxEta() const;
void setMaxDCAz(float maxDCAz_);
int getMaxDCAz() const;
void setMaxDCAxyPtDep(float maxDCAxyPtDep_);
int getMaxDCAxyPtDep() const;
void setRequireTPC(bool requireTPC_);
bool getRequireTPC() const;
void setMinTPCClusters(int minTPCclusters_);
int getMinTPCClusters() const;
void setMinTPCCrossedRows(int minTPCCrossedRows_);
int getMinTPCCrossedRows() const;
void setMinTPCCrossedRowsOverFindable(float minTPCCrossedRowsOverFindable_);
int getMinTPCCrossedRowsOverFindable() const;
void setMaxTPCFractionSharedCls(float maxTPCFractionSharedCls_);
int getMaxTPCFractionSharedCls() const;
void setRequireITS(bool requireITS_);
bool getRequireITS() const;
void setMinITSClusters(int minITSclusters_);
int getMinITSClusters() const;
void setMaxITSChi2PerCluster(float maxITSChi2percluster_);
int getMaxITSChi2PerCluster() const;
// Calculate logical OR of selection criteria conveniently
void CombineWithLogicalOR(trackSelectionRequest const& lTraSelRe);
// Apply track selection checks (to be used in core services)
template <typename TTrack>
bool IsTrackSelected(TTrack const& lTrack)
{
// Selector that applies all selections
// Phase-space
if (lTrack.pt() < minPt)
return false;
if (lTrack.pt() > maxPt)
return false;
if (lTrack.eta() < minEta)
return false;
if (lTrack.eta() > maxEta)
return false;
// DCA to PV
if (fabs(lTrack.dcaXY()) < maxDCAz)
return false;
// TracksExtra-based
if (lTrack.hasTPC() == false && requireTPC)
return false; // FIXME this is a LO approximation
if (lTrack.tpcNClsFound() < minTPCclusters)
return false;
if (lTrack.tpcNClsCrossedRows() < minTPCcrossedrows)
return false;
if (lTrack.tpcCrossedRowsOverFindableCls() < minTPCcrossedrowsoverfindable)
return false;
if (lTrack.tpcFractionSharedCls() > maxTPCFractionSharedCls)
return false;
if (lTrack.hasITS() == false && requireITS)
return false;
if (lTrack.itsNCls() < minITSclusters)
return false;
if (lTrack.itsChi2NCl() < maxITSChi2percluster)
return false; // FIXME this is a LO approximation
return true;
}
template <typename TTrack>
bool IsTrackSelected_TrackExtraCriteria(TTrack const& lTrack)
{
// Selector that only applies TracksExtra columns selection
if (lTrack.hasTPC() == false && requireTPC)
return false; // FIXME this is a LO approximation
if (lTrack.tpcNClsFound() < minTPCclusters)
return false;
if (lTrack.tpcNClsCrossedRows() < minTPCcrossedrows)
return false;
if (lTrack.tpcCrossedRowsOverFindableCls() < minTPCcrossedrowsoverfindable)
return false;
if (lTrack.tpcFractionSharedCls() > maxTPCFractionSharedCls)
return false;
if (lTrack.hasITS() == false && requireITS)
return false;
if (lTrack.itsNCls() < minITSclusters)
return false;
if (lTrack.itsChi2NCl() < maxITSChi2percluster)
return false; // FIXME this is a LO approximation
return true;
}
void SetTightSelections();
// Helper to print out selections
void PrintSelections() const;
private:
int trackPhysicsType; // 0 - primary, 1 - secondary
// Phase space (Tracks or TracksIU)
float minPt;
float maxPt;
float minEta;
float maxEta;
// DCAs to primary vertex (use for primaries only)
float maxDCAz;
float maxDCAxyPtDep;
// TPC parameters (TracksExtra)
bool requireTPC; // in Run 3, equiv to hasTPC
int minTPCclusters;
int minTPCcrossedrows;
float minTPCcrossedrowsoverfindable;
float maxTPCFractionSharedCls;
// ITS parameters (TracksExtra)
bool requireITS; // in Run 3, equiv to hasITS
int minITSclusters;
float maxITSChi2percluster;
ClassDefNV(trackSelectionRequest, 3);
};
std::ostream& operator<<(std::ostream& os, trackSelectionRequest const& c);
#endif // TRACKSELECTIONREQUEST_H