Project
Loading...
Searching...
No Matches
IDCGroupHelperSector.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
14#include <numeric>
15
16unsigned int o2::tpc::IDCGroupHelperSector::getGroupedPad(const unsigned int region, unsigned int ulrow, unsigned int upad) const
17{
19}
20
21unsigned int o2::tpc::IDCGroupHelperSector::getGroupedRow(const unsigned int region, unsigned int ulrow) const
22{
23 return IDCGroupHelperRegion::getGroupedRow(ulrow, mGroupingPar.groupRows[region], mRows[region]);
24}
25
26unsigned int o2::tpc::IDCGroupHelperSector::getLastRow(const unsigned int region) const
27{
28 const unsigned int nTotRows = Mapper::ROWSPERREGION[region];
29 const unsigned int rowsRemainder = nTotRows % mGroupingPar.groupRows[region];
30 unsigned int lastRow = nTotRows - rowsRemainder;
31 if (rowsRemainder <= mGroupingPar.groupLastRowsThreshold[region]) {
32 lastRow -= mGroupingPar.groupRows[region];
33 }
34 return lastRow;
35}
36
37// TODO MAKE STATIC AND MOVE TO REGION HELPER
38unsigned int o2::tpc::IDCGroupHelperSector::getLastPad(const unsigned int region, const unsigned int ulrow) const
39{
40 return IDCGroupHelperRegion::getLastPad(ulrow, region, mGroupingPar.groupPads[region], mGroupingPar.groupLastPadsThreshold[region], mGroupingPar.groupPadsSectorEdges);
41}
42
44{
45 for (unsigned int reg = 0; reg < Mapper::NREGIONS; ++reg) {
46 const IDCGroupHelperRegion groupTmp(mGroupingPar.groupPads[reg], mGroupingPar.groupRows[reg], mGroupingPar.groupLastRowsThreshold[reg], mGroupingPar.groupLastPadsThreshold[reg], mGroupingPar.groupPadsSectorEdges, reg);
47 mNIDCsPerCRU[reg] = groupTmp.getNIDCsPerIntegrationInterval();
48 mRows[reg] = groupTmp.getNRows();
49 mPadsPerRow[reg] = groupTmp.getPadsPerRow();
50 mOffsRow[reg] = groupTmp.getRowOffset();
51 if (reg > 0) {
52 const unsigned int lastInd = reg - 1;
53 mRegionOffs[reg] = mRegionOffs[lastInd] + mNIDCsPerCRU[lastInd];
54 }
55 }
56 mNIDCsPerSector = static_cast<unsigned int>(std::accumulate(mNIDCsPerCRU.begin(), mNIDCsPerCRU.end(), decltype(mNIDCsPerCRU)::value_type(0)));
57}
58
59int o2::tpc::IDCGroupHelperSector::getOffsetForEdgePad(const unsigned int upad, const unsigned int ulrow, const unsigned int region) const
60{
61 return (IDCGroupHelperRegion::isSectorEdgePad(upad, ulrow, region, mGroupingPar.groupPadsSectorEdges)) ? IDCGroupHelperRegion::getOffsetForEdgePad(upad, ulrow, mGroupingPar.groupRows[region], mGroupingPar.groupPadsSectorEdges, region, getLastRow(region)) : 0;
62}
helper class for grouping of pads and rows for one region
helper class for grouping of pads and rows for one sector
Helper class for accessing grouped pads for one region.
static unsigned int getGroupedPad(const unsigned int upad, const unsigned int ulrow, const unsigned int region, const unsigned int groupPads, const unsigned int groupRows, const unsigned int groupedrows, const unsigned int groupPadsSectorEdges, const std::vector< unsigned int > &padsPerRow)
unsigned int getLastPad(const unsigned int ulrow) const
unsigned int getNIDCsPerIntegrationInterval() const
unsigned int getPadsPerRow(const unsigned int glrow) const
static unsigned int getGroupedRow(const unsigned int ulrow, const unsigned int groupRows, const unsigned int groupedrows)
static bool isSectorEdgePad(const unsigned int upad, const unsigned int ulrow, const unsigned int region, const unsigned int groupPadsSectorEdges)
static int getOffsetForEdgePad(const unsigned int upad, const unsigned int ulrow, const unsigned int groupRows, const unsigned int groupPadsSectorEdges, const unsigned int region, const int lastRow)
const std::vector< unsigned int > & getRowOffset() const
std::array< unsigned int, Mapper::NREGIONS > mRows
number of grouped rows per region
unsigned int getLastPad(const unsigned int region, const unsigned int ulrow) const
void initIDCGroupHelperSector()
init function for setting the members
unsigned int getGroupedRow(const unsigned int region, unsigned int ulrow) const
int getOffsetForEdgePad(const unsigned int upad, const unsigned int ulrow, const unsigned int region) const
std::array< std::vector< unsigned int >, Mapper::NREGIONS > mPadsPerRow
number of pads per row per region
ParameterIDCGroupCCDB mGroupingPar
struct containg the grouping parameter
unsigned int getGroupedPad(const unsigned int region, unsigned int ulrow, unsigned int upad) const
unsigned int getLastRow(const unsigned int region) const
static constexpr unsigned int ROWSPERREGION[NREGIONS]
number of pad rows for region
Definition Mapper.h:532
static constexpr unsigned int NREGIONS
total number of regions in one sector
Definition Mapper.h:527
std::array< unsigned char, Mapper::NREGIONS > groupRows
grouping parameter in pad direction (how many pads in pad direction are grouped)
unsigned int groupPadsSectorEdges
decoded number of pads at the sector edges which are grouped differently (example: 0: no pads are gro...
std::array< unsigned char, Mapper::NREGIONS > groupPads
grouping parameter in pad direction (how many pads in pad direction are grouped)