ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_RodDecoderErrorsHelper Class Reference

allows to accumulate errors in one fillColection call More...

#include <ITkStripsRodDecoder.h>

Collaboration diagram for SCT_RodDecoderErrorsHelper:

Public Member Functions

 SCT_RodDecoderErrorsHelper (IDCInDetBSErrContainer &idcContainer)
 ~SCT_RodDecoderErrorsHelper ()
void noerror (const IdentifierHash id)
void add (const IdentifierHash id, SCT_ByteStreamErrors::ErrorType etype)
void removeIfEmpty (const IdentifierHash id)
 SCT_RodDecoderErrorsHelper (IDCInDetBSErrContainer &idcContainer)
 ~SCT_RodDecoderErrorsHelper ()
void noerror (const IdentifierHash id)
void add (const IdentifierHash id, SCT_ByteStreamErrors::ErrorType etype)
void removeIfEmpty (const IdentifierHash id)

Public Attributes

std::map< IdentifierHash, IDCInDetBSErrContainer::ErrorCodeaccumulatedErrors
IDCInDetBSErrContainererrorsIDC

Detailed Description

allows to accumulate errors in one fillColection call

Errors information is scattered across this code. To be sure that all of the errors are saved this helper class provides add method allowing to update/accumulate erorr. The IDC, for a very good reasons (MT safety) do not allow for that.

Definition at line 38 of file ITkStripsRodDecoder.h.

Constructor & Destructor Documentation

◆ SCT_RodDecoderErrorsHelper() [1/2]

SCT_RodDecoderErrorsHelper::SCT_RodDecoderErrorsHelper ( IDCInDetBSErrContainer & idcContainer)
inline

Definition at line 40 of file ITkStripsRodDecoder.h.

41 : errorsIDC{ idcContainer } {}
IDCInDetBSErrContainer & errorsIDC

◆ ~SCT_RodDecoderErrorsHelper() [1/2]

SCT_RodDecoderErrorsHelper::~SCT_RodDecoderErrorsHelper ( )
inline

Definition at line 42 of file ITkStripsRodDecoder.h.

42 {
43 for (auto [id, err]: accumulatedErrors) {
44 errorsIDC.setOrDrop(id, err);
45 }
46 }
std::map< IdentifierHash, IDCInDetBSErrContainer::ErrorCode > accumulatedErrors

◆ SCT_RodDecoderErrorsHelper() [2/2]

SCT_RodDecoderErrorsHelper::SCT_RodDecoderErrorsHelper ( IDCInDetBSErrContainer & idcContainer)
inline

Definition at line 43 of file SCT_RodDecoder.h.

44 : errorsIDC{ idcContainer } {}

◆ ~SCT_RodDecoderErrorsHelper() [2/2]

SCT_RodDecoderErrorsHelper::~SCT_RodDecoderErrorsHelper ( )
inline

Definition at line 45 of file SCT_RodDecoder.h.

45 {
46 for (auto [id, err]: accumulatedErrors) {
47 errorsIDC.setOrDrop(id, err);
48 }
49 }

Member Function Documentation

◆ add() [1/2]

void SCT_RodDecoderErrorsHelper::add ( const IdentifierHash id,
SCT_ByteStreamErrors::ErrorType etype )
inline

Definition at line 51 of file ITkStripsRodDecoder.h.

51 {
53 }
void addError(IDCInDetBSErrContainer::ErrorCode &errWord, ErrorType errType)

◆ add() [2/2]

void SCT_RodDecoderErrorsHelper::add ( const IdentifierHash id,
SCT_ByteStreamErrors::ErrorType etype )
inline

Definition at line 54 of file SCT_RodDecoder.h.

◆ noerror() [1/2]

void SCT_RodDecoderErrorsHelper::noerror ( const IdentifierHash id)
inline

Definition at line 47 of file ITkStripsRodDecoder.h.

47 {
48 accumulatedErrors[id]; // this adds 0 (no error) for an ID
49 }

◆ noerror() [2/2]

void SCT_RodDecoderErrorsHelper::noerror ( const IdentifierHash id)
inline

Definition at line 50 of file SCT_RodDecoder.h.

50 {
51 accumulatedErrors[id]; // this adds 0 (no error) for an ID
52 }

◆ removeIfEmpty() [1/2]

void SCT_RodDecoderErrorsHelper::removeIfEmpty ( const IdentifierHash id)
inline

Definition at line 55 of file ITkStripsRodDecoder.h.

55 {
56 if (accumulatedErrors[id]==0) {
57 accumulatedErrors.erase(id);
58 }
59 }

◆ removeIfEmpty() [2/2]

void SCT_RodDecoderErrorsHelper::removeIfEmpty ( const IdentifierHash id)
inline

Definition at line 58 of file SCT_RodDecoder.h.

58 {
59 if (accumulatedErrors[id]==0) {
60 accumulatedErrors.erase(id);
61 }
62 }

Member Data Documentation

◆ accumulatedErrors

std::map< IdentifierHash, IDCInDetBSErrContainer::ErrorCode > SCT_RodDecoderErrorsHelper::accumulatedErrors

Definition at line 61 of file ITkStripsRodDecoder.h.

◆ errorsIDC

IDCInDetBSErrContainer & SCT_RodDecoderErrorsHelper::errorsIDC

Definition at line 62 of file ITkStripsRodDecoder.h.


The documentation for this class was generated from the following files: