Project
Loading...
Searching...
No Matches
DataPointCompositeObject.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/*
13 * File: DataPointCompositeObject.h
14 * Author: John Lång (john.larry.lang@cern.ch)
15 *
16 * Created on 23 September 2016, 11:28
17 */
18#ifndef O2_DCS_DATAPOINT_COMPOSITE_OBJECT_H
19#define O2_DCS_DATAPOINT_COMPOSITE_OBJECT_H
20
21#include <cstdint>
22#include <stdexcept>
23#include <ostream>
24#include <string>
25#include "Rtypes.h"
30
31namespace o2::dcs
32{
49
59
68 DataPointCompositeObject() noexcept : id(), data() {}
69
78 const DataPointIdentifier& id,
79 const DataPointValue& data) noexcept : id(id), data(data) {}
80
85
87
94 inline bool operator==(const DataPointCompositeObject& other) const
95 noexcept
96 {
97 return id == other.id && data == other.data;
98 }
99
106 inline bool operator!=(const DataPointCompositeObject& other) const
107 noexcept
108 {
109 return id != other.id || data != other.data;
110 }
111
119 inline void set(const DataPointIdentifier& id, DataPointValue& data) noexcept
120 {
121 DataPointIdentifier::FILL(this->id, (uint64_t*)&id);
122 this->data = data;
123 }
124
133 inline void set(const uint64_t* const data) noexcept
134 {
135 DataPointIdentifier::FILL(this->id, data);
136 this->data.set(data + 8, id.get_type());
137 }
138
150 inline void update(const DataPointValue& dpval) noexcept
151 {
152 data.set(
153 dpval.flags & ~DataPointValue::CONTROL_MASK,
154 dpval.msec,
155 dpval.sec,
156 (uint64_t*)&dpval.payload_pt1,
157 id.get_type());
158 }
159
171 inline void* dim_buffer() const
172 {
173 switch (id.get_type()) {
174 case RAW_INT:
175 case RAW_UINT:
176 case RAW_BOOL:
177 case RAW_CHAR:
178 case RAW_DOUBLE:
179 case RAW_TIME:
180 case RAW_STRING:
181 case RAW_BINARY:
182 case RAW_FLOAT:
183 return (void*)&data.payload_pt1;
184 case DPVAL_INT:
185 case DPVAL_UINT:
186 case DPVAL_BOOL:
187 case DPVAL_CHAR:
188 case DPVAL_DOUBLE:
189 case DPVAL_TIME:
190 case DPVAL_STRING:
191 case DPVAL_BINARY:
192 case DPVAL_FLOAT:
193 return (void*)&data;
194 default:
195 case VOID:
196 throw std::domain_error("Illegal DeliveryType.");
197 }
198 }
199
209 inline friend std::ostream& operator<<(std::ostream& os,
210 const DataPointCompositeObject& dpcom) noexcept
211 {
212 std::string payload;
213 os << dpcom.id << ";" << dpcom.data << ";";
214 union Converter {
215 uint64_t raw_data;
216 float float_value;
217 double double_value;
218 uint32_t uint_value;
219 int32_t int_value;
220 char char_value;
221 bool bool_value;
222 } converter;
223 converter.raw_data = dpcom.data.payload_pt1;
224 switch (dpcom.id.get_type()) {
225 case VOID:
226 return os;
227 case RAW_INT:
228 case DPVAL_INT:
229 return os << converter.int_value;
230 case RAW_UINT:
231 case DPVAL_UINT:
232 return os << converter.uint_value;
233 case RAW_BOOL:
234 case DPVAL_BOOL:
235 return os << (converter.bool_value ? "True" : "False");
236 case RAW_CHAR:
237 case DPVAL_CHAR:
238 return os << converter.char_value;
239 case RAW_FLOAT:
240 case DPVAL_FLOAT:
241 return os << converter.float_value;
242 case RAW_DOUBLE:
243 case DPVAL_DOUBLE:
244 return os << converter.double_value;
245 case RAW_STRING:
246 case DPVAL_STRING:
247 return os << std::string((char*)&dpcom.data.payload_pt1);
248 case RAW_TIME:
249 case DPVAL_TIME: {
250 // I have no idea how to properly test the time_t backend.
251 // It's probably even hardware/os/kernel specific...
252#ifdef __linux__
253 char buffer[17];
254 std::time_t ts((dpcom.data.payload_pt1) >> 32);
255 std::strftime(buffer, 32, "%FT%T", std::gmtime(&ts));
256 return os << std::string(buffer) << "." << std::setw(3) << std::setfill('0') << std::to_string((dpcom.data.payload_pt1 & 0x00000000FFFF0000) >> 16)
257 << "Z";
258#else
259 return os << "[Timestamps not supported on this platform.]";
260#endif
261 }
262 case RAW_BINARY:
263 case DPVAL_BINARY:
264 default:
266 (char*)&dpcom.data.payload_pt1, 56);
267 }
268 }
269
274 ~DataPointCompositeObject() noexcept = default;
276};
277
289template <typename T>
291
292} // namespace o2::dcs
293
294#endif /* O2_DCS_DATAPOINT_COMPOSITE_OBJECT_H */
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
static void FILL(const DataPointIdentifier &dpid, const std::string &alias, const DeliveryType type) noexcept
std::string to_hex_little_endian(const char *const start, size_t length) noexcept
T getValue(const DataPointCompositeObject &dpcom)
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52
~DataPointCompositeObject() noexcept=default
void set(const uint64_t *const data) noexcept
DataPointCompositeObject(const DataPointCompositeObject &src) noexcept=default
DataPointCompositeObject & operator=(const DataPointCompositeObject &src) noexcept=default
DataPointCompositeObject(const DataPointIdentifier &id, const DataPointValue &data) noexcept
ClassDefNV(DataPointCompositeObject, 1)
bool operator==(const DataPointCompositeObject &other) const noexcept
friend std::ostream & operator<<(std::ostream &os, const DataPointCompositeObject &dpcom) noexcept
void set(const DataPointIdentifier &id, DataPointValue &data) noexcept
bool operator!=(const DataPointCompositeObject &other) const noexcept
void update(const DataPointValue &dpval) noexcept
void set(const uint16_t flags, const uint16_t milliseconds, const uint32_t seconds, const uint64_t *const payload, const DeliveryType type)
static constexpr uint16_t CONTROL_MASK
VectorOfTObjectPtrs other