Project
Loading...
Searching...
No Matches
PedestalProcessorDevice.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
12#ifndef EMCAL_PEDESTAL_PROCESSOR_DEVICE_H_
13#define EMCAL_PEDESTAL_PROCESSOR_DEVICE_H_
14
15#include <memory>
16#include <vector>
17
19#include "Framework/Task.h"
20#include "EMCALBase/Mapper.h"
22
23namespace o2::emcal
24{
25
26class Geometry;
27
34{
35 private:
38 class ModuleIndexException : public std::exception
39 {
40 public:
43 enum class ModuleType_t {
44 CELL_MODULE,
45 LEDMON_MODULE
46 };
47
54 ModuleIndexException(int moduleIndex, int column, int row, int columnshifted, int rowshifted) : mModuleType(ModuleType_t::CELL_MODULE),
55 mIndex(moduleIndex),
56 mColumn(column),
57 mRow(row),
58 mColumnShifted(columnshifted),
59 mRowShifted(rowshifted) {}
60
63 ModuleIndexException(int moduleIndex) : mModuleType(ModuleType_t::LEDMON_MODULE), mIndex(moduleIndex) {}
64
66 ~ModuleIndexException() noexcept final = default;
67
70 const char* what() const noexcept final { return "Invalid cell / LEDMON index"; }
71
74 ModuleType_t getModuleType() const { return mModuleType; }
75
78 int getIndex() const { return mIndex; }
79
82 int getColumn() const { return mColumn; }
83
86 int getRow() const { return mRow; }
87
90 int getColumnShifted() const { return mColumnShifted; }
91
94 int getRowShifted() const { return mRowShifted; }
95
96 private:
97 ModuleType_t mModuleType;
98 int mIndex = -1;
99 int mColumn = -1;
100 int mRow = -1;
101 int mColumnShifted = -1;
102 int mRowShifted = -1;
103 };
104
105 Geometry* mGeometry = nullptr;
106 std::unique_ptr<MappingHandler> mMapper = nullptr;
107 PedestalProcessorData mPedestalData;
108
109 protected:
110 int getCellAbsID(int supermoduleID, int column, int row) const;
111 int geLEDMONAbsID(int supermoduleID, int moduleID) const;
112
113 public:
115 ~PedestalProcessorDevice() final = default;
116
117 void init(framework::InitContext& ctx) final;
118
119 void run(framework::ProcessingContext& ctx) final;
120
122
124};
125
127
128} // namespace o2::emcal
129
130#endif
o2::mid::ColumnData & getColumn(std::vector< o2::mid::ColumnData > &patterns, uint8_t icolumn, uint8_t deId)
EMCAL geometry definition.
Definition Geometry.h:40
Exchange container between PedestalProcessorDevice and PedestalAggregatorDevice.
Processor part of the EMCAL pedestal calibration workflow.
int getCellAbsID(int supermoduleID, int column, int row) const
bool isLostTimeframe(framework::ProcessingContext &ctx) const
void init(framework::InitContext &ctx) final
~PedestalProcessorDevice() final=default
void run(framework::ProcessingContext &ctx) final
int geLEDMONAbsID(int supermoduleID, int moduleID) const
void sendData(framework::ProcessingContext &ctx, const PedestalProcessorData &data) const
GLboolean * data
Definition glcorearb.h:298
framework::DataProcessorSpec getPedestalProcessorDevice(bool askDistSTF)
std::vector< int > row