Project
Loading...
Searching...
No Matches
HmpidEquipment.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
18
19/* ------ HISTORY ---------
20*/
21
23
24using namespace o2::hmpid;
25
26// ============= HmpidEquipment Class implementation =======
27
33HmpidEquipment::HmpidEquipment(int Equipment, int Cru, int Link)
34{
35 mEquipmentId = Equipment;
36 mCruId = Cru;
37 mLinkId = Link;
42 mTotalErrors = 0;
43 mTotalPads = 0;
52 mEventNumber = 0;
53 mEventSize = 0;
55 mSegment = 0;
56 mWillBeEoE = false;
57 mWillBePad = false;
58 mWillBeRowMarker = false;
60 mSampleNumber = 0;
63 mRowSize = 0;
65 return;
66}
67
73
76{
77 mWillBeRowMarker = true;
79 mWillBeEoE = false;
80 mWillBePad = false;
81 mRowSize = 0;
82 mSegment = 0;
87 mSampleNumber = 0;
90
91 mEventNumber = OUTRANGEEVENTNUMBER; // The Magic out-range event number
93
94 mBusyTimeValue = 0.0;
95 mBusyTimeAverage = 0.0;
97
99 mEventSize = 0;
100
102
105 mTotalPads = 0;
106 mTotalErrors = 0;
107
108 return;
109}
110
113{
114 for (int r = 0; r < Geo::N_COLUMNS; r++) {
115 for (int d = 0; d < Geo::N_DILOGICS; d++) {
116 for (int c = 0; c < Geo::N_CHANNELS; c++) {
117 mPadSamples[r][d][c] = 0;
118 mPadSum[r][d][c] = 0.0;
119 mPadSquares[r][d][c] = 0.0;
120 }
121 }
122 }
123 return;
124}
125
128{
129 for (int i = 0; i < MAXERRORS; i++) {
130 mErrors[i] = 0;
131 }
132 return;
133}
134
139{
140 mErrors[ErrType]++;
142 return;
143}
144
151void HmpidEquipment::setPad(int col, int dil, int cha, uint16_t charge)
152{
153 mPadSamples[col][dil][cha]++;
154 mPadSum[col][dil][cha] += (double)charge;
155 mPadSquares[col][dil][cha] += (double)charge * (double)charge;
156 return;
157}
158
163int HmpidEquipment::getEquipmentId(int cru, int link)
164{
165 if (cru == mCruId && link == mLinkId) {
166 return (mEquipmentId);
167 } else {
168 return (-1);
169 }
170}
int16_t charge
Definition RawEventData.h:5
int32_t i
uint32_t col
Definition RawData.h:4
uint32_t c
Definition RawData.h:2
static constexpr int N_COLUMNS
Definition Geo.h:82
static constexpr int N_DILOGICS
Definition Geo.h:83
static constexpr int N_CHANNELS
Definition Geo.h:84
void setPad(int col, int dil, int cha, uint16_t charge)
double mPadSum[Geo::N_COLUMNS][Geo::N_DILOGICS][Geo::N_CHANNELS]
uint32_t mPadSamples[Geo::N_COLUMNS][Geo::N_DILOGICS][Geo::N_CHANNELS]
HmpidEquipment(int Equipment, int Cru, int Link)
void init()
Inits the members for the decoding.
double mPadSquares[Geo::N_COLUMNS][Geo::N_DILOGICS][Geo::N_CHANNELS]
~HmpidEquipment()
Destructor : do nothing.
void resetPadMap()
Resets the matrix that contains the results of the decoding.
void resetErrors()
Resets the decoding errors statistics.
GLboolean r
Definition glcorearb.h:1233
const uint64_t OUTRANGEEVENTNUMBER
const int MAXERRORS