ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloBsDecoderUtil.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#include <iostream>
5#include <iomanip>
6
7#include "eformat/ROBFragment.h"
8
11
16
20
21void
23 std::list<L1CaloRdoRodInfo>& dat )
24{
25 // Create the basic object
26 int sourceId = rod->rod_source_id() & 0xffffff;
27 int runNumber = rod->rod_run_no();
28 int bcNumber = rod->rod_bc_id();
29 int triggerType = rod->rod_lvl1_trigger_type();
30 int detEventType = rod->rod_detev_type();
31 int version = rod->rod_version();
32//<< // **FIXME** Hack for testing Run 3: set rod version
33//<< version |= 0x1004; // **FIXME** Remove this!
34 L1CaloRdoRodInfo rdo( sourceId>>16, sourceId&0xffff, runNumber, bcNumber, triggerType, detEventType, version );
35
36 // Add in the Level-1 ID and size
37 rdo.setLvl1Id( rod->rod_lvl1_id() );
38 rdo.setSize( rod->rod_ndata() );
39
40 // Add in the status words
41 const uint32_t* status;
42 rod->rod_status(status);
43 int stat = *status++;
44 rdo.setStatus1( stat );
45 stat = *status;
46 rdo.setStatus2( stat );
47
48 // Now add in the module status words in the payload, if not RoI or CTP
49 bool hasModuleStatus = true;
50 if ( (sourceId>>16) > 0x74 )
51 hasModuleStatus = false;
52 if ( (sourceId>>16) == 0x73 )
53 hasModuleStatus = false;
54
55 if ( hasModuleStatus )
56 {
57 const uint32_t* it_data;
58 rod->rod_data( it_data );
59 const uint32_t ndata = rod->rod_ndata();
60 ++it_data;
61 for ( uint32_t i = 1; i < ndata; ++i, ++it_data ) {
62 if ( ((*it_data)>>28) == 0xd )
63 {
64 int idat = (*it_data)&0xfff;
65 int module = idat>>8;
66 int modStat = rdo.getModuleStatus( module );
67 rdo.setModuleStatus( module, modStat | (idat&0xff) );
68 }
69 if ( ((*it_data)>>28) == 0xf )
70 {
71 int idat = (*it_data)&0x1ff;
72 int module = idat>>8;
73 int modStat = rdo.getModuleStatus( module );
74 rdo.setModuleStatus( module, modStat | (idat&0xff) );
75 }
76 }
77 }
78
79 dat.push_back( std::move(rdo) );
80}
static void decodeRodInfo(const eformat::ROBFragment< const uint32_t * > *rod, std::list< L1CaloRdoRodInfo > &dat)
int getModuleStatus(const int module) const
void setStatus2(int status)
void setStatus1(int status)
void setSize(int size)
void setModuleStatus(int module, int status)
void setLvl1Id(int lvl1)