Project
Loading...
Searching...
No Matches
StuDecoder.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#ifndef ALICEO2_EMCAL_STUDECODER_H
12#define ALICEO2_EMCAL_STUDECODER_H
13
14#include <exception>
15#include <iosfwd>
16#include <string>
19
20namespace o2
21{
22namespace emcal
23{
30
32{
33 public:
37
39 ~StuDecoder() = default;
40
43 void decode();
44
45 int32_t getL1GammaHighThreshold() const { return mL1GammaHighThreshold; }
46 int32_t getL1JetHighThreshold() const { return mL1JetHighThreshold; }
47 int32_t getL1GammaLowThreshold() const { return mL1GammaLowThreshold; }
48 int32_t getL1JetLowThreshold() const { return mL1JetLowThreshold; }
49 int32_t getRho() const { return (mCFGword13 & 0x3FFFF); }
50 int32_t getFrameReceivedSTU() const { return ((mCFGword13 >> 18) & 0x3); }
51 int32_t getRegionEnable() const { return mRegionEnable; }
52 int32_t getFrameReceived() const { return mFrameReceived; }
53 int32_t getParchSize() const { return ((mCFGword16 >> 16) & 0xFFFF); }
54 int32_t getFWversion() const { return (mCFGword16 & 0xFFFF); }
55
56 STUtype_t getSTUtype() const { return mSTU; }
57 int getFeeID() const { return STUparam::FeeID[mSTU]; }
58 int getNumberOfTRUs() const { return STUparam::NTRU[mSTU]; }
59
60 std::vector<int16_t> getL1JetHighPatchIndices() const { return mL1JetHighPatchIndex; }
61 std::vector<int16_t> getL1JetLowPatchIndices() const { return mL1JetLowPatchIndex; }
62 std::vector<int16_t> getL1GammaHighPatchIndices() const { return mL1GammaHighPatchIndex; }
63 std::vector<int16_t> getL1GammaLowPatchIndics() const { return mL1GammaLowPatchIndex; }
64 std::vector<int16_t> getFastOrADCs() const { return mFastOrADC; }
65
66 int getNumberOfL1JetHighPatches() const { return mL1JetHighPatchIndex.size(); }
67 int getNumberOfL1JetLowPatches() const { return mL1JetLowPatchIndex.size(); }
68 int getNumberOfL1GammaHighPatches() const { return mL1GammaHighPatchIndex.size(); }
69 int getNumberOfL1GammaLowPatches() const { return mL1GammaLowPatchIndex.size(); }
70
71 int16_t getIndexOfL1JetHighPatch(int id) const { return mL1JetHighPatchIndex[id]; }
72 int16_t getIndexOfL1JetLowPatch(int id) const { return mL1JetLowPatchIndex[id]; }
73 int16_t getIndexOfL1GammaHighPatch(int id) const { return mL1GammaHighPatchIndex[id]; }
74 int16_t getIndexOfL1GammaLowPatch(int id) const { return mL1GammaLowPatchIndex[id]; }
75
76 int16_t getFastOrADC(int iTRU, int iCh) const { return mFastOrADC[iTRU + getNumberOfTRUs() * iCh]; }
77
78 std::tuple<int, int, int> getL1GammaMaxPatch() const // std::tuple<TRUid,x,y>
79 {
80 return std::make_tuple(((mCFGWord0 >> 9) & 0x1F), ((mCFGWord0 >> 4) & 0x1F), (mCFGWord0 & 0xF));
81 }
82
83 bool isFullPayload() const { return mIsFullPayload; }
84 bool isL1GammaLowFired() const { return ((mCFGWord0 >> 16) & 0x1); }
85 bool isL1GammaHighFired() const { return ((mCFGWord0 >> 17) & 0x1); }
86 bool isL1JetLowFired() const { return ((mCFGWord0 >> 18) & 0x1); }
87 bool isL1JetHighFired() const { return ((mCFGWord0 >> 19) & 0x1); }
88 bool isMedianMode() const { return ((mCFGWord0 >> 20) & 0x1); }
89
90 void dumpSTUcfg() const;
91
92 int mDebug = -3;
93
94 private:
95 RawReaderMemory& mRawReader;
96
97 std::vector<int16_t> mL1JetHighPatchIndex;
98 std::vector<int16_t> mL1JetLowPatchIndex;
99 std::vector<int16_t> mL1GammaHighPatchIndex;
100 std::vector<int16_t> mL1GammaLowPatchIndex;
101 std::vector<int16_t> mFastOrADC;
102
103 // data from payload
104 int32_t mCFGWord0 = 0;
105 int32_t mCFGWord1 = 0;
106 int32_t mL0mask = 0;
107 int32_t mL1GammaHighThreshold = 0;
108 int32_t mShortPayloadRate = 0;
109 int32_t mL0bits = 0;
110 int32_t mL1JetHighThreshold = 0;
111 int32_t mL1GammaLowThreshold = 0;
112 int32_t mL1JetLowThreshold = 0;
113 int32_t mCFGword13 = 0;
114 int32_t mRegionEnable = 0;
115 int32_t mFrameReceived = 0;
116 int32_t mCFGword16 = 0;
117
119 bool mIsFullPayload = true;
120
121 void init();
122 void decodeL1JetPatchIndices(const uint32_t* buffer);
123 void decodeL1GammaPatchIndices(const uint32_t* buffer);
124 void decodeFastOrADC(const uint32_t* buffer);
125
126 int getCFGWords() { return STUparam::CFG_nWords[mSTU]; }
127 int getL1JetIndexWords() { return STUparam::L1JetIndex_nWords[mSTU]; }
128 int getL0indexWords() { return STUparam::L0index_nWords[mSTU]; }
129 int getL1GammaIndexWords() { return STUparam::L1GammaIndex_nWords[mSTU]; }
130 int getRawWords() { return STUparam::Raw_nWords[mSTU]; }
131 int getSubregionsEta() { return STUparam::SubregionsEta[mSTU]; }
132 int getSubregionsPhi() { return STUparam::SubregionsPhi[mSTU]; }
133 int getPaloadSizeFull() { return STUparam::PaloadSizeFull[mSTU]; }
134 int getPaloadSizeShort() { return STUparam::PaloadSizeShort[mSTU]; }
135
136 ClassDefNV(StuDecoder, 1);
137};
138
139} // namespace emcal
140} // namespace o2
141
142#endif
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
Reader for raw data produced by the Readout application in in-memory format.
Decoder of the EMCAL/DCAL STU data.
Definition StuDecoder.h:32
std::vector< int16_t > getL1GammaHighPatchIndices() const
Definition StuDecoder.h:62
int32_t getL1GammaLowThreshold() const
Definition StuDecoder.h:47
int getNumberOfL1GammaHighPatches() const
Definition StuDecoder.h:68
int32_t getFrameReceivedSTU() const
Definition StuDecoder.h:50
STUtype_t getSTUtype() const
Definition StuDecoder.h:56
std::tuple< int, int, int > getL1GammaMaxPatch() const
Definition StuDecoder.h:78
int getNumberOfL1JetHighPatches() const
Definition StuDecoder.h:66
bool isMedianMode() const
Definition StuDecoder.h:88
int16_t getFastOrADC(int iTRU, int iCh) const
Definition StuDecoder.h:76
bool isFullPayload() const
Definition StuDecoder.h:83
int16_t getIndexOfL1JetLowPatch(int id) const
Definition StuDecoder.h:72
int getFeeID() const
Definition StuDecoder.h:57
int32_t getRho() const
Definition StuDecoder.h:49
int32_t getFWversion() const
Definition StuDecoder.h:54
int16_t getIndexOfL1GammaLowPatch(int id) const
Definition StuDecoder.h:74
int16_t getIndexOfL1GammaHighPatch(int id) const
Definition StuDecoder.h:73
int32_t getL1GammaHighThreshold() const
Definition StuDecoder.h:45
int32_t getFrameReceived() const
Definition StuDecoder.h:52
int32_t getL1JetHighThreshold() const
Definition StuDecoder.h:46
int32_t getL1JetLowThreshold() const
Definition StuDecoder.h:48
int32_t getParchSize() const
Definition StuDecoder.h:53
std::vector< int16_t > getFastOrADCs() const
Definition StuDecoder.h:64
void dumpSTUcfg() const
std::vector< int16_t > getL1JetHighPatchIndices() const
Definition StuDecoder.h:60
std::vector< int16_t > getL1GammaLowPatchIndics() const
Definition StuDecoder.h:63
int getNumberOfL1JetLowPatches() const
Definition StuDecoder.h:67
bool isL1JetLowFired() const
Definition StuDecoder.h:86
std::vector< int16_t > getL1JetLowPatchIndices() const
Definition StuDecoder.h:61
int16_t getIndexOfL1JetHighPatch(int id) const
Definition StuDecoder.h:71
void decode()
Decode the STU stream.
int getNumberOfTRUs() const
Definition StuDecoder.h:58
bool isL1JetHighFired() const
Definition StuDecoder.h:87
int getNumberOfL1GammaLowPatches() const
Definition StuDecoder.h:69
bool isL1GammaLowFired() const
Definition StuDecoder.h:84
int32_t getRegionEnable() const
Definition StuDecoder.h:51
bool isL1GammaHighFired() const
Definition StuDecoder.h:85
~StuDecoder()=default
Destructor.
GLuint id
Definition glcorearb.h:650
constexpr int SubregionsEta[2]
number of subregions over eta
Definition Constants.h:132
constexpr int PaloadSizeFull[2]
number of words in full payload = 1944/882-16
Definition Constants.h:134
constexpr int Raw_nWords[2]
number of words with ADC
Definition Constants.h:131
constexpr int NTRU[2]
number of TRUs
Definition Constants.h:126
constexpr int L1JetIndex_nWords[2]
number of words with Jet indices
Definition Constants.h:128
constexpr int FeeID[2]
FEE_ID in RDH.
Definition Constants.h:125
constexpr int PaloadSizeShort[2]
number of words in shorts payload = 407/209-16
Definition Constants.h:135
constexpr int SubregionsPhi[2]
number of subregions over phi
Definition Constants.h:133
constexpr int L0index_nWords[2]
number of words with null data
Definition Constants.h:129
constexpr int L1GammaIndex_nWords[2]
number of words with Gamma indices
Definition Constants.h:130
constexpr int CFG_nWords[2]
number of configuration words
Definition Constants.h:127
@ ESTU
EMCAL STU.
Definition Constants.h:119
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...