Project
Loading...
Searching...
No Matches
ChannelData.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 _FDD_CHANNEL_DATA_H_
13#define _FDD_CHANNEL_DATA_H_
14
15#include <Framework/Logger.h>
16#include <array>
17#include <Rtypes.h>
18#include <tuple>
22
23namespace o2
24{
25namespace fdd
26{
27
29 static constexpr char sChannelNameDPL[] = "DIGITSCH";
30 static constexpr char sDigitName[] = "ChannelData";
31 static constexpr char sDigitBranchName[] = "FDDDigitCh";
32 static constexpr uint8_t DUMMY_CHANNEL_ID = 0xff;
33 static constexpr uint8_t DUMMY_CHAIN_QTC = 0;
34 static constexpr int16_t DUMMY_CFD_TIME = -5000;
35 static constexpr int16_t DUMMY_QTC_AMPL = -5000;
36 uint8_t mPMNumber = DUMMY_CHANNEL_ID; // PhotoMultiplier number (0 to 16)
37 int16_t mTime = DUMMY_CFD_TIME; // Time of Flight
38 int16_t mChargeADC = DUMMY_QTC_AMPL; // ADC sample
39 uint8_t mFEEBits = DUMMY_CHAIN_QTC; // Bit information from FEE
40 /* enum Flags { Integrator = 0x1 << 0,
41DoubleEvent = 0x1 << 1,
42Event1TimeLost = 0x1 << 2,
43Event2TimeLost = 0x1 << 3,
44AdcInGate = 0x1 << 4,
45TimeTooLate = 0x1 << 5,
46AmpTooHigh = 0x1 << 6,
47EventInTrigger = 0x1 << 7,
48TimeLost = 0x1 << 8 };*/
58
59 ChannelData() = default;
60 ChannelData(uint8_t channel, int time, int adc, uint8_t bits) : mPMNumber(channel), mTime(time), mChargeADC(adc), mFEEBits(bits) {}
61 uint8_t getChannelID() const { return mPMNumber; }
62 static void setFlag(EEventDataBit bitFlag, uint8_t& mFEEBits) { mFEEBits |= (1 << bitFlag); }
63 static void clearFlag(EEventDataBit bitFlag, uint8_t& mFEEBits) { mFEEBits &= ~(1 << bitFlag); }
64 bool getFlag(EEventDataBit bitFlag) const { return bool(mFEEBits & (1 << bitFlag)); }
65 void print() const;
66 bool operator==(ChannelData const& other) const
67 {
68 return std::tie(mPMNumber, mTime, mChargeADC) == std::tie(other.mPMNumber, other.mTime, other.mChargeADC);
69 }
70 void printLog() const
71 {
72 LOG(info) << "ChId: " << static_cast<uint16_t>(mPMNumber) << " | FEE bits:" << static_cast<uint16_t>(mFEEBits) << " | Time: " << mTime << " | Charge: " << mChargeADC;
73 }
75};
76} // namespace fdd
77} // namespace o2
78
79#endif
int16_t time
Definition RawEventData.h:4
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
Definition glcorearb.h:4150
struct o2::upgrades_utils::@459 fdd
Collision labels.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void print() const
static constexpr uint8_t DUMMY_CHAIN_QTC
Definition ChannelData.h:33
static constexpr char sChannelNameDPL[]
Definition ChannelData.h:29
static constexpr int16_t DUMMY_CFD_TIME
Definition ChannelData.h:34
static constexpr int16_t DUMMY_QTC_AMPL
Definition ChannelData.h:35
static void clearFlag(EEventDataBit bitFlag, uint8_t &mFEEBits)
Definition ChannelData.h:63
static void setFlag(EEventDataBit bitFlag, uint8_t &mFEEBits)
Definition ChannelData.h:62
bool operator==(ChannelData const &other) const
Definition ChannelData.h:66
void printLog() const
Definition ChannelData.h:70
bool getFlag(EEventDataBit bitFlag) const
Definition ChannelData.h:64
ClassDefNV(ChannelData, 4)
static constexpr char sDigitName[]
Definition ChannelData.h:30
static constexpr uint8_t DUMMY_CHANNEL_ID
Definition ChannelData.h:32
ChannelData(uint8_t channel, int time, int adc, uint8_t bits)
Definition ChannelData.h:60
static constexpr char sDigitBranchName[]
Definition ChannelData.h:31
uint8_t getChannelID() const
Definition ChannelData.h:61
VectorOfTObjectPtrs other
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
ArrayADC adc