25void CTFCoder<N>::appendToTree(TTree&
tree, CTF& ec,
int id)
27 ec.appendToTree(
tree,
id >= 0 ? fmt::format(
"{}_{}", mDet.getName(),
id) : mDet.
getName());
33void CTFCoder<N>::readFromTree(TTree&
tree,
int entry,
int id, std::vector<ROFRecord>& rofRecVec,
38 ec.readFromTree(
tree,
id >= 0 ? fmt::format(
"{}_{}", mDet.getName(),
id) : mDet.
getName(),
entry);
44void CTFCoder<N>::compress(CompressedClusters&
cc,
45 const gsl::span<const ROFRecord>& rofRecVec,
46 const gsl::span<const CompClusterExt>&
cclusVec,
47 const gsl::span<const unsigned char>&
pattVec,
53 if (!rofRecVec.size()) {
56 uint32_t firstROF = rofRecVec.size(), nrofSel = rofRecVec.size(), nClusSel =
cclusVec.size();
57 std::vector<bool> reject(rofRecVec.size());
58 if (mIRFrameSelector.isSet()) {
59 for (
size_t ir = 0;
ir < rofRecVec.size();
ir++) {
60 auto irStart = rofRecVec[
ir].getBCData();
61 if (mIRFrameSelector.check({irStart, irStart + strobeLength - 1}) < 0) {
64 nClusSel -= rofRecVec[
ir].getNEntries();
65 }
else if (firstROF == rofRecVec.size()) {
77 const auto& rofRec0 = rofRecVec[firstROF];
78 cc.header.firstOrbit = rofRec0.getBCData().orbit;
79 cc.header.firstBC = rofRec0.getBCData().bc;
80 cc.header.nROFs = nrofSel;
81 cc.header.nClusters = nClusSel;
83 cc.firstChipROF.resize(nrofSel);
84 cc.bcIncROF.resize(nrofSel);
85 cc.orbitIncROF.resize(nrofSel);
86 cc.nclusROF.resize(nrofSel);
88 cc.row.resize(nClusSel);
89 cc.colInc.resize(nClusSel);
91 cc.chipInc.reserve(1000);
92 cc.chipMul.reserve(1000);
93 cc.pattID.resize(nClusSel);
95 bool selectPatterns = nrofSel < rofRecVec.size();
96 if (!selectPatterns) {
106 int irofOut = 0, iclOut = 0;
108 for (
uint32_t irof = 0; irof < rofRecVec.size(); irof++) {
109 const auto& rofRec = rofRecVec[irof];
110 const auto& intRec = rofRec.getBCData();
113 if (selectPatterns && pattIt != pattIt0) {
114 cc.pattMap.insert(
cc.pattMap.end(), pattIt0, pattIt);
117 for (
int icl = rofRec.getFirstEntry(); icl < rofRec.getFirstEntry() + rofRec.getNEntries(); icl++) {
126 if (intRec.orbit == prevOrbit) {
127 cc.orbitIncROF[irofOut] = 0;
128#ifdef _CHECK_INCREMENTES_
129 if (intRec.bc < prevBC) {
130 LOG(warning) <<
"Negative BC increment " << intRec.bc <<
" -> " << prevBC;
133 cc.bcIncROF[irofOut] = int16_t(intRec.bc - prevBC);
135 cc.orbitIncROF[irofOut] =
int32_t(intRec.orbit - prevOrbit);
136#ifdef _CHECK_INCREMENTES_
137 if (intRec.orbit < prevOrbit) {
138 LOG(warning) <<
"Negative Orbit increment " << intRec.orbit <<
" -> " << prevOrbit;
141 cc.bcIncROF[irofOut] = intRec.bc;
142 prevOrbit = intRec.orbit;
145 auto ncl = rofRec.getNEntries();
146 cc.nclusROF[irofOut] =
ncl;
148 cc.firstChipROF[irofOut] = 0;
152 cc.firstChipROF[irofOut] =
cclusVec[rofRec.getFirstEntry()].getChipID();
153 int icl = rofRec.getFirstEntry(), iclMax = icl +
ncl;
155 uint16_t prevChip =
cc.firstChipROF[irofOut], prevCol = 0;
157 cc.chipMul.push_back(0);
158 cc.chipInc.push_back(0);
160 for (; icl < iclMax; icl++) {
162 cc.row[iclOut] = cl.getRow();
163 cc.pattID[iclOut] = cl.getPatternID();
167 if (cl.getChipID() == prevChip) {
170 cc.colInc[iclOut] = int16_t(cl.getCol()) - prevCol;
171 prevCol = cl.getCol();
174 cc.chipInc.push_back(int16_t(cl.getChipID() - prevChip));
175#ifdef _CHECK_INCREMENTES_
176 if (cl.getChipID() < prevChip) {
177 LOG(warning) <<
"Negative Chip increment " << cl.getChipID() <<
" -> " << prevChip;
180 cc.chipMul.push_back(1);
181 prevCol =
cc.colInc[iclOut] = cl.getCol();
182 prevChip = cl.getChipID();
188 if (selectPatterns && pattIt != pattIt0) {
189 cc.pattMap.insert(
cc.pattMap.end(), pattIt0, pattIt);
192 cc.header.nPatternBytes =
cc.pattMap.size();
193 cc.header.nChips =
cc.chipMul.size();
202#define MAKECODER(part, slot) createCoder(op, std::get<rans::RenormedDenseHistogram<typename decltype(part)::value_type>>(ctf.getDictionary<typename decltype(part)::value_type>(slot, mANSVersion)), int(slot))
232 sz += estimateBufferSize(
static_cast<int>(
CTF::BLCrow),
cc.row);
237 LOG(
debug) <<
"Estimated output size is " << sz <<
" bytes";
245 CompressedClusters
cc;
246 cc.header = ec.getHeader();
248 ec.print(getPrefix(), mVerbosity);
249#define DECODEITSMFT(part, slot) ec.decode(part, int(slot), mCoders[int(slot)])
266template class CTFCoder<o2::detectors::DetID::ITS>;
267template class CTFCoder<o2::detectors::DetID::MFT>;
#define MAKECODER(part, slot)
std::string getName(const TDataMember *dm, int index, int size)
unsigned short int uint16_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 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
class for entropy encoding/decoding of ITS/MFT compressed clusters data
#define DECODEITSMFT(part, slot)
static auto getImage(const void *newHead)
get const image of the container wrapper, with pointers in the image relocated to new head
EncodedBlocks< CTFHeader, N, uint32_t > base
void createCoders(const std::vector< char > &bufVec, o2::ctf::CTFCoderBase::OpType op) final
static void skipPattern(iterator &pattIt)
static constexpr unsigned short InvalidPatternID
bool isGroup(int id) const
Compressed but not yet entropy-encoded clusters.
std::vector< o2::mch::ChannelCode > cc
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
coder decode(ctfImage, triggersD, clustersD)
o2::InteractionRecord ir(0, 0)
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))
std::vector< unsigned char > pattVec
std::vector< CompClusterExt > cclusVec