23 m_all_febs.insert(
id.get_identifier32().get_compact());
81 return StatusCode::SUCCESS ;
93 ATH_CHECK( febErrorSummary.
record (std::make_unique<LArFebErrorSummary>()) );
102 unsigned int nbSamplesFirst=0;
103 uint32_t eventTypeFirst = 999;
105 ATH_MSG_DEBUG(
" LArFebHeaderContainer Size = "<< hdrCont->size() );
107 std::set<unsigned int> all_febs;
114 int nbOfFebsInError = 0;
116 for (
const auto*
const it : *hdrCont) {
122 all_febs.erase(int_id);
128 uint32_t rodstatus = it->RodStatus();
130 const std::vector<uint16_t>& sca = it->SCA();
132 uint32_t eventType = it->DetEventType();
135 bool typeMism =
false;
137 if (eventTypeFirst == 999)
138 eventTypeFirst = eventType;
139 if (eventType != eventTypeFirst)
142 std::bitset<32> rodstatusbits(rodstatus);
144 bool scaOutOfRange =
false;
145 bool badNbOfSp =
false;
147 bool checkSumErr =
false;
151 if (nbSamplesFirst == 0) {
153 if (eventType == 2 && (!sca.empty()))
154 nbSamplesFirst = sca.size();
156 if (eventType == 4 && (it->NbSamples() != 0))
157 nbSamplesFirst = it->NbSamples();
160 if (eventType == 2) {
161 if (nbSamplesFirst != sca.size() && !sca.empty())
163 for (
unsigned int i = 0; i < sca.size(); ++i) {
165 scaOutOfRange =
true;
168 if (eventType == 4 && (nbSamplesFirst != it->NbSamples()) && (it->NbSamples() != 0))
172 if (eventType == 2 && sca.empty())
174 if (eventType == 4 && (it->RodResults1Size() == 0))
178 if (!it->ChecksumVerification())
180 if (eventType == 4) {
182 if ((it->FormatVersion() & 0xF) <= 11)
183 expSize1 = it->NbSweetCells1() + 83 + (int)ceilf((it->NbSamples() + 1) / 2.0);
184 if ((it->FormatVersion() & 0xF) >= 12)
185 expSize1 = it->NbSweetCells1() + 84 + (int)ceilf((it->NbSamples() + 1) / 2.0);
186 if (expSize1 != it->RodResults1Size()) {
189 int nbOf32bits = (it->NbSweetCells2() * it->NbSamples() + 1) / 2.0;
190 if (nbOf32bits != it->RodResults2Size()) {
204 if (rodstatusbits[6])
207 if (rodstatusbits[2] || rodstatusbits[7])
210 if (rodstatusbits[3] || rodstatusbits[8])
222 if (rodstatusbits[5])
225 if (rodstatusbits[24])
245 if (err_toignore > 0) {
246 uint16_t erri = (uint16_t)(err_toignore);
247 errw = errw & (~erri);
254 if (errw & (1 << i)) {
257 ++(m_errsPerFeb[int_id]);
260 ATH_MSG_DEBUG(std::format(
" Error for this FEB id {:#x} is {:#x}",int_id,errw));
262 if (!febErrorSummary->set_feb_error(int_id, errw)) {
264 ATH_MSG_DEBUG(
" failed to insert the error into LArFebErrorSummary " << std::hex << febid << std::dec);
270 nbOfFebsInError += 1;
278 for (
auto it : all_febs) {
282 ATH_MSG_DEBUG(
" This FEB is not read out 0x" << std::hex << it << std::dec);
289 const std::string bec =
m_onlineHelper->barrel_ec(febid) == 0 ?
"BARREL/" :
"ENDCAP/";
290 const std::string side =
m_onlineHelper->pos_neg(febid) == 0 ?
"C/" :
"A/";
294 febErrorSummary->set_feb_error(it, errw);
315 return StatusCode::SUCCESS;
321 return v_feb.find(hid) != v_feb.end();
327 ATH_MSG_INFO(
" In finalize: Number of Errors for each type" );
334 for (
auto feb_err : m_errsPerFeb) {
339 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
LArBadXCont< LArBadFeb > LArBadFebCont
Handle class for adding a decoration to an object.
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
unsigned int ignoreErrors() const
bool deadAll() const
FEB is completely missing, e.g. powered off.
bool deactivatedInOKS() const
Deactivated in OKS.
bool inError() const
FEB has readout errors, cannot be used.
bool deadReadout() const
FEB is not sending readout data, but the L1 trigger path is working.
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
std::set< unsigned int > m_all_febs
static bool masked(unsigned int hid, const std::set< unsigned int > &v_feb)
virtual StatusCode initialize() override final
Gaudi::Property< int > m_warnLimit
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::ReadCondHandleKey< LArBadFebCont > m_bfKey
const LArOnlineID * m_onlineHelper
Gaudi::Property< std::set< unsigned int > > m_knownZeroSample
std::atomic< int > m_missingFebsWarns
SG::WriteDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
Gaudi::Property< int > m_minFebsInError
Minimum number of FEBs in error to trigger EventInfo::LArError Defined as 1 by default/bulk,...
Gaudi::Property< std::set< unsigned int > > m_knownSCACStatus
SG::ReadHandleKey< LArFebHeaderContainer > m_readKey
Gaudi::Property< std::set< unsigned int > > m_knownEvtId
Gaudi::Property< bool > m_checkAllFeb
SG::WriteHandleKey< LArFebErrorSummary > m_writeKey
virtual StatusCode finalize() override final
virtual StatusCode execute(const EventContext &ctx) const override final
Gaudi::Property< std::string > m_partition
static std::string error_to_string(uint16_t error)
interpret the error in string
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())