Project
Loading...
Searching...
No Matches
IDCAverageGroupHelper.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{
19 const static auto& paramIDCGroup = ParameterIDCGroup::Instance();
20 switch (paramIDCGroup.method) {
22 default:
23 return mRobustAverage[mThreadNum].getFilteredAverage(paramIDCGroup.sigma).first;
24 break;
26 return withweights ? mRobustAverage[mThreadNum].getWeightedMean() : mRobustAverage[mThreadNum].getMean();
27 break;
28 }
29}
30
31void o2::tpc::IDCAverageGroupHelper<o2::tpc::IDCAverageGroupCRU>::set(const unsigned int threadNum, const unsigned int integrationInterval)
32{
33 mThreadNum = threadNum;
34 mIntegrationInterval = integrationInterval;
35 mOffsetUngrouped = integrationInterval * Mapper::PADSPERREGION[getRegion()];
36}
37
38void o2::tpc::IDCAverageGroupHelper<o2::tpc::IDCAverageGroupCRU>::addValue(const unsigned int padInRegion, const float weight)
39{
40 mRobustAverage[mThreadNum].addValue(getUngroupedIDCVal(padInRegion) * Mapper::INVPADAREA[getRegion()], weight);
41}
42
44{
45 mRobustAverage[mThreadNum].addValue(getUngroupedIDCVal(padInRegion) * Mapper::INVPADAREA[getRegion()]);
46}
47
49{
50 mRobustAverage[mThreadNum].clear();
51}
52
54{
55 return mIDCsGrouped.getValue(mIDCGroupHelperSector.getIndexUngroupedGlobal(getSector(), getRegion(), urow, upad, mIntegrationInterval));
56}
57
58void o2::tpc::IDCAverageGroupHelper<o2::tpc::IDCAverageGroupTPC>::setGroupedIDC(const unsigned int glrow, const unsigned int padGrouped, const float val)
59{
60 const unsigned int index = mIDCGroupHelperSector.getOffsRow(getRegion(), glrow) + padGrouped + mOffsetGrouped;
61 mIDCsGrouped.setValue(val, index);
62}
63
65{
66 return mIDCsUngrouped.getValue(padInRegion + mOffsetUngrouped);
67}
68
70{
71 mIntegrationInterval = integrationInterval;
72 mOffsetUngrouped = (mIntegrationInterval * SECTORSPERSIDE + getSector() % SECTORSPERSIDE) * Mapper::getPadsInSector() + Mapper::GLOBALPADOFFSET[getRegion()];
73 const int offs = mIDCGroupHelperSector.getGroupingParameter().getEdgePadGroupingType() == EdgePadGroupingMethod::ROWS ? 1 : mIDCGroupHelperSector.getGroupingParameter().getGroupRows(getRegion());
74 mOffsetGrouped = mIDCGroupHelperSector.getIndexGrouped(getSector(), getRegion(), 0, 0, mIntegrationInterval) - mIDCGroupHelperSector.getGroupingParameter().getGroupedPadsSectorEdges() * offs;
75}
76
78{
79 const static auto& paramIDCGroup = ParameterIDCGroup::Instance();
80 switch (paramIDCGroup.method) {
82 default:
83 return mRobustAverage[mThreadNum].getFilteredAverage(paramIDCGroup.sigma).first;
84 break;
86 return withweights ? mRobustAverage[mThreadNum].getWeightedMean() : mRobustAverage[mThreadNum].getMean();
87 break;
88 }
89}
90
91void o2::tpc::IDCAverageGroupHelper<o2::tpc::IDCAverageGroupTPC>::addValue(const unsigned int padInRegion, const float weight)
92{
93 mRobustAverage[mThreadNum].addValue(getUngroupedIDCVal(padInRegion), weight);
94}
95
97{
98 mRobustAverage[mThreadNum].addValue(getUngroupedIDCVal(padInRegion));
99}
100
102{
103 mRobustAverage[mThreadNum].clear();
104}
105
106void o2::tpc::IDCAverageGroupHelper<o2::tpc::IDCAverageGroupTPC>::setSectorEdgeIDC(const unsigned int ulrow, const unsigned int upad)
107{
108 const int index = mIDCGroupHelperSector.getIndexUngrouped(getSector(), getRegion(), ulrow, upad, mIntegrationInterval);
109 mIDCsGrouped.setValue(getGroupedIDC(false), index);
110}
base class for averaging and grouping of IDCs
helper class for averaging and grouping of IDCs
This file provides the structs for storing the factorized IDC values and fourier coefficients to be s...
class for performing robust averaging and outlier filtering
GLuint index
Definition glcorearb.h:781
GLuint GLuint GLfloat weight
Definition glcorearb.h:5477
GLuint GLfloat * val
Definition glcorearb.h:1582
constexpr unsigned char SECTORSPERSIDE
Definition Defs.h:40
@ SLOW
Outlier filtering performed. Filtering + averaging.
@ FAST
no outlier filtering performed. Only averaging