Project
Loading...
Searching...
No Matches
VariableContextHelpers.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 O2_FRAMEWORK_DATADESCRIPTORMATCHER_H_
12#define O2_FRAMEWORK_DATADESCRIPTORMATCHER_H_
13
16#include <variant>
17
18namespace o2::framework
19{
20
24 {
25 // tfCounter is always at register 14
26 auto pval = std::get_if<uint32_t>(&variables.get(data_matcher::FIRSTTFORBIT_POS));
27 if (pval == nullptr) {
28 return -1;
29 }
30 return *pval;
31 }
32
34 {
35 // timeslice is always at register 0
36 auto pval = std::get_if<uint64_t>(&variables.get(data_matcher::STARTTIME_POS));
37 if (pval == nullptr) {
39 }
40 return TimesliceId{*pval};
41 }
42
43 static inline uint32_t getRunNumber(data_matcher::VariableContext const& variables)
44 {
45 // firstTForbit is always at register 15
46 auto pval = std::get_if<uint32_t>(&variables.get(data_matcher::RUNNUMBER_POS));
47 if (pval == nullptr) {
48 return -1;
49 }
50 return *pval;
51 }
52
54 {
55 // tfCounter is always at register 14
56 auto pval = std::get_if<uint32_t>(&variables.get(data_matcher::TFCOUNTER_POS));
57 if (pval == nullptr) {
58 return -1;
59 }
60 return *pval;
61 }
62
64 {
65 // creation time is always at register 14
66 auto pval = std::get_if<uint64_t>(&variables.get(data_matcher::CREATIONTIME_POS));
67 if (pval == nullptr) {
68 return -1UL;
69 }
70 return *pval;
71 }
72};
73} // namespace o2::framework
74
75#endif // O2_FRAMEWORK_DATADESCRIPTORMATCHER_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
ContextElement::Value const & get(size_t pos) const
@ CREATIONTIME_POS
The DataHeader::runNumber associated to the timeslice.
@ FIRSTTFORBIT_POS
The DataHeader::tfCounter associated to the timeslice.
@ TFCOUNTER_POS
The DataProcessingHeader::startTime associated to the timeslice.
@ RUNNUMBER_POS
The DataHeader::firstTForbit associated to the timeslice.
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
static constexpr uint64_t INVALID
Helpers to fetch common variables.
static uint32_t getRunNumber(data_matcher::VariableContext const &variables)
static uint32_t getFirstTFCounter(data_matcher::VariableContext const &variables)
static uint64_t getCreationTime(data_matcher::VariableContext const &variables)
static uint32_t getFirstTFOrbit(data_matcher::VariableContext const &variables)
static TimesliceId getTimeslice(data_matcher::VariableContext const &variables)