Project
Loading...
Searching...
No Matches
Bunch.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 ALICEO2_EMCAL_BUNCH_H
12#define ALICEO2_EMCAL_BUNCH_H
13
14#include <cstdint>
15#include <vector>
16#include <gsl/span>
17#include "Rtypes.h"
18
19namespace o2
20{
21
22namespace emcal
23{
39class Bunch
40{
41 public:
43 Bunch() = default;
44
48 Bunch(uint8_t length, uint8_t start) : mBunchLength(length), mStartTime(start), mADC() {}
49
51 ~Bunch() = default;
52
58 void addADC(uint16_t adc) { mADC.emplace_back(adc); }
59
65 void initFromRange(gsl::span<uint16_t> range);
66
72 const std::vector<uint16_t>& getADC() const { return mADC; }
73
76 uint8_t getBunchLength() const { return mBunchLength; }
77
83 uint8_t getStartTime() const { return mStartTime; }
84
90 uint8_t getEndTime() const { return mStartTime - mBunchLength + 1; }
91
94 void setBunchLength(uint8_t length) { mBunchLength = length; }
95
101 void setStartTime(uint8_t start) { mStartTime = start; }
102
103 private:
104 uint8_t mBunchLength = 0;
105 uint8_t mStartTime = 0;
106 std::vector<uint16_t> mADC;
107
108 ClassDefNV(Bunch, 1);
109};
110
111} // namespace emcal
112
113} // namespace o2
114
115#endif
ALTRO bunch information.
Definition Bunch.h:40
~Bunch()=default
uint8_t getStartTime() const
Get the start time bin.
Definition Bunch.h:83
const std::vector< uint16_t > & getADC() const
Get range of ADC values in the bunch.
Definition Bunch.h:72
void addADC(uint16_t adc)
Add ADC value to the bunch.
Definition Bunch.h:58
uint8_t getEndTime() const
Get the end time bin.
Definition Bunch.h:90
void setStartTime(uint8_t start)
Set the start time bin.
Definition Bunch.h:101
uint8_t getBunchLength() const
Get the length of the bunch (number of time bins)
Definition Bunch.h:76
Bunch()=default
Constructor.
void setBunchLength(uint8_t length)
Set the length of the ALTRO bunch.
Definition Bunch.h:94
void initFromRange(gsl::span< uint16_t > range)
Initialize the ADC values in the bunch from a range.
Definition Bunch.cxx:15
Bunch(uint8_t length, uint8_t start)
Initialize the bunch with start time and bunch length.
Definition Bunch.h:48
GLenum GLint * range
Definition glcorearb.h:1899
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
GLuint start
Definition glcorearb.h:469
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
ArrayADC adc