Project
Loading...
Searching...
No Matches
BCRecData.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 O2_ZDC_BC_REC_DATA_H
13#define O2_ZDC_BC_REC_DATA_H
14
17#include "ZDCBase/Constants.h"
18#include <Rtypes.h>
19#include <gsl/span>
20
24
25namespace o2
26{
27namespace zdc
28{
29class ChannelData;
30
31struct BCRecData {
33 uint32_t channels = 0; // Pattern of channels acquired
34 uint32_t triggers = 0; // Pattern of channels with autotrigger bit
35 o2::dataformats::RangeRefComp<5> refe; // Reference to reconstructed energy
36 o2::dataformats::RangeRefComp<5> reft; // Reference to reconstructed TDC
37 o2::dataformats::RangeRefComp<5> refi; // Reference to reconstruction error/information flags
38 o2::dataformats::RangeRefComp<5> refw; // Reference to waveform interpolated data
39
40 BCRecData() = default;
41
42 // Insert interaction record for new event (will set later the number of entries)
43 BCRecData(int firste, int firstt, int firsti, o2::InteractionRecord iRec)
44 {
45 refe.setFirstEntry(firste);
46 refe.setEntries(0);
47 reft.setFirstEntry(firstt);
48 reft.setEntries(0);
49 refi.setFirstEntry(firsti);
50 refi.setEntries(0);
51 refw.setFirstEntry(0);
52 refw.setEntries(0);
53 ir = iRec;
54 }
55
56 BCRecData(int firste, int firstt, int firsti, int firstd, o2::InteractionRecord iRec)
57 {
58 refe.setFirstEntry(firste);
59 refe.setEntries(0);
60 reft.setFirstEntry(firstt);
61 reft.setEntries(0);
62 refi.setFirstEntry(firsti);
63 refi.setEntries(0);
64 refw.setFirstEntry(firstd);
65 refw.setEntries(0);
66 ir = iRec;
67 }
68
69 // Update counter of energy entries
70 inline void addEnergy()
71 {
72 refe.setEntries(refe.getEntries() + 1);
73 }
74
75 // Update counter of TDC entries
76 inline void addTDC()
77 {
78 reft.setEntries(reft.getEntries() + 1);
79 }
80
81 // Update counter of Info entries
82 inline void addInfo()
83 {
84 refi.setEntries(refi.getEntries() + 1);
85 }
86
87 // Update counter of Waveform entries
88 inline void addWaveform()
89 {
90 refw.setEntries(refw.getEntries() + 1);
91 }
92
93 // Get information about event
94 inline void getRef(int& firste, int& ne, int& firstt, int& nt, int& firsti, int& ni)
95 {
96 firste = refe.getFirstEntry();
97 firstt = reft.getFirstEntry();
98 firsti = refi.getFirstEntry();
99 ne = refe.getEntries();
100 nt = reft.getEntries();
101 ni = refi.getEntries();
102 }
103
104 inline void getRef(int& firste, int& ne, int& firstt, int& nt, int& firsti, int& ni, int& firstw, int& nw)
105 {
106 firste = refe.getFirstEntry();
107 firstt = reft.getFirstEntry();
108 firsti = refi.getFirstEntry();
109 firstw = refw.getFirstEntry();
110 ne = refe.getEntries();
111 nt = reft.getEntries();
112 ni = refi.getEntries();
113 nw = refw.getEntries();
114 }
115 inline void getRefE(int& firste, int& ne)
116 {
117 firste = refe.getFirstEntry();
118 ne = refe.getEntries();
119 }
120 inline void getRefT(int& firstt, int& nt)
121 {
122 firstt = reft.getFirstEntry();
123 nt = reft.getEntries();
124 }
125 inline void getRefI(int& firsti, int& ni)
126 {
127 firsti = refi.getFirstEntry();
128 ni = refi.getEntries();
129 }
130 inline void getRefW(int& firstw, int& nw)
131 {
132 firstw = refw.getFirstEntry();
133 nw = refw.getEntries();
134 }
135
136 void print() const;
137
139};
140} // namespace zdc
141} // namespace o2
142
143#endif
Class to refer to the 1st entry and N elements of some group in the continuous container.
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
uint32_t channels
Definition BCRecData.h:33
o2::dataformats::RangeRefComp< 5 > reft
Definition BCRecData.h:36
uint32_t triggers
Definition BCRecData.h:34
o2::InteractionRecord ir
Definition BCRecData.h:32
o2::dataformats::RangeRefComp< 5 > refw
Definition BCRecData.h:38
void getRefE(int &firste, int &ne)
Definition BCRecData.h:115
ClassDefNV(BCRecData, 2)
o2::dataformats::RangeRefComp< 5 > refe
Definition BCRecData.h:35
void getRefI(int &firsti, int &ni)
Definition BCRecData.h:125
void getRef(int &firste, int &ne, int &firstt, int &nt, int &firsti, int &ni, int &firstw, int &nw)
Definition BCRecData.h:104
void getRefT(int &firstt, int &nt)
Definition BCRecData.h:120
void print() const
Definition BCRecData.cxx:18
void getRef(int &firste, int &ne, int &firstt, int &nt, int &firsti, int &ni)
Definition BCRecData.h:94
o2::dataformats::RangeRefComp< 5 > refi
Definition BCRecData.h:37
void getRefW(int &firstw, int &nw)
Definition BCRecData.h:130
BCRecData(int firste, int firstt, int firsti, int firstd, o2::InteractionRecord iRec)
Definition BCRecData.h:56
BCRecData(int firste, int firstt, int firsti, o2::InteractionRecord iRec)
Definition BCRecData.h:43