Project
Loading...
Searching...
No Matches
TrackCuts.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
14
15// This class is developed in order to be used for extensive track selections. The selections are done detector wise
16//(or for detector combinations).
17// sources: https://github.com/AliceO2Group/AliceO2/blob/e988b0c43346ccb24f3515d1a24f058313f14a0f/DataFormats/Reconstruction/include/ReconstructionDataFormats/GlobalTrackID.h#L40
18//
19// !!! For further development:
20// The main method is isSelected(o2::dataformats::GlobalTrackID, o2::globaltracking::RecoContainer&), which is a boolean
21// that returns true only if all the checks are passed. First, based on the global track id, the track detector source is
22// inquired(e.g. below for ITS and TPC tracks). The source-specific tracks is initialized in order to access the
23// source-specific parameters than one wants to perform selections on.
24// For each detector source, the inquiry should be done in such way that “false” should be returned if the checks are not passed,
25// moving to the next detector source otherwise.
26// (e.g below for TPC tracks, where the track selections used here: https://github.com/AliceO2Group/AliceO2/blob/dev/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx#L318
27// are reproduced;
28// Moreover, an example of how this class should be used can be found here: https://github.com/AliceO2Group/AliceO2/blob/dev/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx#L184).
29
30#ifndef O2_TRACK_CUTS_STUDY_H
31#define O2_TRACK_CUTS_STUDY_H
32
33#include "Framework/Logger.h"
34#include "Framework/DataTypes.h"
43#include <set>
44#include <vector>
45#include "Rtypes.h"
46#include <gsl/span>
47namespace o2
48{
49namespace its
50{
51namespace study
52{
56{
57 public:
59 {
60 const auto& tpcTracks = data.getTPCTracks();
61 const auto& tpcClusRefs = data.getTPCTracksClusterRefs();
62 const auto& tpcClusShMap = data.clusterShMapTPC;
63 const auto& tpcClusAcc = data.getTPCClusters();
64 constexpr int maxRows = 152;
65 constexpr int neighbour = 2;
66 int ntr = tpcTracks.size();
67 mTPCCounters.clear();
68 mTPCCounters.resize(ntr);
69 for (int itr = 0; itr < ntr; itr++) {
70 std::array<bool, maxRows> clMap{}, shMap{};
71 uint8_t sectorIndex, rowIndex;
72 uint32_t clusterIndex;
73 auto& counters = mTPCCounters[itr];
74 const auto& track = tpcTracks[itr];
75 for (int i = 0; i < track.getNClusterReferences(); i++) {
76 o2::tpc::TrackTPC::getClusterReference(tpcClusRefs, i, sectorIndex, rowIndex, clusterIndex, track.getClusterRef());
77 unsigned int absoluteIndex = tpcClusAcc.clusterOffset[sectorIndex][rowIndex] + clusterIndex;
78 clMap[rowIndex] = true;
79 if (tpcClusShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) {
80 if (!shMap[rowIndex]) {
81 counters.shared++;
82 }
83 shMap[rowIndex] = true;
84 }
85 }
86 int last = -1;
87 for (int i = 0; i < maxRows; i++) {
88 if (clMap[i]) {
89 counters.crossed++;
90 counters.found++;
91 last = i;
92 } else if ((i - last) <= neighbour) {
93 counters.crossed++;
94 } else {
95 int lim = std::min(i + 1 + neighbour, maxRows);
96 for (int j = i + 1; j < lim; j++) {
97 if (clMap[j]) {
98 counters.crossed++;
99 break;
100 }
101 }
102 }
103 }
104 }
105 }
108 {
110 auto contributorsGID = data.getSingleDetectorRefs(trackIndex);
111 auto src = trackIndex.getSource(); // make selections depending on track source
112 // ITS tracks
113 if (contributorsGID[GIndex::Source::ITS].isIndexSet()) { // ITS tracks selection
114 isBarrelTrack = true;
115 const auto& itsTrk = data.getITSTrack(contributorsGID[GID::ITS]);
116 int ITSnClusters = itsTrk.getNClusters();
117 float ITSchi2 = itsTrk.getChi2();
118 float itsChi2NCl = ITSnClusters != 0 ? ITSchi2 / (float)ITSnClusters : 0;
119 uint8_t itsClusterMap = itsTrk.getPattern();
120 SetRequireHitsInITSLayers(1, {0, 1, 2});
121 if (itsChi2NCl >= mMaxChi2PerClusterITS ||
122 TrackMethods::FulfillsITSHitRequirements(itsClusterMap, mRequiredITSHits) == false) {
123 // LOGP(info,"FAILURE hits in ITS layers");
124 return false;
125 }
126 }
127 // TPC tracks
128 /* if (contributorsGID[GIndex::Source::TPC].isIndexSet()) {
129 LOGP(info, "****** INSIDE TPC ********");
130 //countTPCClusters(data);
131 isBarrelTrack = true;
132 const auto& tpcTrk = data.getTPCTrack(contributorsGID[GID::TPC]);
133 const auto& tpcClData = mTPCCounters[contributorsGID[GID::TPC]];
134 math_utils::Point3D<float> v{};
135 std::array<float, 2> dca;
136 int tpcNClsFindable = tpcTrk.getNClusters();
137 float tpcChi2NCl = tpcTrk.getNClusters() ? tpcTrk.getChi2() / tpcTrk.getNClusters() : 0;
138 double tpcNClsFindableMinusFound = tpcTrk.getNClusters() - tpcClData.found;
139 double tpcNClsFindableMinusCrossedRows = tpcTrk.getNClusters() - tpcClData.crossed;
140 float tpcNClsCrossedRows = (float)((int16_t)tpcNClsFindable - tpcNClsFindableMinusCrossedRows)/tpcNClsFindable;
141 float tpcCrossedRowsOverFindableCl = (float)tpcNClsCrossedRows / (float)tpcNClsFindable;
142 if(tpcCrossedRowsOverFindableCl < 0.8) {
143 LOGP(info,"FAILURE tpcCrossedRowsOverFindableCl");
144 return false;
145 }
146 if(tpcClData.crossed < 70){
147 LOGP(info,"FAILURE crossed");
148 return false;
149 }
150 if(tpcChi2NCl >= mMaxChi2PerClusterTPC){
151 LOGP(info,"FAILURE tpcChi2NCl");
152 return false;
153 }
154 } */
155 if (isBarrelTrack) { // track selection for barrel tracks
156 trk = data.getTrackParam(trackIndex);
157 if (trk.getPt() < mMinPt && trk.getPt() > mMaxPt && trk.getEta() < mMinEta && trk.getEta() > mMaxEta) {
158 return false;
159 }
160 }
161 return true;
162 }
163
164 void SetRequireHitsInITSLayers(int8_t minNRequiredHits, std::set<uint8_t> requiredLayers)
165 {
166 // layer 0 corresponds to the the innermost ITS layer
167 mRequiredITSHits.push_back(std::make_pair(minNRequiredHits, requiredLayers));
168 // LOG(info) << "Track selection, set require hits in ITS layers: " << static_cast<int>(minNRequiredHits);
169 }
170
171 private:
172 // counters for TPC clusters
173 struct TPCCounters {
174 uint8_t shared = 0;
175 uint8_t found = 0;
176 uint8_t crossed = 0;
177 };
178 std::vector<TPCCounters> mTPCCounters;
179
180 bool isBarrelTrack = true; // all barrel tracks must have either ITS or TPC contribution -> true if ITS || TPC track source condition is passed
181 // cut values
182 float mPtTPCCut = 0.1f;
183 float mEtaTPCCut = 1.4f;
184 int32_t mNTPCClustersCut = 60;
185 float mDCACut = 100.f;
186 float mDCACutY = 10.f;
187 // kinematic cuts
188 float mMinPt{0.1f}, mMaxPt{1e10f}; // range in pT
189 float mMinEta{0.8}, mMaxEta{0.8}; // range in eta
190 float mBz = o2::base::Propagator::Instance()->getNominalBz();
191
192 float mMaxChi2PerClusterITS{36.0}; // max its fit chi2 per ITS cluster
193 float mMaxChi2PerClusterTPC{4.0}; // max its fit chi2 per ITS cluster
194 int mMinNClustersITS{0}; // min number of ITS clusters
195
196 // vector of ITS requirements (minNRequiredHits in specific requiredLayers)
197 int8_t minNRequiredHits = 1;
198 std::set<uint8_t> requiredLayers{0, 1, 2}; // one hit in the first three layers
199 std::vector<std::pair<int8_t, std::set<uint8_t>>> mRequiredITSHits{};
200
201 ClassDefNV(TrackCuts, 1);
202};
203} // namespace study
204} // namespace its
205} // namespace o2
206
207#endif
Wrapper container for different reconstructed object types.
Base track model for the Barrel, params only, w/o covariance.
int32_t i
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if shared
configStandalone Reconstruction rec_tpc float
Class to store the output of the matching to TOF.
uint32_t j
Definition RawData.h:0
Extention of GlobalTrackID by flags relevant for verter-track association.
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
Definition Propagator.h:180
void SetRequireHitsInITSLayers(int8_t minNRequiredHits, std::set< uint8_t > requiredLayers)
Definition TrackCuts.h:164
bool isSelected(GID trackIndex, o2::globaltracking::RecoContainer &data)
Definition TrackCuts.h:107
void countTPCClusters(const o2::globaltracking::RecoContainer &data)
Definition TrackCuts.h:58
static bool FulfillsITSHitRequirements(uint8_t itsClusterMap, std::vector< std::pair< int8_t, std::set< uint8_t > > > mRequiredITSHits)
GLint GLint GLsizei GLuint * counters
Definition glcorearb.h:3985
const bool const int TrackITSInternal< NLayers > & track
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...