Project
Loading...
Searching...
No Matches
ColumnDataToLocalBoard.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
21
22namespace o2
23{
24namespace mid
25{
26
27void ColumnDataToLocalBoard::process(gsl::span<const ColumnData> data, bool allowEmpty)
28{
30 mLocalBoardsMap.clear();
31
32 // First fill the map with the active local boards.
33 // Each local board gets a unique id.
34 for (auto& col : data) {
35 for (int iline = mMapping.getFirstBoardBP(col.columnId, col.deId), lastLine = mMapping.getLastBoardBP(col.columnId, col.deId); iline <= lastLine; ++iline) {
36 auto bp = col.getBendPattern(iline);
37 auto nbp = col.getNonBendPattern();
38 // Finding the loc ID is time consuming.
39 // So let us first check if we need to fill this board.
40 if (allowEmpty || bp || nbp) {
41 auto uniqueLocId = mCrateMapper.deLocalBoardToRO(col.deId, col.columnId, iline);
42 if (nbp && !mCrateMapper.hasDirectInputY(uniqueLocId)) {
43 // If this local board has no non-bending input attached, we set it to 0
44 // But if the bending-plane was 0 and we do not allow empty boards, we can stop here.
45 if (bp == 0 && !allowEmpty) {
46 continue;
47 }
48 nbp = 0;
49 }
50 auto& roData = mLocalBoardsMap[uniqueLocId];
51 roData.statusWord = raw::sSTARTBIT | raw::sCARDTYPE;
52 roData.boardId = uniqueLocId;
53 int ich = detparams::getChamber(col.deId);
54 roData.firedChambers |= (1 << ich);
55 roData.patternsBP[ich] = bp;
56 roData.patternsNBP[ich] = nbp;
57 }
58 }
59 }
60}
61
62std::vector<ROBoard> ColumnDataToLocalBoard::getData() const
63{
64 std::vector<ROBoard> roBoards;
65 for (auto& item : mLocalBoardsMap) {
66 roBoards.emplace_back(item.second);
67 }
68 return roBoards;
69}
70
71} // namespace mid
72} // namespace o2
Converter from ColumnData to raw local boards.
MID RO crate parameters.
Useful detector parameters for MID.
uint32_t col
Definition RawData.h:4
std::vector< ROBoard > getData() const
Gets vector of ROBoard.
void process(gsl::span< const ColumnData > data, bool allowEmpty=false)
bool hasDirectInputY(uint8_t uniqueLocId) const
Checks if local board ID (RO convention) has direct input from FEE y strips.
Definition CrateMapper.h:49
uint8_t deLocalBoardToRO(uint8_t deId, uint8_t columnId, uint8_t lineId) const
Converts the LOC ID expressed in the offline convention into the readout convention.
int getLastBoardBP(int column, int deId) const
Definition Mapping.cxx:188
int getFirstBoardBP(int column, int deId) const
Definition Mapping.cxx:178
GLboolean * data
Definition glcorearb.h:298
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...