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
15
16// This class is developed in order to be used for extensive track selections. The selections are done detector wise
17//(or for detector combinations).
18// sources: https://github.com/AliceO2Group/AliceO2/blob/e988b0c43346ccb24f3515d1a24f058313f14a0f/DataFormats/Reconstruction/include/ReconstructionDataFormats/GlobalTrackID.h#L40
19//
20// !!! For further development:
21// The main method is isSelected(o2::dataformats::GlobalTrackID, o2::globaltracking::RecoContainer&), which is a boolean
22// that returns true only if all the checks are passed. First, based on the global track id, the track detector source is
23// inquired(e.g. below for ITS and TPC tracks). The source-specific tracks is initialized in order to access the
24// source-specific parameters than one wants to perform selections on.
25// For each detector source, the inquiry should be done in such way that “false” should be returned if the checks are not passed,
26// moving to the next detector source otherwise.
27// (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
28// are reproduced;
29// 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).
30
31#ifndef ALICEO2_TRACKCUTS_H
32#define ALICEO2_TRACKCUTS_H
33
34#include "Framework/Logger.h"
35#include "Framework/DataTypes.h"
44#include <set>
45#include <vector>
46#include "Rtypes.h"
47#include <gsl/span>
48namespace o2
49{
53{
54 public:
57 void setMinPtITSCut(float value) { mPtITSCut = value; }
58 void setEtaITSCut(float value) { mEtaITSCut = value; }
59 void setMinNClustersITS(int32_t value) { mMinNClustersITS = value; }
60 void setMaxChi2PerClusterITS(float value) { mMaxChi2PerClusterITS = value; }
61 void setRequireHitsInITSLayers(int8_t minNRequiredHits, std::set<uint8_t> requiredLayers)
62 {
63 mRequiredITSHits.push_back(std::make_pair(minNRequiredHits, requiredLayers));
64 LOG(info) << "Track selection, set require hits in ITS layers: " << static_cast<int>(minNRequiredHits);
65 }
67 void setMinPtTPCCut(float value) { mPtTPCCut = value; }
68 void setEtaTPCCut(float value) { mEtaTPCCut = value; }
69 void setMinNTPCClustersCut(int32_t value) { mNTPCClustersCut = value; }
70 void setMaxDCATPCCut(float value) { mDCATPCCut = value; }
71 void setMaxDCATPCCutY(float value) { mDCATPCCutY = value; }
73 void setMinPtCut(float value) { mMinPt = value; }
74 void setMaxPtCut(float value) { mMaxPt = value; }
75 void setEtaCut(float valueMin, float valueMax)
76 {
77 mMinEta = valueMin;
78 mMaxEta = valueMax;
79 }
80
83 {
85 auto contributorsGID = data.getSingleDetectorRefs(trackIndex);
86 auto src = trackIndex.getSource(); // make selections depending on track source
87 // ITS tracks
88 if (contributorsGID[GIndex::Source::ITS].isIndexSet()) { // ITS tracks selection
89 const auto& itsTrk = data.getITSTrack(contributorsGID[GID::ITS]);
90 int ITSnClusters = itsTrk.getNClusters();
91 float ITSchi2 = itsTrk.getChi2();
92 float itsChi2NCl = ITSnClusters != 0 ? ITSchi2 / (float)ITSnClusters : 0;
93 uint8_t itsClusterMap = itsTrk.getPattern();
94 if (itsTrk.getPt() <= mPtITSCut ||
95 std::abs(itsTrk.getEta()) > mEtaITSCut || // TODO: define 2 different values for min and max (**)
96 ITSnClusters <= mMinNClustersITS ||
97 itsChi2NCl >= mMaxChi2PerClusterITS ||
98 TrackMethods::FulfillsITSHitRequirements(itsClusterMap, mRequiredITSHits) == false) {
99 return false;
100 }
101 }
102 // TPC tracks
103 if (contributorsGID[GIndex::Source::TPC].isIndexSet()) {
104 const auto& tpcTrk = data.getTPCTrack(contributorsGID[GID::TPC]);
105 math_utils::Point3D<float> v{}; // vertex not defined?!
106 std::array<float, 2> dca;
107 if (tpcTrk.getPt() < mPtTPCCut || std::abs(tpcTrk.getEta()) > mEtaTPCCut || tpcTrk.getNClusters() < mNTPCClustersCut) { // TODO: define 2 different values for min and max (***)
108 return false;
109 }
110 o2::track::TrackPar trTmp(tpcTrk);
111 if (!trTmp.propagateParamToDCA(v, mBz, &dca, mDCATPCCut) || std::abs(dca[0]) > mDCATPCCutY || std::hypot(dca[0], dca[1]) > mDCATPCCut) {
112 return false;
113 }
114 }
115 // ITS-TPC matched cuts
116 // --> currently inactive in MatchITSTPCQC, since either GID::TPC or GID::ITS
120 src == o2::dataformats::GlobalTrackID::ITSTPCTRDTOF) { // track selection for barrel tracks (ITS-TPC matched)
121 trk = data.getTrackParam(trackIndex);
122 float trkEta = trk.getEta();
123 if (trk.getPt() < mMinPt || trk.getPt() > mMaxPt || trkEta < mMinEta || trkEta > mMaxEta) {
124 return false;
125 }
126 }
127 return true;
128 }
129
130 private:
133 float mPtITSCut = 0.f; // min pT for ITS track
134 float mEtaITSCut = 1e10f; // eta window for ITS track --> TODO: define 2 different values for min and max (**)
135 int mMinNClustersITS{0}; // min number of ITS clusters
136 float mMaxChi2PerClusterITS{1e10f}; // max its fit chi2 per ITS cluster
137 std::vector<std::pair<int8_t, std::set<uint8_t>>> mRequiredITSHits{}; // vector of ITS requirements (minNRequiredHits in specific requiredLayers)
139 float mPtTPCCut = 0.1f; // min pT for TPC track
140 float mEtaTPCCut = 1.4f; // eta window for TPC track --> TODO: define 2 different values for min and max (***)
141 int32_t mNTPCClustersCut = 60; // minimum number of TPC clusters for TPC track
142 float mDCATPCCut = 100.f; // max DCA 3D to PV for TPC track
143 float mDCATPCCutY = 10.f; // max DCA xy to PV for TPC track
144 // ITS+TPC track kinematics
145 float mMinPt{0.f}, mMaxPt{1e10f}; // range in pT
146 float mMinEta{-1e10f}, mMaxEta{1e10f}; // range in eta
147
148 float mBz = o2::base::Propagator::Instance()->getNominalBz();
149
150 ClassDefNV(TrackCuts, 2);
151};
152} // namespace o2
153
154#endif
Wrapper container for different reconstructed object types.
Base track model for the Barrel, params only, w/o covariance.
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 float
Class to store the output of the matching to TOF.
Extention of GlobalTrackID by flags relevant for verter-track association.
void setMinPtCut(float value)
ITS+TPC kinematics.
Definition TrackCuts.h:73
void setMinNClustersITS(int32_t value)
Definition TrackCuts.h:59
void setMinNTPCClustersCut(int32_t value)
Definition TrackCuts.h:69
bool isSelected(GID trackIndex, o2::globaltracking::RecoContainer &data)
Definition TrackCuts.h:82
void setMaxPtCut(float value)
Definition TrackCuts.h:74
void setEtaITSCut(float value)
Definition TrackCuts.h:58
void setMaxChi2PerClusterITS(float value)
Definition TrackCuts.h:60
void setEtaTPCCut(float value)
Definition TrackCuts.h:68
void setMaxDCATPCCut(float value)
Definition TrackCuts.h:70
void setMinPtITSCut(float value)
Definition TrackCuts.h:57
void setMinPtTPCCut(float value)
TPC.
Definition TrackCuts.h:67
void setEtaCut(float valueMin, float valueMax)
Definition TrackCuts.h:75
void setMaxDCATPCCutY(float value)
Definition TrackCuts.h:71
void setRequireHitsInITSLayers(int8_t minNRequiredHits, std::set< uint8_t > requiredLayers)
Definition TrackCuts.h:61
static bool FulfillsITSHitRequirements(uint8_t itsClusterMap, std::vector< std::pair< int8_t, std::set< uint8_t > > > mRequiredITSHits)
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
Definition Propagator.h:180
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"