Project
Loading...
Searching...
No Matches
TriggerMappingErrors.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 ALICEO2_EMCAL_TRIGGERMAPPINGERRORS_H
13#define ALICEO2_EMCAL_TRIGGERMAPPINGERRORS_H
14
15#include <exception>
16#include <string>
17
18namespace o2
19{
20
21namespace emcal
22{
23
27class TRUIndexException : public std::exception
28{
29 public:
32 TRUIndexException(unsigned int truindex) : std::exception(), mTRUIndex(truindex), mErrorMessage()
33 {
34 mErrorMessage = "Invalid TRU Index: " + std::to_string(truindex);
35 }
36
38 ~TRUIndexException() noexcept final = default;
39
42 const char* what() const noexcept final
43 {
44 return mErrorMessage.data();
45 }
46
49 unsigned int getTRUIndex() const noexcept { return mTRUIndex; }
50
51 private:
52 std::string mErrorMessage;
53 unsigned int mTRUIndex;
54};
55
59class FastORIndexException : public std::exception
60{
61 public:
64 FastORIndexException(unsigned int fastorindex) : std::exception(), mFastORIndex(fastorindex), mErrorMessage()
65 {
66 mErrorMessage = "Invalid FastOR Index: " + std::to_string(fastorindex);
67 }
68
70 ~FastORIndexException() noexcept final = default;
71
74 const char* what() const noexcept final
75 {
76 return mErrorMessage.data();
77 }
78
81 unsigned int getFastORIndex() const noexcept { return mFastORIndex; }
82
83 private:
84 std::string mErrorMessage;
85 unsigned int mFastORIndex;
86};
87
91class FastORPositionExceptionTRU : public std::exception
92{
93 public:
98 FastORPositionExceptionTRU(unsigned int truID, unsigned int etaColumn, unsigned int phiRow) : std::exception(),
99 mErrorMessage(),
100 mTRUID(truID),
101 mEtaColumn(etaColumn),
102 mPhiRow(phiRow)
103 {
104 mErrorMessage = "Invalid FastOR position in TRU " + std::to_string(truID) + ": eta = " + std::to_string(etaColumn) + ", phi = " + std::to_string(phiRow) + ")";
105 }
106
108 ~FastORPositionExceptionTRU() noexcept final = default;
109
112 const char* what() const noexcept final
113 {
114 return mErrorMessage.data();
115 }
116
119 unsigned int getTRUID() const noexcept { return mTRUID; }
120
123 unsigned int getFastOREtaColumn() const noexcept { return mEtaColumn; }
124
127 unsigned int getFastORPhiRow() const noexcept { return mPhiRow; }
128
129 private:
130 std::string mErrorMessage;
131 unsigned int mTRUID;
132 unsigned int mEtaColumn;
133 unsigned int mPhiRow;
134};
135
139class FastORPositionExceptionSupermodule : public std::exception
140{
141 public:
146 FastORPositionExceptionSupermodule(unsigned int supermoduleID, unsigned int etaColumn, unsigned int phiRow) : std::exception(),
147 mErrorMessage(),
148 mSupermoduleID(supermoduleID),
149 mEtaColumn(etaColumn),
150 mPhiRow(phiRow)
151 {
152 mErrorMessage = "Invalid FastOR position in supermodule " + std::to_string(supermoduleID) + ": eta = " + std::to_string(etaColumn) + ", phi = " + std::to_string(phiRow) + ")";
153 }
154
156 ~FastORPositionExceptionSupermodule() noexcept final = default;
157
160 const char* what() const noexcept final
161 {
162 return mErrorMessage.data();
163 }
164
167 unsigned int getSupermoduleID() const noexcept { return mSupermoduleID; }
168
171 unsigned int getFastOREtaColumn() const noexcept { return mEtaColumn; }
172
175 unsigned int getFastORPhiRow() const noexcept { return mPhiRow; }
176
177 private:
178 std::string mErrorMessage;
179 unsigned int mSupermoduleID;
180 unsigned int mEtaColumn;
181 unsigned int mPhiRow;
182};
183
187class FastORPositionExceptionEMCAL : public std::exception
188{
189 public:
193 FastORPositionExceptionEMCAL(unsigned int etaColumn, unsigned int phiRow) : std::exception(), mErrorMessage(), mEtaColumn(etaColumn), mPhiRow(phiRow)
194 {
195 mErrorMessage = "Invalid FastOR position: eta = " + std::to_string(etaColumn) + ", phi = " + std::to_string(phiRow) + ")";
196 }
197
199 ~FastORPositionExceptionEMCAL() noexcept final = default;
200
203 const char* what() const noexcept final
204 {
205 return mErrorMessage.data();
206 }
207
210 unsigned int getFastOREtaColumn() const noexcept { return mEtaColumn; }
211
214 unsigned int getFastORPhiRow() const noexcept { return mPhiRow; }
215
216 private:
217 std::string mErrorMessage;
218 unsigned int mEtaColumn;
219 unsigned int mPhiRow;
220};
221
225class PHOSRegionException : public std::exception
226{
227 public:
230 PHOSRegionException(unsigned int phosregion) : std::exception(), mErrorMessage(), mPHOSRegion(phosregion)
231 {
232 mErrorMessage = "Invalid PHOS region: " + std::to_string(phosregion);
233 }
234
236 ~PHOSRegionException() noexcept final = default;
237
240 const char* what() const noexcept final
241 {
242 return mErrorMessage.data();
243 }
244
247 unsigned int getPHOSRegion() const noexcept { return mPHOSRegion; }
248
249 private:
250 std::string mErrorMessage;
251 unsigned int mPHOSRegion;
252};
253
257class GeometryNotSetException : public std::exception
258{
259 public:
262
264 ~GeometryNotSetException() noexcept final = default;
265
268 const char* what() const noexcept final
269 {
270 return "Geometry not available";
271 }
272};
273
277class L0sizeInvalidException : public std::exception
278{
279 public:
282 L0sizeInvalidException(unsigned int l0size) : std::exception(), mErrorMessage(), mL0size(l0size)
283 {
284 mErrorMessage = "L0 patch size invalid: " + std::to_string(l0size);
285 }
286
288 ~L0sizeInvalidException() noexcept final = default;
289
292 const char* what() const noexcept final
293 {
294 return mErrorMessage.data();
295 }
296
299 unsigned int getL0size() const noexcept { return mL0size; }
300
301 private:
302 std::string mErrorMessage;
303 unsigned int mL0size;
304};
305
306} // namespace emcal
307
308} // namespace o2
309
310#endif // ALICEO2_EMCAL_TRIGGERMAPPINGERRORS_H
Error handling of faulty FastOR indices.
unsigned int getFastORIndex() const noexcept
Get the index of the FastOR raising the exception.
~FastORIndexException() noexcept final=default
Destructor.
FastORIndexException(unsigned int fastorindex)
Constructor.
const char * what() const noexcept final
Get error message.
Handling of invalid positions of a FastOR in the detector.
FastORPositionExceptionEMCAL(unsigned int etaColumn, unsigned int phiRow)
Constructor.
unsigned int getFastORPhiRow() const noexcept
Get the row in phi of the FastOR with the invalid position.
const char * what() const noexcept final
Get error message.
unsigned int getFastOREtaColumn() const noexcept
Get the column in eta of the FastOR with the invalid position.
~FastORPositionExceptionEMCAL() noexcept final=default
Destructor.
Handling of invalid positions of a FastOR within a supermodule.
~FastORPositionExceptionSupermodule() noexcept final=default
Destructor.
FastORPositionExceptionSupermodule(unsigned int supermoduleID, unsigned int etaColumn, unsigned int phiRow)
Constructor.
unsigned int getFastOREtaColumn() const noexcept
Get the column in eta of the FastOR with the invalid position.
const char * what() const noexcept final
Get error message.
unsigned int getFastORPhiRow() const noexcept
Get the row in phi of the FastOR with the invalid position.
unsigned int getSupermoduleID() const noexcept
Get the supermodule ID for which the position is invalid.
Handling of invalid positions of a FastOR within a TRU.
const char * what() const noexcept final
Get error message.
unsigned int getFastOREtaColumn() const noexcept
Get the column in eta of the FastOR with the invalid position.
unsigned int getFastORPhiRow() const noexcept
Get the row in phi of the FastOR with the invalid position.
~FastORPositionExceptionTRU() noexcept final=default
Destructor.
unsigned int getTRUID() const noexcept
Get the TRU ID for which the position is invalid.
FastORPositionExceptionTRU(unsigned int truID, unsigned int etaColumn, unsigned int phiRow)
Constructor.
Handling cases where the geometry is required but not defined.
const char * what() const noexcept final
Access to error message.
GeometryNotSetException()=default
Constructor.
~GeometryNotSetException() noexcept final=default
Destructor.
Handlig access of L0 index mapping with invalid patch size.
unsigned int getL0size() const noexcept
Get the size of the L0 patch.
~L0sizeInvalidException() noexcept final=default
Destructor.
const char * what() const noexcept final
Access to error message.
L0sizeInvalidException(unsigned int l0size)
Constructor.
Handling of invalid PHOS regions.
unsigned int getPHOSRegion() const noexcept
Get index of the PHOS region.
PHOSRegionException(unsigned int phosregion)
Constructor.
~PHOSRegionException() noexcept final=default
Destructor.
const char * what() const noexcept final
Get error message.
Error handling of faulty TRU indices.
const char * what() const noexcept final
Get error message.
~TRUIndexException() noexcept final=default
Destructor.
unsigned int getTRUIndex() const noexcept
Get the index of the TRU raising the exception.
TRUIndexException(unsigned int truindex)
Constructor.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52