Project
Loading...
Searching...
No Matches
CalculatedEdx.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_CalculatedEdx_H
18#define AliceO2_TPC_CalculatedEdx_H
19
20// o2 includes
25#include "TPCBase/Mapper.h"
26#include "GPUO2InterfaceRefit.h"
27#include "CalibdEdxContainer.h"
31#include "TPCFastTransformPOD.h"
32#include "GPUCommonRtypes.h"
34#include <array>
35#include <vector>
36#include <map>
37#include <set>
38#include <unordered_map>
39#include <string>
40#include <utility>
41
42namespace o2::gpu
43{
44class TPCFastTransform;
45}
46
47namespace o2::tpc
48{
49
52 double IROC = 0.;
53 double OROC1 = 0.;
54 double OROC2 = 0.;
55 double OROC3 = 0.;
57};
58
76
77enum class CorrectionFlags : unsigned short {
78 None = 0,
79 TopologySimple = 1 << 0,
80 TopologyPol = 1 << 1,
81 GainFull = 1 << 2,
82 GainResidual = 1 << 3,
83 dEdxResidual = 1 << 4,
84 dEdxSC = 1 << 5,
85};
86
87enum class ClusterFlags : unsigned short {
88 None = 0,
89 ExcludeSingleCl = 1 << 0,
90 ExcludeSplitPadCl = 1 << 1,
91 ExcludeSplitTimeCl = 1 << 2,
92 ExcludeSplitCl = 1 << 3,
93 ExcludeEdgeCl = 1 << 4,
94 ExcludeSubthresholdCl = 1 << 5,
96 ExcludeSharedCl = 1 << 7,
97 ExcludeSamePadRowCl = 1 << 8,
98};
99
100inline CorrectionFlags operator&(CorrectionFlags a, CorrectionFlags b) { return static_cast<CorrectionFlags>(static_cast<unsigned short>(a) & static_cast<unsigned short>(b)); }
101inline CorrectionFlags operator~(CorrectionFlags a) { return static_cast<CorrectionFlags>(~static_cast<unsigned short>(a)); }
102inline CorrectionFlags operator|(CorrectionFlags a, CorrectionFlags b) { return static_cast<CorrectionFlags>(static_cast<unsigned short>(a) | static_cast<unsigned short>(b)); }
103
104inline ClusterFlags operator&(ClusterFlags a, ClusterFlags b) { return static_cast<ClusterFlags>(static_cast<unsigned short>(a) & static_cast<unsigned short>(b)); }
105inline ClusterFlags operator~(ClusterFlags a) { return static_cast<ClusterFlags>(~static_cast<unsigned short>(a)); }
106inline ClusterFlags operator|(ClusterFlags a, ClusterFlags b) { return static_cast<ClusterFlags>(static_cast<unsigned short>(a) | static_cast<unsigned short>(b)); }
107
114 unsigned short subthresholdMethod = 0;
115 unsigned short stackBoundaryMethod = 0;
116 unsigned short sameRowClusterMethod = 2;
117 float maxSubthresholdChargeTot = 100000.f;
118 float maxSubthresholdChargeMax = 100000.f;
119 float low = 2.f / 128.f;
120 float high = 77.f / 128.f;
121 std::string debugRootFile = "dEdxDebug.root";
122};
123
126struct ClInfo {
127 unsigned char sectorIndex = 0;
128 unsigned char rowIndex = 0;
129 bool isShared = false;
130};
131
132using ClInfoVec = std::vector<ClInfo>;
133
135{
136 public:
138
139 ~CalculatedEdx() = default;
140
145 void setMembers(std::vector<o2::tpc::TPCClRefElem>* tpcTrackClIdxVecInput, const o2::tpc::ClusterNativeAccess& clIndex, std::vector<o2::tpc::TrackTPC>* vTPCTracksArrayInp);
146
148 void setRefit(const unsigned int nHbfPerTf = 32);
149
154 void setTPCCorrMap(const o2::gpu::TPCFastTransform& corrMap, const o2::gpu::TPCFastTransform* corrMapRef = nullptr, float lumiScale = -1.f);
155
159
161 void setPropagateTrack(const bool propagate) { mPropagateTrack = propagate; }
162
164 void setPropagateParams(const bool propagate) { mPropagateParams = propagate; }
165
167 void setPropagateToClusterX(const bool propagate) { mPropagateToClusterX = propagate; }
168
170 void setDebug(const bool debug) { mDebug = debug; }
171
173 void setFieldNominalGPUBz(const float field) { mFieldNominalGPUBz = field; }
174
176 void setMaxMissingCl(int maxMissingCl) { mMaxMissingCl = maxMissingCl; }
177
179 // set to 0 to fill every 1-row gap regardless of its position on the track
180 void setSubThreshEdgeRows(int n) { mSubThreshEdgeRows = n; }
181
183 void setSameRowMaxPadDiff(float d) { mSameRowMaxPadDiff = d; }
184
186 void setSameRowMaxTimeDiff(float d) { mSameRowMaxTimeDiff = d; }
187
190 void setStreamer(const char* debugRootFile)
191 {
192 auto& streamer = mStreamers[debugRootFile];
193 if (!streamer) {
194 streamer = std::make_unique<o2::utils::TreeStreamRedirector>(debugRootFile, "recreate");
195 }
196 };
197
199 void setSCStreamer(const char* debugRootFile = "debug_sc_corrections.root") { mSCdEdxCorrection.setStreamer(debugRootFile); }
200
202 void setLumi(const float lumi) { mSCdEdxCorrection.setLumi(lumi); }
203
205 float getFieldNominalGPUBz() { return mFieldNominalGPUBz; }
206
208 int getMaxMissingCl() { return mMaxMissingCl; }
209
211 int getSubThreshEdgeRows() const { return mSubThreshEdgeRows; }
212
214 float getSameRowMaxPadDiff() const { return mSameRowMaxPadDiff; }
215
217 float getSameRowMaxTimeDiff() const { return mSameRowMaxTimeDiff; }
218
220 long getNPropagationFailed() const { return mNPropagationFailed; }
221
223 long getNRefitFallback() const { return mNRefitFallback; }
224
226 long getNRowsProcessed() const { return mNRowsProcessed; }
227
229 const std::vector<long>& getNSubThresholdFilledPerSettings() const { return mNSubThresholdFilledPerSettings; }
230
233 {
234 mNPropagationFailed = 0;
235 mNRefitFallback = 0;
236 mNRowsProcessed = 0;
237 mNSubThresholdFilledPerSettings.clear();
238 }
239
244 void fillMissingClusters(int missingClusters[4], const float minChargeTot[4], const float minChargeMax[4], int method, std::array<std::vector<float>, 5>& chargeTotROC, std::array<std::vector<float>, 5>& chargeMaxROC);
245
248 void handleSameRowClusters(o2::tpc::TrackTPC& track, std::vector<std::pair<unsigned char, unsigned char>>& rowOrder, std::map<std::pair<unsigned char, unsigned char>, std::vector<int>>& clustersByRow, std::set<std::pair<unsigned char, unsigned char>>& mergeableRows, std::map<int, std::tuple<unsigned char, unsigned char, unsigned int>>& clusterReferencesByIndex);
249
253 void handleSameRowClusters(const std::vector<o2::tpc::ClusterNative>& clusters, const ClInfoVec& clusterInfos, std::vector<std::pair<unsigned char, unsigned char>>& rowOrder, std::map<std::pair<unsigned char, unsigned char>, std::vector<int>>& clustersByRow, std::set<std::pair<unsigned char, unsigned char>>& mergeableRows);
254
267 void calculatedEdx(TrackTPC& track, dEdxInfo& output, AverageOccupancy& averageOcc, float low = 2.f / 128.f, float high = 77.f / 128.f, CorrectionFlags correctionMask = CorrectionFlags::TopologyPol | CorrectionFlags::dEdxResidual, ClusterFlags clusterMask = ClusterFlags::None, int subthresholdMethod = 0, int stackBoundaryMethod = 0, const char* debugRootFile = "dEdxDebug.root", float maxSubthresholdChargeTot = 100000.f, float maxSubthresholdChargeMax = 100000.f, int sameRowClusterMethod = 2);
268
275 void calculatedEdxMultipleSettings(TrackTPC& track, std::vector<dEdxInfo>& outputs, AverageOccupancy& averageOcc, const std::vector<dEdxSettings>& settingsList, const MCCompLabel* mcLabel = nullptr);
276
281 void calculatedEdx(TrackTPC& track, const std::vector<o2::tpc::ClusterNative>& clusters, const ClInfoVec& clusterInfos, dEdxInfo& output, AverageOccupancy& averageOcc, float low = 2.f / 128.f, float high = 77.f / 128.f, CorrectionFlags correctionMask = CorrectionFlags::TopologyPol | CorrectionFlags::dEdxResidual, ClusterFlags clusterMask = ClusterFlags::None, int subthresholdMethod = 0, int stackBoundaryMethod = 0, const char* debugRootFile = "dEdxDebug.root", float maxSubthresholdChargeTot = 100000.f, float maxSubthresholdChargeMax = 100000.f, int sameRowClusterMethod = 2);
282
287 void calculatedEdxMultipleSettings(TrackTPC& track, const std::vector<o2::tpc::ClusterNative>& clusters, const ClInfoVec& clusterInfos, std::vector<dEdxInfo>& outputs, AverageOccupancy& averageOcc, const std::vector<dEdxSettings>& settingsList, const MCCompLabel* mcLabel = nullptr);
288
293 float getTruncMean(std::vector<float>& charge, float low, float high) const;
294
299 float getTrackTopologyCorrection(const o2::tpc::TrackTPC& track, const unsigned int region) const;
300
310 float getTrackTopologyCorrectionPol(const o2::tpc::TrackTPC& track, const o2::tpc::ClusterNative& cl, const unsigned int region, const float charge, ChargeType chargeType, const float threshold) const;
311
313 auto& getSCCorrection() { return mSCdEdxCorrection; }
314
316 unsigned int getOccupancy(float clTime) const;
317
319 bool isInStackBoundaries(int stackNumber, unsigned char rowIndex, int stackBoundaryMethod);
320
328 void loadCalibsFromCCDB(long runNumberOrTimeStamp, const bool isMC = false, const bool loadSCCorrMap = true, const bool useSCCorrMap = true, const bool useVDrift = true, const float corrMapLumiScale = -1.f);
329
332 float getTPCScalerLumiScale(long timeStamp, float meanIDC) const;
333
338 void loadCalibsFromLocalCCDBFolder(const char* localCCDBFolder, const bool useSCCorrMap = true, const bool useVDrift = true);
339
344 void setTrackTopologyCorrectionFromFile(const char* folder, const char* file, const char* object);
345
350 void setGainMapFromFile(const char* folder, const char* file, const char* object);
351
356 void setGainMapResidualFromFile(const char* folder, const char* file, const char* object);
357
362 void setResidualCorrectionFromFile(const char* folder, const char* file, const char* object);
363
368 void setZeroSuppressionThresholdFromFile(const char* folder, const char* file, const char* object);
369
374 void setMagneticFieldFromFile(const char* folder, const char* file, const char* object);
375
380 void setPropagatorFromFile(const char* folder, const char* file, const char* object);
381
383 void setTPCCorrMapFromFile(const char* folder, const char* file, const char* object);
384
386 void setVDriftFromFile(const char* folder, const char* file, const char* object);
387
388 private:
394 struct RowFragment {
396 unsigned char pad;
397 float threshold;
398 float gain;
399 float gainResidual;
400 unsigned int occupancy;
401 bool isShared;
402 };
403
405 static const RowFragment& pickDominantFragment(const std::vector<RowFragment>& fragments);
406
408 struct RowClusterData {
409 std::vector<RowFragment> fragments;
410 bool mergeable;
411 RowFragment mergedFragment{};
412 o2::tpc::TrackTPC trackSnapshot;
413 unsigned char sectorIndex;
414 unsigned char rowIndex;
415 unsigned int region;
417 int stackNumber;
418 StackID stackID;
419 bool propagationFailed;
420 bool refitFellBack;
421 int missingClusters;
422 std::array<int, 4> missingClustersStack{};
423 bool sameSectorAsPrevRow;
424 bool missingClusterGapDeadOrEdge;
425 std::vector<int> inputClusterIndices;
426 };
427
432 void gatherRowClusterData(o2::tpc::TrackTPC& track, std::vector<RowClusterData>& rowData, AverageOccupancy& averageOcc);
433
440 void gatherRowClusterData(o2::tpc::TrackTPC& track, const std::vector<o2::tpc::ClusterNative>& clusters, const ClInfoVec& clusterInfos, std::vector<RowClusterData>& rowData, AverageOccupancy& averageOcc);
441
455 void gatherRowClusterDataForRow(o2::tpc::TrackTPC& track, const std::vector<o2::tpc::ClusterNative>& fragmentClusters, const std::vector<bool>& fragmentIsShared, unsigned char sectorIndex, unsigned char rowIndex, bool mergeable, unsigned char rowIndexOld, unsigned char sectorIndexOld, std::array<std::vector<unsigned int>, 4>& occupancyROC, std::vector<RowClusterData>& rowData, bool refitFailed);
456
460 bool refitTrack(o2::tpc::TrackTPC& track);
461
464 bool refitTrack(o2::tpc::TrackTPC& track, const std::vector<o2::tpc::ClusterNative>& clusters, const ClInfoVec& clusterInfos);
465
468 bool propagateTrackToX(o2::track::TrackParCov& track, float xPosition, unsigned char sectorIndex) const;
469
471 void rebuildTPCCorrMapPOD();
472
482 void calculatedEdxFromRowData(const std::vector<RowClusterData>& rowData, const dEdxSettings& settings, size_t settingsIndex, float trackTime0, const o2::tpc::TrackTPC& trackOrig, const AverageOccupancy& averageOcc, dEdxInfo& output, const MCCompLabel* mcLabel = nullptr);
483
484 std::vector<TrackTPC>* mTracks{nullptr};
485 std::vector<TPCClRefElem>* mTPCTrackClIdxVecInput{nullptr};
486 const o2::tpc::ClusterNativeAccess* mClusterIndex{nullptr};
487 const o2::gpu::TPCFastTransformPOD* mTPCCorrMap{nullptr};
489 std::unique_ptr<o2::gpu::TPCFastTransform> mTPCCorrMapFull;
490 std::vector<unsigned char> mTPCRefitterShMap;
491 std::vector<unsigned int> mTPCRefitterOccMap;
492 std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mRefit{nullptr};
493 std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mRefitExt{nullptr};
494 std::unique_ptr<o2::tpc::ClusterNativeAccess> mExtClusterAccess{nullptr};
495 std::vector<o2::tpc::ClusterNative> mExtClusters;
496 std::vector<o2::tpc::TPCClRefElem> mExtClusterRefs;
497 std::vector<unsigned char> mExtShMap;
498 bool mUseRefit{false};
499 unsigned int mNHbfPerTf{32};
500
501 int mMaxMissingCl{1};
502 int mSubThreshEdgeRows{30};
503 float mSameRowMaxPadDiff{3.f};
504 float mSameRowMaxTimeDiff{4.f};
505 float mFieldNominalGPUBz{5};
506 bool mPropagateTrack{false};
507 bool mPropagateParams{false};
508 bool mPropagateToClusterX{true};
509 bool mDebug{false};
510 CalibdEdxContainer mCalibCont;
511 std::unordered_map<std::string, std::unique_ptr<o2::utils::TreeStreamRedirector>> mStreamers;
512 long mDebugTrackIndex{-1};
513 bool mWarnedMissingRefit{false};
514 long mNPropagationFailed{0};
515 long mNRefitFallback{0};
516 long mNRowsProcessed{0};
517 std::vector<long> mNSubThresholdFilledPerSettings;
518
519 CorrectdEdxDistortions mSCdEdxCorrection;
520
521 std::array<std::vector<unsigned char>, 4> mStackBoundaries = {{{0, 62}, {63, 96}, {97, 126}, {127, 151}}}; // for excluding stack boundaries in dEdx calculation
522};
523
524} // namespace o2::tpc
525
526#endif
Definition of container class for dE/dx corrections.
Class of a TPC cluster in TPC-native coordinates (row, time)
Helper class to access correction maps.
std::ostringstream debug
int16_t charge
Definition RawEventData.h:5
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
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 Print launch bounds used for RTC code as debugging for exit after Allow RTC with slave GPUReconstruction instances with optConstexpr and optSpecialcode Maximum number of RTC cache files per backend in the cache folder
configStandalone Reconstruction settings
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
uint32_t stack
Definition RawData.h:1
POD correction map.
calibration data from laser track calibration
void setSubThreshEdgeRows(int n)
void setPropagateToClusterX(const bool propagate)
void loadCalibsFromCCDB(long runNumberOrTimeStamp, const bool isMC=false, const bool loadSCCorrMap=true, const bool useSCCorrMap=true, const bool useVDrift=true, const float corrMapLumiScale=-1.f)
void setFieldNominalGPUBz(const float field)
void setPropagateParams(const bool propagate)
void setSameRowMaxPadDiff(float d)
void setVDriftFromFile(const char *folder, const char *file, const char *object)
load the drift-velocity calibration (VDriftCorrFact) from a local file and rebuild mTPCCorrMap
const std::vector< long > & getNSubThresholdFilledPerSettings() const
long getNPropagationFailed() const
void calculatedEdx(TrackTPC &track, dEdxInfo &output, AverageOccupancy &averageOcc, float low=2.f/128.f, float high=77.f/128.f, CorrectionFlags correctionMask=CorrectionFlags::TopologyPol|CorrectionFlags::dEdxResidual, ClusterFlags clusterMask=ClusterFlags::None, int subthresholdMethod=0, int stackBoundaryMethod=0, const char *debugRootFile="dEdxDebug.root", float maxSubthresholdChargeTot=100000.f, float maxSubthresholdChargeMax=100000.f, int sameRowClusterMethod=2)
void setTPCCorrMap(const o2::gpu::TPCFastTransform &corrMap, const o2::gpu::TPCFastTransform *corrMapRef=nullptr, float lumiScale=-1.f)
void setTrackTopologyCorrectionFromFile(const char *folder, const char *file, const char *object)
void setZeroSuppressionThresholdFromFile(const char *folder, const char *file, const char *object)
void setMaxMissingCl(int maxMissingCl)
void setPropagatorFromFile(const char *folder, const char *file, const char *object)
unsigned int getOccupancy(float clTime) const
void setRefit(const unsigned int nHbfPerTf=32)
set the refitter
float getTrackTopologyCorrectionPol(const o2::tpc::TrackTPC &track, const o2::tpc::ClusterNative &cl, const unsigned int region, const float charge, ChargeType chargeType, const float threshold) const
void calculatedEdxMultipleSettings(TrackTPC &track, std::vector< dEdxInfo > &outputs, AverageOccupancy &averageOcc, const std::vector< dEdxSettings > &settingsList, const MCCompLabel *mcLabel=nullptr)
float getTPCScalerLumiScale(long timeStamp, float meanIDC) const
void setMembers(std::vector< o2::tpc::TPCClRefElem > *tpcTrackClIdxVecInput, const o2::tpc::ClusterNativeAccess &clIndex, std::vector< o2::tpc::TrackTPC > *vTPCTracksArrayInp)
void setPropagateTrack(const bool propagate)
void setLumi(const float lumi)
float getSameRowMaxTimeDiff() const
float getSameRowMaxPadDiff() const
void setTPCCorrMapFromFile(const char *folder, const char *file, const char *object)
load the space-charge correction map for the cluster transform from a local file; without the file,...
long getNRowsProcessed() const
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
void loadCalibsFromLocalCCDBFolder(const char *localCCDBFolder, const bool useSCCorrMap=true, const bool useVDrift=true)
void fillMissingClusters(int missingClusters[4], const float minChargeTot[4], const float minChargeMax[4], int method, std::array< std::vector< float >, 5 > &chargeTotROC, std::array< std::vector< float >, 5 > &chargeMaxROC)
float getTruncMean(std::vector< float > &charge, float low, float high) const
void setSameRowMaxTimeDiff(float d)
void setResidualCorrectionFromFile(const char *folder, const char *file, const char *object)
float getTrackTopologyCorrection(const o2::tpc::TrackTPC &track, const unsigned int region) const
bool isInStackBoundaries(int stackNumber, unsigned char rowIndex, int stackBoundaryMethod)
void handleSameRowClusters(o2::tpc::TrackTPC &track, std::vector< std::pair< unsigned char, unsigned char > > &rowOrder, std::map< std::pair< unsigned char, unsigned char >, std::vector< int > > &clustersByRow, std::set< std::pair< unsigned char, unsigned char > > &mergeableRows, std::map< int, std::tuple< unsigned char, unsigned char, unsigned int > > &clusterReferencesByIndex)
void setSCStreamer(const char *debugRootFile="debug_sc_corrections.root")
set the debug streamer of the space-charge dedx correction
void setMagneticFieldFromFile(const char *folder, const char *file, const char *object)
void setGainMapResidualFromFile(const char *folder, const char *file, const char *object)
void setStreamer(const char *debugRootFile)
long getNRefitFallback() const
void setGainMapFromFile(const char *folder, const char *file, const char *object)
void setDebug(const bool debug)
void resetDebugCounters()
reset the running counters returned by getNPropagationFailed()/getNRefitFallback()/getNRowsProcessed(...
int getSubThreshEdgeRows() const
void setStreamer(const char *debugRootFile="debug_sc_corrections.root")
enable the debug streamer
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
Global TPC definitions and constants.
GEMstack
TPC GEM stack types.
Definition Defs.h:55
@ ExcludeSingleCl
flag to exclude single clusters in dEdx calculation
@ ExcludeSubthresholdCl
flag to exclude subthreshold clusters in dEdx calculation
@ ExcludeSplitPadCl
flag to exclude split pad clusters in dEdx calculation
@ ExcludeEdgeCl
flag to exclude sector edge clusters in dEdx calculation
@ ExcludeSectorBoundaries
flag to exclude sector boundary clusters in subthreshold cluster treatment
@ ExcludeSplitCl
flag to exclude split pad or time clusters in dEdx calculation
@ ExcludeSplitTimeCl
flag to exclude split time clusters in dEdx calculation
@ ExcludeSamePadRowCl
flag to exclude clusters in the same pad row in dEdx calculation
@ ExcludeSharedCl
flag to exclude clusters shared between tracks in dEdx calculation
ChargeType
Definition Defs.h:72
SourcesDeadMap operator|(SourcesDeadMap a, SourcesDeadMap b)
SourcesDeadMap operator&(SourcesDeadMap a, SourcesDeadMap b)
SourcesDeadMap operator~(SourcesDeadMap a)
std::vector< ClInfo > ClInfoVec
CorrectionFlags
dEdx calculation class
@ TopologyPol
flag for topology correction from polynomials
@ TopologySimple
flag for simple analytical topology correction
@ dEdxResidual
flag for residual dEdx correction
@ dEdxSC
flag for space-charge dEdx correction
@ GainFull
flag for full gain map from calibration container
@ GainResidual
flag for residuals gain map from calibration container
TrackParCovF TrackParCov
Definition Track.h:33
Marks an empty item in the context.
average cluster occupancy of a track, per TPC region
ClassDefNV(AverageOccupancy, 1)
per-cluster info needed by the calculatedEdx()/calculatedEdxMultipleSettings() overloads that take cl...
unsigned char sectorIndex
unsigned char rowIndex
bundles the settings of one calculatedEdx() call (everything except the track/output/averageOcc) used...
float maxSubthresholdChargeMax
upper limit for the per-region minimum qMax used as the virtual charge of a subthreshold cluster (def...
CorrectionFlags correctionMask
corrections to apply
unsigned short subthresholdMethod
subthreshold cluster charge filling method
std::string debugRootFile
debug streamer output file used if mDebug is set
float maxSubthresholdChargeTot
upper limit for the per-region minimum qTot used as the virtual charge of a subthreshold cluster (def...
ClusterFlags clusterMask
clusters to exclude
unsigned short stackBoundaryMethod
stack boundary cluster exclusion method
float high
higher cluster cut
float low
lower cluster cut
unsigned short sameRowClusterMethod
same (sector,row) cluster group combination method: 0 = do not merge (one sample per cluster),...
std::vector< Cluster > clusters
LumiInfo lumi