Project
Loading...
Searching...
No Matches
RecEventFlat.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
12#ifndef _ZDC_RECEVENTFLAT_H_
13#define _ZDC_RECEVENTFLAT_H_
14
20#include "ZDCBase/Constants.h"
21#include "MathUtils/Cartesian.h"
22#include <Rtypes.h>
23#include <gsl/span>
24#include <array>
25#include <vector>
26#include <map>
27#include <cmath>
28
32
33namespace o2
34{
35namespace zdc
36{
37using FirstEntry = int;
38using NElem = int;
39
41 static std::array<float, NChannels> fe;
42 static std::array<float, NTDCChannels> fa;
43 static void reset();
44 static void setGeV();
45 static void setGeVZN();
46 static void setGeVZP();
47 static void setTeV();
48 static void setTeVZN();
49 static void setTeVZP();
50 static void setNucleonEnergy(float energy);
51 static void setNucleonEnergyZN(float energy);
52 static void setNucleonEnergyZP(float energy);
53};
54
55struct RecEventFlat { // NOLINT: false positive in clang-tidy !!
60 std::map<uint8_t, float> ezdc;
61 std::vector<float> TDCVal[NTDCChannels];
62 std::vector<float> TDCAmp[NTDCChannels];
63 std::vector<bool> TDCPile[NTDCChannels];
64 gsl::span<const o2::zdc::BCRecData> mRecBC;
65 gsl::span<const o2::zdc::ZDCEnergy> mEnergy;
66 gsl::span<const o2::zdc::ZDCTDCData> mTDCData;
67 gsl::span<const uint16_t> mInfo;
68 std::vector<uint16_t> mDecodedInfo;
77 NElem mNE = 0;
78 NElem mNT = 0;
79 NElem mNI = 0;
80 std::array<bool, NChannels> isBeg{};
81 std::array<bool, NChannels> isEnd{};
83 std::vector<float> inter[NChannels];
84 std::array<bool, 4> mComputed{};
85
86 // Reconstruction messages
87 std::array<bool, NChannels> genericE{};
88 std::array<bool, NChannels> tdcPedEv{};
89 std::array<bool, NChannels> tdcPedOr{};
90 std::array<bool, NChannels> tdcPedQC{};
91 std::array<bool, NChannels> tdcPedMissing{};
92 std::array<bool, NChannels> adcPedEv{};
93 std::array<bool, NChannels> adcPedOr{};
94 std::array<bool, NChannels> adcPedQC{};
95 std::array<bool, NChannels> adcPedMissing{};
96 std::array<bool, NChannels> offPed{};
97 std::array<bool, NChannels> pilePed{};
98 std::array<bool, NChannels> pileTM{};
99 std::array<bool, NChannels> adcMissingwTDC{};
100 std::array<bool, NChannels> tdcPileEvC{};
101 std::array<bool, NChannels> tdcPileEvE{};
102 std::array<bool, NChannels> tdcPileM1C{};
103 std::array<bool, NChannels> tdcPileM1E{};
104 std::array<bool, NChannels> tdcPileM2C{};
105 std::array<bool, NChannels> tdcPileM2E{};
106 std::array<bool, NChannels> tdcPileM3C{};
107 std::array<bool, NChannels> tdcPileM3E{};
108 std::array<bool, NChannels> tdcSigE{};
109 // End_of_messages
110
111 void clearBitmaps();
112
115
116 void init(const std::vector<o2::zdc::BCRecData>* RecBC, const std::vector<o2::zdc::ZDCEnergy>* Energy, const std::vector<o2::zdc::ZDCTDCData>* TDCData, const std::vector<uint16_t>* Info);
117 void init(const gsl::span<const o2::zdc::BCRecData> RecBC, const gsl::span<const o2::zdc::ZDCEnergy> Energy, const gsl::span<const o2::zdc::ZDCTDCData> TDCData, const gsl::span<const uint16_t> Info);
118
119 int next();
120 int at(int ientry);
121
122 void allocate(int isig)
123 {
124 if (inter[isig].size() != NIS) {
125 inter[isig].resize(NIS);
126 }
127 }
128
130 {
131 return mCurB;
132 }
133
134 inline int getEntries() const
135 {
136 return mNEntries;
137 }
138
139 inline int getNextEntry() const
140 {
141 return mEntry;
142 }
143
144 inline NElem getNEnergy() const
145 {
146 return mNE;
147 }
148
149 inline bool getEnergy(int32_t i, uint8_t& key, float& val) const
150 {
151 if (i < mNE) {
152 auto it = ezdc.begin();
153 std::advance(it, i);
154 key = it->first;
155 val = it->second;
156 return true;
157 }
158 return false;
159 }
160
161 inline NElem getNTDC() const
162 {
163 return mNT;
164 }
165
166 inline NElem getNInfo() const
167 {
168 return mNI;
169 }
170
171 const std::vector<uint16_t>& getDecodedInfo()
172 {
173 return mDecodedInfo;
174 }
175
176 float tdcV(uint8_t ich, uint64_t ipos) const
177 {
178 if (ich < NTDCChannels) {
179 if (ipos < TDCVal[ich].size()) {
180 return FTDCVal * TDCVal[ich][ipos];
181 }
182 }
183 return -std::numeric_limits<float>::infinity();
184 }
185
186 float tdcA(uint8_t ich, uint64_t ipos) const
187 {
188 if (ich < NTDCChannels) {
189 if (ipos < TDCAmp[ich].size()) {
190 return TDCAmp[ich][ipos];
191 }
192 }
193 return -std::numeric_limits<float>::infinity();
194 }
195
196 int NtdcV(uint8_t ich) const
197 {
198 if (ich < NTDCChannels) {
199 return TDCVal[ich].size();
200 } else {
201 return 0;
202 }
203 }
204
205 int NtdcA(uint8_t ich) const
206 {
207 if (ich < NTDCChannels) {
208 return TDCAmp[ich].size();
209 } else {
210 return 0;
211 }
212 }
213
214 float EZDC(uint8_t ich) const
215 {
216 std::map<uint8_t, float>::const_iterator it = ezdc.find(ich);
217 if (it != ezdc.end()) {
218 return it->second;
219 } else {
220 return -std::numeric_limits<float>::infinity();
221 }
222 }
223
224 float EZNAC() const { return EZDC(IdZNAC); }
225 float EZNA1() const { return EZDC(IdZNA1); }
226 float EZNA2() const { return EZDC(IdZNA2); }
227 float EZNA3() const { return EZDC(IdZNA3); }
228 float EZNA4() const { return EZDC(IdZNA4); }
229 float EZNASum() const { return EZDC(IdZNASum); }
230
231 float EZPAC() const { return EZDC(IdZPAC); }
232 float EZPA1() const { return EZDC(IdZPA1); }
233 float EZPA2() const { return EZDC(IdZPA2); }
234 float EZPA3() const { return EZDC(IdZPA3); }
235 float EZPA4() const { return EZDC(IdZPA4); }
236 float EZPASum() const { return EZDC(IdZPASum); }
237
238 float EZEM1() const { return EZDC(IdZEM1); }
239 float EZEM2() const { return EZDC(IdZEM2); }
240
241 float EZNCC() const { return EZDC(IdZNCC); }
242 float EZNC1() const { return EZDC(IdZNC1); }
243 float EZNC2() const { return EZDC(IdZNC2); }
244 float EZNC3() const { return EZDC(IdZNC3); }
245 float EZNC4() const { return EZDC(IdZNC4); }
246 float EZNCSum() const { return EZDC(IdZNCSum); }
247
248 float EZPCC() const { return EZDC(IdZPCC); }
249 float EZPC1() const { return EZDC(IdZPC1); }
250 float EZPC2() const { return EZDC(IdZPC2); }
251 float EZPC3() const { return EZDC(IdZPC3); }
252 float EZPC4() const { return EZDC(IdZPC4); }
253 float EZPCSum() const { return EZDC(IdZPCSum); }
254
255 // Centroid cartesian reference frame as seen by projectile fragments
256 // Side A: X direction towards outside of the ring
257 // Side C: X direction towards inside of the ring
258 // Y direction up
259 // Unit: cm
260 void centroidZNA(float& x, float& y);
261 void centroidZNC(float& x, float& y);
262 void centroidZPA(float& x, float& rms);
263 void centroidZPC(float& x, float& rms);
264 float xZNA();
265 float yZNA();
266 float xZNC();
267 float yZNC();
268 float xZPA(); // Positive
269 float xZPC(); // Negative
270 float rmsZPA();
271 float rmsZPC();
272
273 void decodeInfo(uint8_t ch, uint16_t code);
274 void decodeMapInfo(uint32_t ch, uint16_t code);
275
276 void print() const;
277 void printDecodedMessages() const;
278 void printEvent() const;
280};
281
282} // namespace zdc
283} // namespace o2
284
285#endif
Class to refer to the reconstructed information.
unsigned short int uint16_t
int32_t i
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 Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_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 to refer to the 1st entry and N elements of some group in the continuous container.
Container class to store energy released in the ZDC.
Container class to store a TDC hit in a ZDC channel.
StringRef key
GLint GLenum GLint x
Definition glcorearb.h:403
GLsizeiptr size
Definition glcorearb.h:659
GLint y
Definition glcorearb.h:270
GLuint GLfloat * val
Definition glcorearb.h:1582
struct o2::upgrades_utils::@482 zdc
structure to keep FT0 information
constexpr int IdZNCSum
constexpr int IdZPC4
constexpr int IdZPA2
constexpr int IdZNA3
constexpr int IdZNA1
constexpr int IdZPA1
constexpr int IdZPCSum
constexpr int IdZNC2
constexpr int IdZEM1
constexpr int NTDCChannels
Definition Constants.h:90
constexpr int IdZNCC
constexpr int IdZPAC
constexpr int NChannels
Definition Constants.h:65
constexpr int IdZPC2
constexpr int IdZPA4
constexpr int IdZNC1
constexpr int IdZNC3
constexpr int IdZPCC
constexpr int IdZPC1
int FirstEntry
constexpr int IdZPA3
constexpr int IdZNC4
constexpr int IdZEM2
constexpr int IdZNA2
constexpr int DbgZero
Definition Constants.h:207
constexpr int NIS
Definition Constants.h:97
constexpr int IdZNASum
constexpr int IdZPC3
constexpr int IdZNA4
constexpr int IdZNAC
constexpr int IdZPASum
constexpr float FTDCVal
Definition Constants.h:103
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
ClassDefNV(RecEventFlat, 1)
BCRecData & getCurB()
void centroidZPA(float &x, float &rms)
uint64_t mEntry
Event quality information (decoded)
std::vector< float > inter[NChannels]
Current BC.
FirstEntry mStopT
Last + 1 energy.
std::array< bool, NChannels > tdcPileM1C
11 TDC in-bunch pile-up error
gsl::span< const o2::zdc::BCRecData > mRecBC
TDC pile-up correction flag (TODO)
std::array< bool, NChannels > isBeg
N info.
std::array< bool, NChannels > tdcSigE
17 TDC pile-up in bunch -3 error
std::array< bool, 4 > mComputed
Interpolated samples.
std::array< bool, NChannels > adcMissingwTDC
8 Pile-up detection from TM trigger bit
std::array< bool, NChannels > tdcPileM2E
14 TDC pile-up in bunch -2 corrected
std::array< bool, NChannels > tdcPedOr
– Event pedestal for TDC
std::array< bool, NChannels > adcPedQC
3 Orbit pedestal for ADC
gsl::span< const o2::zdc::ZDCTDCData > mTDCData
ZDC energy.
std::array< bool, NChannels > tdcPileM3E
16 TDC pile-up in bunch -3 corrected
void allocate(int isig)
std::array< bool, NChannels > tdcPileEvC
9 Missing ADC even if TDC is present
void decodeInfo(uint8_t ch, uint16_t code)
FirstEntry mFirstT
First energy.
int NtdcV(uint8_t ich) const
std::array< bool, NChannels > tdcPedMissing
1 QC pedestal for TDC
std::array< bool, NChannels > tdcPileM3C
15 TDC pile-up in bunch -2 error
void printDecodedMessages() const
std::vector< float > TDCVal[NTDCChannels]
signal in ZDCs
float tdcV(uint8_t ich, uint64_t ipos) const
std::array< bool, NChannels > genericE
Centroid computed.
std::map< uint8_t, float > ezdc
pattern of channels with autotrigger bit
std::array< bool, NChannels > isEnd
Beginning of sequence.
BCRecData mCurB
End of sequence.
NElem mNT
N energy.
bool getEnergy(int32_t i, uint8_t &key, float &val) const
NElem getNEnergy() const
float EZDC(uint8_t ich) const
std::array< bool, NChannels > adcPedMissing
4 QC pedestal for ADC
void centroidZNC(float &x, float &y)
gsl::span< const o2::zdc::ZDCEnergy > mEnergy
Interaction record and references to data.
NElem mNE
Last + 1 info.
o2::InteractionRecord ir
float EZNCSum() const
uint32_t triggers
pattern of decoded energies
FirstEntry mFirstI
First TDC.
float tdcA(uint8_t ich, uint64_t ipos) const
void clearBitmaps()
18 Missing TDC signal correction
NElem getNTDC() const
int NtdcA(uint8_t ich) const
float EZPASum() const
std::array< bool, NChannels > pilePed
6 Anomalous offset from pedestal info
uint32_t mTriggerMask
Verbosity level.
uint32_t ezdcDecoded
pattern of channels acquired
void init(const std::vector< o2::zdc::BCRecData > *RecBC, const std::vector< o2::zdc::ZDCEnergy > *Energy, const std::vector< o2::zdc::ZDCTDCData > *TDCData, const std::vector< uint16_t > *Info)
Trigger mask for printout.
const std::vector< uint16_t > & getDecodedInfo()
std::array< bool, NChannels > tdcPedEv
0 Generic error
float EZPCSum() const
std::vector< uint16_t > mDecodedInfo
Event quality information.
gsl::span< const uint16_t > mInfo
ZDC TDC.
std::array< bool, NChannels > offPed
5 Missing pedestal for ADC
std::array< bool, NChannels > tdcPileEvE
10 TDC in-bunch pile-up corrected
std::array< bool, NChannels > tdcPileM1E
12 TDC pile-up in bunch -1 corrected
FirstEntry mStopI
Last + 1 TDC.
NElem getNInfo() const
std::array< bool, NChannels > pileTM
7 Pile-up detection from pedestal info
std::array< bool, NChannels > tdcPedQC
– Orbit pedestal for TDC
FirstEntry mStopE
First info.
float EZNASum() const
uint64_t mNEntries
Current entry.
std::vector< bool > TDCPile[NTDCChannels]
TDC signal amplitudes.
FirstEntry mFirstE
Number of entries.
std::array< bool, NChannels > adcPedEv
2 Missing pedestal for ADC
std::vector< float > TDCAmp[NTDCChannels]
TDC values.
std::array< bool, NChannels > adcPedOr
– Event pedestal for ADC
void centroidZNA(float &x, float &y)
void decodeMapInfo(uint32_t ch, uint16_t code)
void centroidZPC(float &x, float &rms)
std::array< bool, NChannels > tdcPileM2C
13 TDC pile-up in bunch -1 error
static void setNucleonEnergyZP(float energy)
static void setNucleonEnergy(float energy)
static std::array< float, NChannels > fe
static void setNucleonEnergyZN(float energy)
static std::array< float, NTDCChannels > fa