Project
Loading...
Searching...
No Matches
FetToDead.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
16
18
20
21namespace o2
22{
23namespace mid
24{
26{
27 mRefMasks = makeDefaultMasks();
28}
29
30void FetToDead::checkChannels(const ColumnData& mask, ColumnData fet, std::vector<ColumnData>& badChannels) const
31{
32 bool isBad = false;
33 auto pattern = ((fet.getNonBendPattern() ^ mask.getNonBendPattern()) & mask.getNonBendPattern());
35 if (pattern != 0) {
36 isBad = true;
37 }
38
39 for (int iline = 0; iline < 4; ++iline) {
40 pattern = ((fet.getBendPattern(iline) ^ mask.getBendPattern(iline)) & mask.getBendPattern(iline));
41 fet.setBendPattern(pattern, iline);
42 if (pattern != 0) {
43 isBad = true;
44 }
45 }
46 if (isBad) {
47 badChannels.emplace_back(fet);
48 }
49}
50
51std::vector<ColumnData> FetToDead::process(gsl::span<const ColumnData> fetData)
52{
54 mFetData.clear();
55 for (auto& col : fetData) {
56 mFetData.emplace(getColumnDataUniqueId(col.deId, col.columnId), col);
57 }
58 std::vector<ColumnData> deadChannels;
59 for (auto& mask : mRefMasks) {
60 auto fetIt = mFetData.find(getColumnDataUniqueId(mask.deId, mask.columnId));
61 ColumnData fet;
62 if (fetIt == mFetData.end()) {
63 fet.deId = mask.deId;
64 fet.columnId = mask.columnId;
65 } else {
66 fet = fetIt->second;
67 }
68 checkChannels(mask, fet, deadChannels);
69 }
70 return deadChannels;
71}
72
73} // namespace mid
74} // namespace o2
Class to convert the FEE test event into dead channels.
Function to produce the MID masks.
uint32_t col
Definition RawData.h:4
FetToDead()
Default constructor.
Definition FetToDead.cxx:25
std::vector< ColumnData > process(gsl::span< const ColumnData > fetData)
Definition FetToDead.cxx:51
GLint GLuint mask
Definition glcorearb.h:291
uint16_t getColumnDataUniqueId(uint8_t deId, uint8_t columnId)
Gets an unique ID for the ColumnData.
Definition ColumnData.h:66
std::vector< ColumnData > makeDefaultMasks()
Definition MaskMaker.cxx:62
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Column data structure for MID.
Definition ColumnData.h:29
uint8_t columnId
Column in DE.
Definition ColumnData.h:31
uint16_t getBendPattern(int line) const
Gets the bending plane pattern.
Definition ColumnData.h:37
uint8_t deId
Index of the detection element.
Definition ColumnData.h:30
void setNonBendPattern(uint16_t pattern)
Sets the non-bending plane pattern.
Definition ColumnData.h:40
void setBendPattern(uint16_t pattern, int line)
Sets the bending plane pattern.
Definition ColumnData.h:35
uint16_t getNonBendPattern() const
Gets the non-bending plane pattern.
Definition ColumnData.h:42
std::array< uint16_t, 5 > pattern