15#ifndef GPUCA_STANDALONE
27void CalibdEdxContainer::cloneFromObject(
const CalibdEdxContainer& obj,
char* newFlatBufferPtr)
30 mCalibResidualdEdx = obj.mCalibResidualdEdx;
31 mThresholdMap = obj.mThresholdMap;
32 mGainMap = obj.mGainMap;
33 mGainMapResidual = obj.mGainMapResidual;
34 mDeadChannelMap = obj.mDeadChannelMap;
35 mApplyFullGainMap = obj.mApplyFullGainMap;
36 mCalibsLoad = obj.mCalibsLoad;
37 if (obj.mCalibTrackTopologyPol) {
38 subobjectCloneFromObject(mCalibTrackTopologyPol, obj.mCalibTrackTopologyPol);
40 if (obj.mCalibTrackTopologySpline) {
41 subobjectCloneFromObject(mCalibTrackTopologySpline, obj.mCalibTrackTopologySpline);
46void CalibdEdxContainer::subobjectCloneFromObject(Type*& obj,
const Type* objOld)
49 memset((
void*)obj, 0,
sizeof(*obj));
50 obj->cloneFromObject(*objOld,
mFlatBufferPtr + sizeOfCalibdEdxTrackTopologyObj<Type>());
64 if (mCalibTrackTopologySpline) {
65 mCalibTrackTopologySpline->
destroy();
67 if (mCalibTrackTopologyPol) {
68 mCalibTrackTopologyPol->
destroy();
70 mCalibTrackTopologySpline =
nullptr;
71 mCalibTrackTopologyPol =
nullptr;
78 if (mCalibTrackTopologyPol) {
80 }
else if (mCalibTrackTopologySpline) {
83 mCalibTrackTopologyPol =
nullptr;
84 mCalibTrackTopologySpline =
nullptr;
95 obj->setActualBufferAddress(
mFlatBufferPtr + sizeOfCalibdEdxTrackTopologyObj<Type>());
100 if (mCalibTrackTopologyPol) {
102 }
else if (mCalibTrackTopologySpline) {
105 mCalibTrackTopologyPol =
nullptr;
106 mCalibTrackTopologySpline =
nullptr;
116 obj->setFutureBufferAddress(distBuffer);
124 if (mCalibTrackTopologyPol) {
125 return mCalibTrackTopologyPol->getMinThreshold();
127 const float minThr = 0;
128 LOGP(info,
"Topology correction not set! Returning default min threshold of: {}", minThr);
135 if (mCalibTrackTopologyPol) {
136 return mCalibTrackTopologyPol->getMaxThreshold();
138 const float maxThr = 1;
139 LOGP(info,
"Topology correction not set! Returning default max threshold of: {}", maxThr);
146 setTopologyCorrection(calibTrackTopology, mCalibTrackTopologyPol);
147 mCalibTrackTopologySpline =
nullptr;
154 setTopologyCorrection(calibTrackTopology, mCalibTrackTopologyPol);
155 mCalibTrackTopologySpline =
nullptr;
160 setTopologyCorrection(calibTrackTopology, mCalibTrackTopologySpline);
161 mCalibTrackTopologyPol =
nullptr;
167 mThresholdMap.setMinCorrectionFactor(defaultVal - 0.1f);
168 mThresholdMap.setMaxCorrectionFactor(defaultVal + 0.1f);
171 mThresholdMap.setGainCorrection(
sector, globPad, defaultVal);
177void CalibdEdxContainer::setTopologyCorrection(
const Type& calibTrackTopologyTmp, Type*& obj)
182 const std::size_t flatbufferSize = calibTrackTopologyTmp.getFlatBufferSize();
185 const std::size_t objSize = sizeOfCalibdEdxTrackTopologyObj<Type>();
188 const std::size_t totalSize = flatbufferSize + objSize;
195 obj->cloneFromObject(calibTrackTopologyTmp,
nullptr);
201#ifndef GPUCA_STANDALONE
205 TFile fInp(fileName.data(),
"READ");
207 fInp.GetObject(objName.data(),
threshold);
214 const auto thresholdMapProcessed = processThresholdMap(thresholdMap, maxCorrectionFactor);
216 mThresholdMap = thresholdMapTmp;
219CalDet<float> CalibdEdxContainer::processThresholdMap(
const CalDet<float>& thresholdMap,
const float maxThreshold,
const int32_t nPadsInRowCl,
const int32_t nPadsInPadCl)
const
226 for (int32_t lrow = 0; lrow <= maxRow; ++lrow) {
228 const int32_t rowStart = std::clamp(lrow - nPadsInRowCl, 0, maxRow);
229 const int32_t rowEnd = std::clamp(lrow + nPadsInRowCl, 0, maxRow);
236 for (int32_t rowCl = rowStart; rowCl <= rowEnd; ++rowCl) {
239 const int32_t diffAddPads = addPadsCl - addPadsStart;
240 const int32_t padClCentre = pad + diffAddPads;
243 const int32_t padStart = std::clamp(padClCentre - nPadsInPadCl, 0, maxPad);
244 const int32_t padEnd = std::clamp(padClCentre + nPadsInPadCl, 0, maxPad);
245 for (int32_t padCl = padStart; padCl <= padEnd; ++padCl) {
248 if (padCl == (int32_t)pad && rowCl == lrow) {
261 const float meanThresold = sumThr / countThr;
263 thresholdMapProcessed.setValue(
sector, globalPad, meanThresold);
268 return thresholdMapProcessed;
279 mGainMap = gainMapTmp;
285 mGainMapResidual = gainMapResTmp;
290 loadTopologyCorrectionFromFile(fileName, mCalibTrackTopologyPol);
295 loadTopologyCorrectionFromFile(fileName, mCalibTrackTopologySpline);
299void CalibdEdxContainer::loadTopologyCorrectionFromFile(std::string_view fileName, Type*& obj)
302 Type calibTrackTopologyTmp(fileName.data());
303 setTopologyCorrection(calibTrackTopologyTmp, obj);
Definition of container class for dE/dx corrections.
unsigned short int uint16_t
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 sector
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
void setFutureBufferAddress(char *futureFlatBufferPtr)
void destroy()
_______________ Utilities _______________________________________________
static T * relocatePointer(const char *oldBase, char *newBase, const T *ptr)
Relocates a pointer inside a buffer to the new buffer address.
void setActualBufferAddress(char *actualFlatBufferPtr)
_____________ Methods for moving the class with its external buffer to another location _____________...
void startConstruction()
_____________ Construction _________
void moveBufferTo(char *newBufferPtr)
void finishConstruction(int32_t flatBufferSize)
void cloneFromObject(const FlatObject &obj, char *newFlatBufferPtr)
const T getValue(const int sec, const int globalPadInSector) const
void loadSplineTopologyCorrectionFromFile(std::string_view fileName)
void setDefaultZeroSupresssionThreshold()
void setGainMap(const CalDet< float > &gainMap, const float minGain, const float maxGain)
setting the gain map map from a CalDet
void loadPolTopologyCorrectionFromFile(std::string_view fileName)
================================================================================================
void setPolTopologyCorrection(const CalibdEdxTrackTopologyPol &calibTrackTopology)
const ChargeType const float const float const float const float const float const float threshold
void setActualBufferAddress(char *actualFlatBufferPtr)
set location of external flat buffer
void setSplineTopologyCorrection(const CalibdEdxTrackTopologySpline &calibTrackTopology)
float getMinZeroSupresssionThreshold() const
void setDeadChannelMap(const CalDet< bool > &deadMap)
setting the gain map map from a CalDet
void setZeroSupresssionThreshold(const CalDet< float > &thresholdMap)
void setFutureBufferAddress(char *futureFlatBufferPtr)
set future location of the flat buffer
void setDefaultPolTopologyCorrection()
setting a default topology correction which just returns 1
float getMaxZeroSupresssionThreshold() const
void moveBufferTo(char *newBufferPtr)
void setGainMapResidual(const CalDet< float > &gainMapResidual, const float minResidualGain=0.7f, const float maxResidualGain=1.3f)
setting the gain map map from a CalDet
void loadZeroSupresssionThresholdFromFile(std::string_view fileName, std::string_view objName, const float minCorrectionFactor, const float maxCorrectionFactor)
void destroy()
destroy the object (release internal flat buffer)
calibration class for the track topology correction of the dE/dx using multvariate polynomials
void setDefaultPolynomials()
setting a default topology correction which just returns 1
void destroy()
destroy the object (release internal flat buffer)
static GlobalPadNumber getGlobalPadNumber(const unsigned int lrow, const unsigned int pad, const unsigned int region)
static const std::vector< unsigned int > ADDITIONALPADSPERROW[NREGIONS]
additional pads per row compared to first row
static const std::vector< unsigned int > PADSPERROW[NREGIONS]
number of pads per row in region
static constexpr unsigned int ROWSPERREGION[NREGIONS]
number of pad rows for region
static constexpr unsigned int NSECTORS
total number of sectors in the TPC
static constexpr unsigned int NREGIONS
total number of regions in one sector
#define TPC_REAL_PADS_IN_SECTOR
Global TPC definitions and constants.
void setFromMap(const o2::tpc::CalDet< bool > &)
setting the stored values from CalDet