 |
ATLAS Offline Software
|
Go to the documentation of this file.
34 if (element->swapPhiReadoutDirection()) {
39 return StatusCode::SUCCESS;
48 const std::vector<IdentifierHash>* vecHash)
const
61 const unsigned long int vecROBDataSize{robFrag.rod_ndata()};
63 robFrag.rod_data(vecROBData);
66 const uint8_t* vecROBData_8bits =
reinterpret_cast<const uint8_t*
>(vecROBData);
67 const size_t total_bytes = vecROBDataSize *
sizeof(
uint32_t);
69 for (
size_t i = 0;
i + 9 < total_bytes;
i += 10) {
84 if (hasError)
sc = StatusCode::RECOVERABLE;
90 for (
int j = 0; j < 4; ++j) {
91 uint16_t cluster = (vecROBData_8bits[
i + 2 + j * 2] << 8) | vecROBData_8bits[
i + 3 + j * 2];
92 if (cluster == 0x7FFF){
99 if (
data.isStripValid()) {
100 if (not
data.isSaved(
false) and
data.isOldStripValid()) {
101 const int rdoMade{
makeRDO(
false,
data, cache, dataItemsPool)};
103 sc = StatusCode::RECOVERABLE;
107 data.setSaved(
false, rdoMade);
112 for (
auto& [
hash, rdoColl] :
data.rdoCollMap) {
113 if (rdoColl==
nullptr)
continue;
115 if (rdoColl->empty()) {
117 errs.removeIfEmpty(
hash);
124 if (
sc.isFailure())
ATH_MSG_DEBUG(
"One or more ByteStream errors found ");
137 if (rdoColl==
nullptr)
return 0;
142 <<
" in collection " <<
data.linkIDHash <<
" out of range. Will not make RDO");
155 std::vector<IdentifierHash>::const_iterator hashIDIterator{
find(cache.
vecHash->begin(),
158 if (hashIDIterator == cache.
vecHash->end()) {
180 const unsigned int rawDataWord{
static_cast<unsigned int>(
data.groupSize | (
strip << 11) | (
data.timeBin <<22) | (
data.errors << 25))};
182 ATH_MSG_DEBUG(
"Output Raw Data " << std::hex <<
" Coll " <<
data.collID.getString()
191 rdoColl->push_back(sct_rdo);
193 rdoColl->push_back(std::make_unique<SCT3_RawData>(digitID, rawDataWord, &(
data.errorHit)));
202 const std::unordered_set<IdentifierHash>* )
const
204 return StatusCode::SUCCESS;
213 return StatusCode::SUCCESS;
225 const EventContext& ctx)
const
229 data.foundHeader =
true;
233 if (
data.isStripValid()) {
234 if (not
data.isSaved(
false) and
data.isOldStripValid()) {
236 const int rdoMade{
makeRDO(
false,
data, cache, dataItemsPool)};
242 data.setSaved(
false, rdoMade);
251 const int rodlinkNumber{
static_cast<int>(inData & 0x7F)};
254 data.linkNumber = (((rodlinkNumber >>4)&0x7)*12+(rodlinkNumber &0xF));
255 const uint32_t onlineID{(robID & 0xFFFFFF) | (
data.linkNumber << 24)};
257 if ((onlineID ==0) or (
data.linkNumber > 95)) {
260 ATH_MSG_DEBUG(
"Header: xxx Link number out of range (skipping following data)"
261 << std::dec <<
data.linkNumber);
267 if (
hash.is_valid()) {
271 std::stringstream
msg;
272 msg <<std::hex << onlineID;
273 ATH_MSG_WARNING(
"Rob fragment (rob=" << robID <<
") with invalid onlineID " <<
msg.str() <<
" -> " <<
hash <<
".");
277 if ((inData >> 7) & 0
x1) {
282 if (inData & 0x800) {
289 if (inData & 0x1000) {
296 if (inData & 0x400) {
303 if (inData & 0x200) {
310 if ((inData & 0xF) > 11) {
316 if (!hasError and not
hash.is_valid()) {
317 std::stringstream
msg;
318 msg <<std::hex << onlineID;
319 ATH_MSG_WARNING(
"Rob fragment (rob=" << robID <<
") with invalid onlineID " <<
msg.str() <<
" -> " <<
hash <<
".");
323 data.condensedMode =
static_cast<bool>(inData & 0x100);
332 bool& hasError)
const
336 if (not
data.foundHeader) {
337 ATH_MSG_WARNING(
" Missing link header in ROD " << std::hex << robID << std::dec);
338 data.foundMissingLinkHeaderError =
true;
344 ATH_MSG_DEBUG(
" xxx Raw Data Mode " << std::hex << inData << std::dec <<
": Config Data Mode ");
def retrieve(aClass, aKey=None)
std::atomic_uint m_headErrorFormatter
Total number of formatter errors in the header data.
char data[hepevt_bytes_allocation_ATLAS]
int makeRDO(const bool isOld, SharedData &data, CacheHelper &cache, DataPool< SCT3_RawData > *dataItemsPool) const
Builds RawData RDO and adds to RDO container.
Temp object to help with trigger caching.
virtual StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, SCT_RDO_Container &rdoIDCont, IDCInDetBSErrContainer &errs, DataPool< SCT3_RawData > *dataItemsPool, const EventContext &ctx, const std::vector< IdentifierHash > *vecHash=nullptr) const override
Fill SCT RDO Collection with decoded ROB data.
StatusCode addSingleError(const IdentifierHash &hashID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs) const
Add single eror.
std::string find(const std::string &s)
return a remapped string
bool is_sct(Identifier id) const
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
StatusCode processHeader(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, CacheHelper &cache, SCT_RodDecoderErrorsHelper &errs, bool &hasError, bool &breakNow, const EventContext &ctx) const
Process header word.
StatusCode addRODError(uint32_t rodID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs, const std::unordered_set< IdentifierHash > *foundHashes=nullptr) const
Add an error for each wafer in the problematic ROD.
std::atomic_uint m_headErrorLvl1ID
Total number of Lvl1ID errors in the header data.
#define ATH_MSG_VERBOSE(x)
IdContext m_contextITk
"Context" of an expanded identifier (ExpandedIdentifier) for compact or hash versions (Identifier32 o...
IdContext wafer_context() const
std::atomic_uint m_headErrorBCID
Total number of BCID errors in the header data.
std::atomic_uint m_nRDOs
Total number of SCT RDOs created.
const SCT_ID * m_itkStripsID
Identifier helper class for the SCT subdetector that creates compact Identifier objects and Identifie...
const DataType * PointerType
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
size_type wafer_hash_max() const
ToolHandle< IITkStripCablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
Struct to hold data shared in methods used in fillCollection method.
std::atomic_uint m_numMissingLinkHeader
Total number of missing link headers.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::atomic_uint m_headNumber
Total number of decoded header data.
const std::vector< IdentifierHash > * vecHash
ToolHandle< ISCT_ConfigurationConditionsTool > m_configTool
Service that keeps track of configuration conditions.
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
ErrorType
SCT byte stream error type enums used in SCT_RodDecoder, SCT_ByteStreamErrorsTool,...
allows to accumulate errors in one fillColection call
std::atomic_uint m_headErrorPreamble
Total number of preamble errors in the header data.
std::atomic_uint m_configDataBit
Total number of configuration data for raw data.
#define ATH_MSG_WARNING(x)
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
virtual StatusCode initialize() override
Initialize.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
StatusCode processRawData(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError) const
Process raw data word.
std::atomic_uint m_headErrorTimeout
Total number of timeout errors in the header data.
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
std::vector< bool > m_swapPhiReadoutDirection
Swap phi readout direction.