16#ifndef ALICEO2_ITSMFT_TRACKING_IOUTILS_H_
17#define ALICEO2_ITSMFT_TRACKING_IOUTILS_H_
80template <
typename T =
float>
83 gsl::span<const unsigned char>::iterator& patterns,
87 if (dict ==
nullptr) {
88 throw std::runtime_error(
"Cluster dictionary is not available");
91 const auto pattID =
c.getPatternID();
93 if (pattID >= dict->
getSize()) {
94 throw std::runtime_error(
"Cluster pattern ID is outside the topology dictionary");
121 gsl::span<const o2::itsmft::CompClusterExt>
clusters{};
123 gsl::span<const o2::itsmft::ROFRecord>
rofs{};
136 std::vector<std::vector<uint32_t>>* externalIndicesBySurface =
nullptr,
137 std::vector<std::vector<uint32_t>>* clusterSizesBySurface =
nullptr);
141void prepareSources(TimeFrame&,
const SurfaceCatalogView&, gsl::span<const ClusterSourceInput>,
142 std::vector<std::vector<uint32_t>>*, std::vector<std::vector<uint32_t>>*,
bool requireCompleteMapping =
false);
144void appendCluster(TimeFrame&,
const SurfaceCatalogView&,
const ClusterSourceInput&,
const DecodedCluster&,
145 uint32_t,
uint32_t, std::vector<std::vector<uint32_t>>&, std::vector<std::vector<uint32_t>>&);
150template <
typename Decode>
152 const Decode&
decode, std::vector<std::vector<uint32_t>>& externalIndices,
153 std::vector<std::vector<uint32_t>>& clusterSizes)
155 std::vector<std::vector<int>> boundaries(
src.layerToSurface.size(), std::vector<int>(
src.rofs.size() + 1, 0));
156 auto patterns =
src.patterns.begin();
158 const auto& rof =
src.rofs[
r];
159 const auto firstEntry = rof.getFirstEntry();
160 const auto nEntries = rof.getNEntries();
161 for (
int32_t clusterId = firstEntry; clusterId < firstEntry +
nEntries; ++clusterId) {
162 const auto& cluster =
src.clusters[clusterId];
163 const auto externalIndex =
static_cast<uint32_t>(clusterId);
166 decoded =
decode(cluster, patterns);
167 }
catch (
const std::runtime_error&
error) {
168 throw std::runtime_error(std::format(
"Cluster decoding failed: source={} rof={} clusterIndex={}: {}",
169 src.id.value(),
r, externalIndex,
error.what()));
171 appendCluster(frame, catalog,
src, decoded,
r, externalIndex, externalIndices, clusterSizes);
174 boundaries[
layer][
r + 1] =
static_cast<int>(externalIndices[
src.layerToSurface[
layer].value()].size());
177 if (patterns !=
src.patterns.end()) {
178 throw std::runtime_error(std::format(
"Trailing cluster pattern data source={} rof={} clusterIndex={}",
src.id.value(),
static_cast<uint32_t>(
src.rofs.size()),
static_cast<uint32_t>(
src.clusters.size())));
Definition of the ITSMFT compact cluster.
Shared CA tracking configuration for ITS and MFT.
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
char error[CURL_ERROR_SIZE]
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definition of the SegmentationAlpide class.
int ID
Detector identifiers: continuous, starting from 0.
static constexpr unsigned short InvalidPatternID
static constexpr float PitchCol
static constexpr float PitchRow
math_utils::Point3D< T > getClusterCoordinates(const CompCluster &cl) const
int getSize() const
Returns the number of elements in the dicionary;.
float getErr2X(int n) const
Returns the error^2 on the x position of the COG for the n_th element.
int getNpixels(int n) const
Returns the number of fired pixels of the n_th element.
bool isGroup(int n) const
Returns true if the element corresponds to a group of rare topologies.
float getErr2Z(int n) const
Returns the error^2 on the z position of the COG for the n_th element.
GLenum GLuint GLint GLint layer
constexpr float DefClusErrorRow
constexpr float DefClusErrorCol
constexpr float DefClusError2Col
ClusterData< T > extractClusterData(const CompClusterExt &c, gsl::span< const unsigned char >::iterator &patterns, const TopologyDictionary *dict)
constexpr float DefClusError2Row
void loadDecodedSource(TimeFrame &frame, const SurfaceCatalogView &catalog, const ClusterSourceInput &src, const Decode &decode, std::vector< std::vector< uint32_t > > &externalIndices, std::vector< std::vector< uint32_t > > &clusterSizes)
void validateClusterRanges(const ClusterSourceInput &)
void storeSourceROFClusters(TimeFrame &, const ClusterSourceInput &, const std::vector< std::vector< int > > &)
void appendCluster(TimeFrame &, const SurfaceCatalogView &, const ClusterSourceInput &, const DecodedCluster &, uint32_t, uint32_t, std::vector< std::vector< uint32_t > > &, std::vector< std::vector< uint32_t > > &)
void prepareSources(TimeFrame &, const SurfaceCatalogView &, gsl::span< const ClusterSourceInput >, std::vector< std::vector< uint32_t > > *, std::vector< std::vector< uint32_t > > *, bool requireCompleteMapping=false)
void loadTimeFrameSources(TimeFrame &, gsl::span< const ClusterSourceInput >, SurfaceCatalogView, std::vector< std::vector< uint32_t > > *externalIndicesBySurface=nullptr, std::vector< std::vector< uint32_t > > *clusterSizesBySurface=nullptr)
o2::math_utils::Point3D< T > coordinates
SurfaceCovariance2F rowColumnCovariance
SurfaceFramePoint cylinderFrame
coder decode(ctfImage, triggersD, clustersD)
std::array< uint16_t, 5 > pattern