Project
Loading...
Searching...
No Matches
CompressedDigit.cxx
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
13#include <iostream>
14
15namespace o2::trd
16{
17
18using namespace constants;
19
20CompressedDigit::CompressedDigit(const int det, const int rob, const int mcm, const int channel, const std::array<uint16_t, constants::TIMEBINS>& adc)
21{
22 setDetector(det);
23 setROB(rob);
24 setMCM(mcm);
25 setChannel(channel);
26 setADC(adc);
27}
28
29CompressedDigit::CompressedDigit(const int det, const int rob, const int mcm, const int channel) // add adc data in a seperate step
30{
31 setDetector(det);
32 setROB(rob);
33 setMCM(mcm);
34 setChannel(channel);
35}
36
38{
39 if (getChannel() == 0 || getChannel() == 1 || getChannel() == NADCMCM - 1) {
40 return 1;
41 } else {
42 return 0;
43 }
44}
45
46std::ostream& operator<<(std::ostream& stream, CompressedDigit& d)
47{
48 stream << "CompressedDigit Det: " << d.getDetector() << " ROB: " << d.getROB() << " MCM: " << d.getMCM() << " Channel: " << d.getChannel() << " ADCs:";
49 for (unsigned int i = 0; i < constants::TIMEBINS; i++) {
50 stream << "[" << d[i] << "]";
51 }
52 return stream;
53}
54
55} // namespace o2::trd
uint16_t mcm
uint16_t rob
int32_t i
void setADC(std::array< uint16_t, constants::TIMEBINS > const &adcs)
void setChannel(int channel)
GLuint GLuint stream
Definition glcorearb.h:1806
constexpr int TIMEBINS
the number of time bins
Definition Constants.h:74
constexpr int NADCMCM
the number of ADC channels per MCM
Definition Constants.h:52
std::ostream & operator<<(std::ostream &stream, const Digit &d)
Definition Digit.cxx:78
ArrayADC adc