ATLAS Offline Software
L1CaloBsDecoderUtil.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #include <iostream>
5 #include <iomanip>
6 
7 #include "eformat/ROBFragment.h"
8 
11 
18 {
19 }
20 
21 void
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( rdo );
80 }
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
L1CaloRdoRodInfo::setLvl1Id
void setLvl1Id(int lvl1)
Definition: L1CaloRdoRodInfo.cxx:203
L1CaloRdoRodInfo
Definition: L1CaloRdoRodInfo.h:11
L1CaloBsDecoderUtil::L1CaloBsDecoderUtil
L1CaloBsDecoderUtil()
Definition: L1CaloBsDecoderUtil.cxx:17
python.PyAthena.module
module
Definition: PyAthena.py:131
eformat::ROBFragment< const uint32_t * >
lumiFormat.i
int i
Definition: lumiFormat.py:85
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
plotBeamSpotCompare.xd
xd
Definition: plotBeamSpotCompare.py:220
beamspotman.stat
stat
Definition: beamspotman.py:266
L1CaloRdoRodInfo::getModuleStatus
int getModuleStatus(const int module) const
Definition: L1CaloRdoRodInfo.cxx:195
get_generator_info.version
version
Definition: get_generator_info.py:33
L1CaloRdoRodInfo.h
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
L1CaloRdoRodInfo::setStatus2
void setStatus2(int status)
Definition: L1CaloRdoRodInfo.cxx:221
L1CaloRdoRodInfo::setSize
void setSize(int size)
Definition: L1CaloRdoRodInfo.cxx:209
RunTileMonitoring.triggerType
triggerType
Definition: RunTileMonitoring.py:162
merge.status
status
Definition: merge.py:17
L1CaloBsDecoderUtil.h
L1CaloRdoRodInfo::setStatus1
void setStatus1(int status)
Definition: L1CaloRdoRodInfo.cxx:215
L1CaloBsDecoderUtil::decodeRodInfo
static void decodeRodInfo(const eformat::ROBFragment< const uint32_t * > *rod, std::list< L1CaloRdoRodInfo > &dat)
Definition: L1CaloBsDecoderUtil.cxx:22
L1CaloRdoRodInfo::setModuleStatus
void setModuleStatus(int module, int status)
Definition: L1CaloRdoRodInfo.cxx:227