Project
Loading...
Searching...
No Matches
IDCAverageGroup.h
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
15
16#ifndef ALICEO2_IDCAVERAGEGROUP_H_
17#define ALICEO2_IDCAVERAGEGROUP_H_
18
21#include "TPCBase/Sector.h"
22#include "TPCBase/CalDet.h"
23#include <boost/property_tree/ptree.hpp>
24#include <vector>
25#include "Rtypes.h"
26
27namespace o2::utils
28{
29class TreeStreamRedirector;
30}
31
32namespace o2::tpc
33{
34
35// forward declaration of helper class
36template <class Type>
38
54template <class Type>
56{
57 public:
67 template <bool IsEnabled = true, typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCAverageGroupCRU>::value)), int>::type = 0>
68 IDCAverageGroup(const unsigned char groupPads = 4, const unsigned char groupRows = 4, const unsigned char groupLastRowsThreshold = 2, const unsigned char groupLastPadsThreshold = 2, const unsigned int groupPadsSectorEdges = 0, const unsigned short cru = 0, const unsigned char overlapRows = 0, const unsigned char overlapPads = 0)
69 : IDCAverageGroupBase<Type>{groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges, cru, sNThreads}, mOverlapRows{overlapRows}, mOverlapPads{overlapPads}
70 {
71 init();
72 }
73
81 template <bool IsEnabled = true, typename std::enable_if<(IsEnabled && (std::is_same<Type, IDCAverageGroupTPC>::value)), int>::type = 0>
82 IDCAverageGroup(const std::array<unsigned char, Mapper::NREGIONS>& groupPads = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, const std::array<unsigned char, Mapper::NREGIONS>& groupRows = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, const std::array<unsigned char, Mapper::NREGIONS>& groupLastRowsThreshold = {}, const std::array<unsigned char, Mapper::NREGIONS>& groupLastPadsThreshold = {}, const unsigned int groupPadsSectorEdges = 0, const unsigned char overlapRows = 0, const unsigned char overlapPads = 0)
83 : IDCAverageGroupBase<Type>{groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges, sNThreads}, mOverlapRows{overlapRows}, mOverlapPads{overlapPads}
84 {
85 init();
86 }
87
90 void processIDCs(const CalDet<PadFlags>* padStatusFlags = nullptr);
91
94 void drawGrouping(const std::string filename = "");
95
99 void dumpToFile(const char* outFileName = "IDCAverageGroup.root", const char* outName = "IDCAverageGroup") const;
100
102 static int getNThreads() { return sNThreads; }
103
105 const auto& getIDCGroup() const { return this->mIDCsGrouped; }
106
108 const auto& getIDCsUngrouped() const { return this->mIDCsUngrouped; }
109
111 static void setSigma(const float sigma) { o2::conf::ConfigurableParam::setValue<float>("TPCIDCGroupParam", "Sigma", sigma); }
112
114 static void setNThreads(const int nThreads) { sNThreads = nThreads; }
115
119 bool setFromFile(const char* fileName = "IDCAverageGroup.root", const char* name = "IDCAverageGroup");
120
123 void createDebugTree(const char* nameFile);
124
128 static void createDebugTreeForAllCRUs(const char* nameFile, const char* filename);
129
130 private:
131 inline static int sNThreads{1};
132 const unsigned char mOverlapRows{0};
133 const unsigned char mOverlapPads{0};
134
136 void init();
137
139 static void createDebugTree(const IDCAverageGroupHelper<Type>& idcStruct, o2::utils::TreeStreamRedirector& pcstream);
140
144 static float normal_dist(const float x, const float sigma);
145
148 template <class LoopType>
149 void loopOverGroups(IDCAverageGroupHelper<LoopType>& idcStruct, const CalDet<PadFlags>* padStatusFlags = nullptr);
150
152 void drawGroupingInformations(const int region, const int grPads, const int grRows, const int groupLastRowsThreshold, const int groupLastPadsThreshold, const int overlapRows, const int overlapPads, const int nIDCs, const int groupPadsSectorEdges) const;
153
155 void drawLatex(IDCAverageGroupHelper<IDCAverageGroupDraw>& idcStruct, const GlobalPadNumber padNum, const unsigned int padInRegion, const bool fillPoly, const int colOffs = 0) const;
156
157 ClassDefNV(IDCAverageGroup, 1)
158};
159
160} // namespace o2::tpc
161
162#endif
base class for averaging and grouping of IDCs
class for performing robust averaging and outlier filtering
Helper class for either perform the grouping or draw the grouping.
static void setSigma(const float sigma)
static void createDebugTreeForAllCRUs(const char *nameFile, const char *filename)
void createDebugTree(const char *nameFile)
void dumpToFile(const char *outFileName="IDCAverageGroup.root", const char *outName="IDCAverageGroup") const
static int getNThreads()
get the number of threads used for some of the calculations
static void setNThreads(const int nThreads)
set the number of threads used for some of the calculations
bool setFromFile(const char *fileName="IDCAverageGroup.root", const char *name="IDCAverageGroup")
IDCAverageGroup(const unsigned char groupPads=4, const unsigned char groupRows=4, const unsigned char groupLastRowsThreshold=2, const unsigned char groupLastPadsThreshold=2, const unsigned int groupPadsSectorEdges=0, const unsigned short cru=0, const unsigned char overlapRows=0, const unsigned char overlapPads=0)
void drawGrouping(const std::string filename="")
IDCAverageGroup(const std::array< unsigned char, Mapper::NREGIONS > &groupPads={1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, const std::array< unsigned char, Mapper::NREGIONS > &groupRows={1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, const std::array< unsigned char, Mapper::NREGIONS > &groupLastRowsThreshold={}, const std::array< unsigned char, Mapper::NREGIONS > &groupLastPadsThreshold={}, const unsigned int groupPadsSectorEdges=0, const unsigned char overlapRows=0, const unsigned char overlapPads=0)
const auto & getIDCGroup() const
void processIDCs(const CalDet< PadFlags > *padStatusFlags=nullptr)
const auto & getIDCsUngrouped() const
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint const GLchar * name
Definition glcorearb.h:781
Global TPC definitions and constants.
Definition SimTraits.h:167
unsigned short GlobalPadNumber
global pad number
Definition Defs.h:129
std::string filename()