Project
Loading...
Searching...
No Matches
BCData.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_DATA_H_
13#define O2_ZDC_BC_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 __attribute__((__packed__)) ModuleTriggerMap {
32 unsigned Alice_0 : 1;
33 unsigned Alice_1 : 1;
34 unsigned Alice_2 : 1;
35 unsigned Alice_3 : 1;
36 unsigned Auto_m : 1;
37 unsigned Auto_0 : 1;
38 unsigned Auto_1 : 1;
39 unsigned Auto_2 : 1;
40 unsigned Auto_3 : 1;
41 unsigned AliceErr : 1;
42 unsigned AutoErr : 1;
43 unsigned empty : 5;
44};
45
47 uint16_t w;
48 struct ModuleTriggerMap f;
49 void reset();
50};
51
52struct BCData {
57 std::array<uint16_t, NModules> moduleTriggers{};
58 // N.B. channels and triggers have geographical addressing (0x1 << (NChPerModule * im + ic)
59 uint32_t channels = 0; // pattern of channels it refers to
60 uint32_t triggers = 0; // pattern of triggered channels (not necessarily stored) in this BC (i.e. with Hit bit on)
61 uint8_t ext_triggers = 0; // pattern of ALICE triggers
62
63 BCData() = default;
64 BCData(int first, int ne, o2::InteractionRecord iRec, uint32_t chSto, uint32_t chTrig, uint8_t extTrig)
65 {
66 ref.setFirstEntry(first);
67 ref.setEntries(ne);
68 ir = iRec;
69 channels = chSto;
70 triggers = chTrig;
71 ext_triggers = extTrig;
72 }
73 BCData(const BCData&) = default;
74
75 gsl::span<const ChannelData> getBunchChannelData(const gsl::span<const ChannelData> tfdata) const;
76 void print(uint32_t triggerMask = 0, int diff = 0) const;
77
79};
80} // namespace zdc
81} // namespace o2
82
83#endif
void print() const
Class to refer to the 1st entry and N elements of some group in the continuous container.
GLdouble f
Definition glcorearb.h:310
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void empty(int)
ClassDefNV(BCData, 3)
uint32_t triggers
Definition BCData.h:60
BCData(int first, int ne, o2::InteractionRecord iRec, uint32_t chSto, uint32_t chTrig, uint8_t extTrig)
Definition BCData.h:64
uint8_t ext_triggers
Definition BCData.h:61
o2::dataformats::RangeRefComp< 6 > ref
Definition BCData.h:55
std::array< uint16_t, NModules > moduleTriggers
Definition BCData.h:57
BCData()=default
uint32_t channels
Definition BCData.h:59
gsl::span< const ChannelData > getBunchChannelData(const gsl::span< const ChannelData > tfdata) const
Definition BCData.cxx:90
o2::InteractionRecord ir
Definition BCData.h:56
BCData(const BCData &)=default