ATLAS Offline Software
Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #pragma once
6 #ifndef TRIGINTERFACES_ENUMS_H
7 #define TRIGINTERFACES_ENUMS_H
8 
9 #include <vector>
10 #include <string>
11 #include <stdint.h>
12 
13 namespace HLT {
14  struct Action {
15  typedef enum {
16  CONTINUE = 0,
19  ABORT_JOB = 3,
20  UNSPECIFIED_ = -1
21 
22  } Code;
23  };
24 
25  struct Reason {
26  typedef enum {
38 
43  LAST_ =0xf,
44  UNSPECIFIED_ = -1
45  } Code;
46  };
47 
48 
49 
50 
52  typedef enum {
53  UNKNOWN=0,
61  BUSY,
67  UNSPECIFIED_ = -1
68  } Code;
69  };
70 
80  class ErrorCode {
81  public:
82  ErrorCode();
85 
86 
89 
92 
94 
95  // comapricon operators
96  bool operator==(const ErrorCode& ec) const;
97  bool operator!=(const ErrorCode& ec) const;
98 
99  bool operator<(const ErrorCode& ec) const;
100  bool operator>(const ErrorCode& ec) const;
101 
102  // conversions
103  operator uint32_t() const {return code;}
104 
105  // bool operator<(const ErrorCode& e1, const ErrorCode& e2 ) {return e1.code & 0x3;}// < e.code &0x3; }
106  Action::Code action() const;
107  Reason::Code reason() const;
109 
110  std::string str();
111 
113  };
114 
115  std::string strErrorCode(const ErrorCode code);
116  // const std::string& str(const Reason::Code code) { return "U"; }
117 
118 
119  //bunch of defines for backward compatibility
120  static const ErrorCode OK(Action::CONTINUE);
121  static const ErrorCode MISSING_FEATURE (Action::CONTINUE, Reason::MISSING_FEATURE);
122  static const ErrorCode STOP_THIS_CHAIN_ (Action::CONTINUE, Reason::MISSING_FEATURE);
123 
124  static const ErrorCode ERROR (Action::ABORT_CHAIN, Reason::UNKNOWN);
125  static const ErrorCode INVALID_TE (Action::ABORT_CHAIN, Reason::UNKNOWN);
126  static const ErrorCode TOOL_FAILURE (Action::ABORT_CHAIN, Reason::UNKNOWN);
127  static const ErrorCode NUM_ERROR (Action::ABORT_CHAIN, Reason::UNKNOWN);
128  static const ErrorCode SG_ERROR (Action::ABORT_CHAIN, Reason::NAV_ERROR);
129  static const ErrorCode NAV_ERROR (Action::ABORT_CHAIN, Reason::NAV_ERROR);
130  static const ErrorCode GAUDI_EXCEPTION (Action::ABORT_CHAIN, Reason::GAUDI_EXCEPTION);
131  static const ErrorCode EFORMAT_EXCEPTION (Action::ABORT_CHAIN, Reason::EFORMAT_EXCEPTION);
132  static const ErrorCode STD_EXCEPTION (Action::ABORT_CHAIN, Reason::STD_EXCEPTION);
133  static const ErrorCode UNKNOWN_EXCEPTION (Action::ABORT_CHAIN, Reason::UNKNOWN_EXCEPTION);
135  static const ErrorCode STOP_EVENT_ (Action::ABORT_EVENT);
136 
142 
143  static const ErrorCode STOP_JOB_ (Action::ABORT_JOB);
144  static const ErrorCode BAD_JOB_SETUP (Action::ABORT_JOB, Reason::BAD_JOB_SETUP);
145  static const ErrorCode BAD_ALGO_CONFIG (Action::ABORT_JOB, Reason::BAD_JOB_SETUP);
146  static const ErrorCode FATAL (Action::ABORT_JOB, Reason::UNKNOWN);
148 
149 
150  // keep order so that worst is most right!
151  /* enum ErrorCode {
152  OK=0, MISSING_FEATURE,
153  STOP_THIS_CHAIN_,
154  ERROR,
155  INVALID_TE, TOOL_FAILURE,
156  NUM_ERROR, SG_ERROR, NAV_ERROR,
157  GAUDI_EXCEPTION, EFORMAT_EXCEPTION, STD_EXCEPTION, UNKNOWN_EXCEPTION, // bunch of exceptions we handle
158  STOP_EVENT_,
159  NO_LVL1_ITEMS, NO_LVL2_CHAINS,
160  NO_LVL1_RESULT, WRONG_HLT_RESULT, NO_HLT_RESULT,
161  TIMEOUT,
162  STOP_JOB_,
163  BAD_JOB_SETUP, BAD_ALGO_CONFIG, FATAL, LAST_ERROR };
164 
165 
166  const std::string& strErrorCode( ErrorCode ec );
167  */
168  // search for the ErrorCode and return the position. return -1 if it can not be found.
169  int getErrorCodePosFromStr(const std::string& ec);
170 
172 
173  enum HLTLevel { L2 = 0, EF, HLT, UNKNOWN };
174 
175 }
176 
177 
178 
179 // definitions
183 
184 
186 inline HLT::ErrorCode::ErrorCode(const HLT::ErrorCode c, HLT::Reason::Code r) { code = c.code; code &= 0x30; code |= r; }
187 
190 
192 
193 // comapricon operators
194 inline bool HLT::ErrorCode::operator==(const HLT::ErrorCode& ec) const { return uint32_t(*this) == uint32_t(ec); }
195 inline bool HLT::ErrorCode::operator!=(const HLT::ErrorCode& ec) const { return !(*this == ec); }
196 
197 inline bool HLT::ErrorCode::operator<(const HLT::ErrorCode& ec) const { return uint32_t(*this) < uint32_t(ec); }
198 inline bool HLT::ErrorCode::operator>(const HLT::ErrorCode& ec) const { return !(*this<ec) && !(*this == ec); }
199 
200 // conversions
201 //HLT::ErrorCode::operator uint32_t() const { return code; }
202 
203 // bool operator<(const ErrorCode& e1, const ErrorCode& e2 ) {return e1.code & 0x3;}// < e.code &0x3; }
207 
208 
209 
210 #endif
HLT::Reason::MISSING_ROD
@ MISSING_ROD
while unpacking detector data ROD fragment is missing
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:34
HLT::SteeringInternalReason::UNKNOWN
@ UNKNOWN
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:53
beamspotman.r
def r
Definition: beamspotman.py:676
HLT::Reason::NAV_ERROR
@ NAV_ERROR
suspected Navigation error
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:33
HLT::SteeringInternalReason::NO_LVL1_ITEMS
@ NO_LVL1_ITEMS
in the LVL1 result delivered to LVL2 none of LVL1 items are present, that means no seeding informatio...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:54
HLT::ErrorCode::action
Action::Code action() const
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:204
HLT::Reason::GAUDI_EXCEPTION
@ GAUDI_EXCEPTION
GAUDI exception was caught.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:29
HLT::Reason::Code
Code
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:26
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
HLT::Reason::USERDEF_2
@ USERDEF_2
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:40
HLT::Reason::USERDEF_3
@ USERDEF_3
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:41
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
HLT::SteeringInternalReason::WRONG_HLT_RESULT
@ WRONG_HLT_RESULT
error while unpacking HLT reult (happnes at EF when LVL2 result is unpacked)
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:57
HLT::Action::ABORT_EVENT
@ ABORT_EVENT
if things went wrong severely, event corruption suspected
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:18
HLT::ErrorCode
The definition of error codes in HLT. This is a class (note; before was simple enum) to enable safer ...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:80
HLT::Action::ABORT_JOB
@ ABORT_JOB
if things go really wrong, i.e.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:19
HLT::SteeringInternalReason::Code
Code
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:52
HLT::SteeringInternalReason::NO_LVL2_CHAINS
@ NO_LVL2_CHAINS
in the LVL2 result unpacked at EF no active LVL2 chains are present, that means no seeding informatio...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:55
HLT::SteeringInternalReason::MISSING_OTHER_ROI
@ MISSING_OTHER_ROI
one ore more missing RoI except CALO/MUON (e.g.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:65
HLT::SteeringInternalReason
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:51
HLT::SteeringInternalReason::NO_HLT_RESULT
@ NO_HLT_RESULT
no HLT result is present (means that LVL2 result was not delivered to EF)
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:58
HLT::Reason::EFORMAT_EXCEPTION
@ EFORMAT_EXCEPTION
eformat exception was caught
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:30
HLT::Reason::CORRUPTED_ROD
@ CORRUPTED_ROD
ROD with the detector data seems to be corrupted.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:35
HLT::SteeringInternalReason::MISSING_MUON_ROI
@ MISSING_MUON_ROI
one ore more missing MUON RoIs
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:64
HLT::SteeringInternalReason::TIMEOUT
@ TIMEOUT
timeout forced by the steering
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:60
HLT::Action
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:14
HLT::SteeringInternalReason::BUSY
@ BUSY
to flag that the event was busy
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:61
HLT::ErrorCode::str
std::string str()
Definition: Enums.cxx:134
HLT::SteeringInternalReason::ALGO_ERROR
@ ALGO_ERROR
algorithms returned errors
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:59
HLT::Reason::UNSPECIFIED_
@ UNSPECIFIED_
do not use
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:44
HLT::Action::UNSPECIFIED_
@ UNSPECIFIED_
do not use
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:20
HLT::UNKNOWN
@ UNKNOWN
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:173
HLT::ErrorCode::code
uint32_t code
storage of error code where 4 least significant bits(0-3) are storing Reason, 2 next (4-5) are for Ac...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:112
HLT::strErrorCode
std::string strErrorCode(const ErrorCode code)
Definition: Enums.cxx:99
HLT::ErrorCode::operator==
bool operator==(const ErrorCode &ec) const
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:194
histSizes.code
code
Definition: histSizes.py:129
HLT::EF
@ EF
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:173
HLT::Reason::UNKNOWN
@ UNKNOWN
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:27
HLT::ErrorCode::operator<
bool operator<(const ErrorCode &ec) const
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:197
HLT::L2
@ L2
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:173
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
HLT::ErrorCode::ErrorCode
ErrorCode()
for algo developers
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:180
HLT::Reason::BAD_JOB_SETUP
@ BAD_JOB_SETUP
the job is possibly badly configured (2 places where this can occur: configuration,...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:37
HLT::SteeringInternalReason::LAST_
@ LAST_
there is basically no restriction on size since these errors are not saved per chain so do not need t...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:66
HLT::SteeringInternalReason::BAD_JOB_SETUP
@ BAD_JOB_SETUP
job is badly configured
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:62
HLT::getErrorCodePosFromStr
int getErrorCodePosFromStr(const std::string &ec)
Definition: Enums.cxx:105
HLT::ErrorCode::reason
Reason::Code reason() const
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:205
HLT::Reason::TIMEOUT
@ TIMEOUT
the timeout occured
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:36
HLT::Action::Code
Code
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:15
HLT::Action::ABORT_CHAIN
@ ABORT_CHAIN
if things went wrong but it is not severe, other unrelated chains will continue
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:17
HLT::ErrorCode::operator>
bool operator>(const ErrorCode &ec) const
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:198
HLT::Reason::STD_EXCEPTION
@ STD_EXCEPTION
std exeption was caught
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:31
HLT::Reason::UNKNOWN_EXCEPTION
@ UNKNOWN_EXCEPTION
unknown exception thrown
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:32
HLT::ErrorCode::steeringInternalReason
SteeringInternalReason::Code steeringInternalReason() const
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:206
HLT::Action::CONTINUE
@ CONTINUE
if all is OK the processing should be continued
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:16
HLT::Reason::LAST_
@ LAST_
and can't be higher because of serialization in the chain
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:43
HLT::Reason::USERDEF_1
@ USERDEF_1
this is custom user defined code: for clarity users should define consts i.e.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:39
a
TList * a
Definition: liststreamerinfos.cxx:10
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
HLT::Reason::MISSING_FEATURE
@ MISSING_FEATURE
the feataure was expected but could not be found
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:28
HLT::SteeringInternalReason::MISSING_CALO_ROI
@ MISSING_CALO_ROI
one ore more missing CALO RoIs
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:63
HLT::Reason::USERDEF_4
@ USERDEF_4
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:42
HLT::HLT
@ HLT
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:173
HLT::SteeringInternalReason::UNSPECIFIED_
@ UNSPECIFIED_
do not use
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:67
HLT::reportErrorCode
void reportErrorCode(ErrorCode &e1, ErrorCode e2)
HLT::ErrorCode::operator!=
bool operator!=(const ErrorCode &ec) const
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:195
python.compressB64.c
def c
Definition: compressB64.py:93
HLT::Reason
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:25
HLT::HLTLevel
HLTLevel
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:173
HLT::SteeringInternalReason::NO_LVL1_RESULT
@ NO_LVL1_RESULT
LVL1 result is missing.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:56