ATLAS Offline Software
LArFebHeaderReader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "LArFebHeaderReader.h"
8 
9 
10 void LArFebHeaderReader::fillFebHeader(LArFebHeader* larFebHeader, //output
11  const LArRodBlockStructure* rodBlock, //input
12  const ROBFragment& rob) { //input
13  larFebHeader->SetFormatVersion(rob.rod_version());
14  larFebHeader->SetSourceId(rob.rod_source_id());
15  larFebHeader->SetRunNumber(rob.rod_run_no());
16  larFebHeader->SetELVL1Id(rob.rod_lvl1_id());
17  larFebHeader->SetBCId(rob.rod_bc_id());
18  larFebHeader->SetLVL1TigType(rob.rod_lvl1_trigger_type());
19  larFebHeader->SetDetEventType(rob.rod_detev_type());
20 
21  //set DSP data
22  const unsigned nsample=rodBlock->getNumberOfSamples();
23  larFebHeader->SetRodStatus(rodBlock->getStatus());
24  larFebHeader->SetDspCodeVersion(rodBlock->getDspCodeVersion());
25  larFebHeader->SetDspEventCounter(rodBlock->getDspEventCounter());
26  larFebHeader->SetRodResults1Size(rodBlock->getResults1Size());
27  larFebHeader->SetRodResults2Size(rodBlock->getResults2Size());
28  larFebHeader->SetRodRawDataSize(rodBlock->getRawDataSize());
29  larFebHeader->SetNbSweetCells1(rodBlock->getNbSweetCells1());
30  larFebHeader->SetNbSweetCells2(rodBlock->getNbSweetCells2());
31  larFebHeader->SetNbSamples(nsample);
32  larFebHeader->SetOnlineChecksum(rodBlock->onlineCheckSum());
33  larFebHeader->SetOfflineChecksum(rodBlock->offlineCheckSum());
34 
35  if(!rodBlock->hasControlWords()) {
36  larFebHeader->SetFebELVL1Id(rob.rod_lvl1_id());
37  larFebHeader->SetFebBCId(rob.rod_bc_id());
38  } else {
39  const uint16_t evtid = rodBlock->getCtrl1(0) & 0x1f;
40  const uint16_t bcid = rodBlock->getCtrl2(0) & 0x1fff;
41  larFebHeader->SetFebELVL1Id(evtid);
42  larFebHeader->SetFebBCId(bcid);
43  for(int iadc=0;iadc<16;iadc++) {
44  larFebHeader->SetFebCtrl1(rodBlock->getCtrl1(iadc));
45  larFebHeader->SetFebCtrl2(rodBlock->getCtrl2(iadc));
46  larFebHeader->SetFebCtrl3(rodBlock->getCtrl3(iadc));
47  }
48  for(unsigned int i = 0; i<nsample; i++ ) {
49  larFebHeader->SetFebSCA(rodBlock->getRadd(0,i) & 0xff);
50  }
51  }//end else no control words
52 
53  return;
54 }
LArRodBlockStructure
Definition: LArRodBlockStructure.h:48
LArRodBlockStructure::getNbSweetCells1
virtual uint16_t getNbSweetCells1() const
Definition: LArRodBlockStructure.cxx:255
LArRodBlockStructure::getNumberOfSamples
virtual uint32_t getNumberOfSamples() const
Definition: LArRodBlockStructure.cxx:245
LArRodBlockStructure::getRadd
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
Definition: LArRodBlockStructure.cxx:247
LArFebHeaderReader::fillFebHeader
void fillFebHeader(LArFebHeader *lfh, const LArRodBlockStructure *bl, const ROBFragment &robFrag)
Fill info for one FEB Header.
Definition: LArFebHeaderReader.cxx:10
LArRodBlockStructure::getNbSweetCells2
virtual uint16_t getNbSweetCells2() const
Definition: LArRodBlockStructure.cxx:256
LArRodBlockStructure::getRawDataSize
virtual uint16_t getRawDataSize() const
Definition: LArRodBlockStructure.cxx:254
LArFebHeader::SetFormatVersion
void SetFormatVersion(const uint32_t formatVersion)
set the format version
Definition: LArFebHeader.h:122
LArFebHeader::SetELVL1Id
void SetELVL1Id(const uint16_t elvl1Id)
set the EventID
Definition: LArFebHeader.h:134
LArRodBlockStructure::getCtrl2
virtual uint16_t getCtrl2(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:249
LArFebHeader::SetLVL1TigType
void SetLVL1TigType(const uint32_t lvl1ttype)
set the Level1 trigger type ID
Definition: LArFebHeader.h:162
LArRodBlockStructure::offlineCheckSum
virtual uint32_t offlineCheckSum() const
Definition: LArRodBlockStructure.cxx:163
LArRodBlockStructure::getDspCodeVersion
virtual uint32_t getDspCodeVersion() const
Definition: LArRodBlockStructure.cxx:258
LArFebHeader::SetRodRawDataSize
void SetRodRawDataSize(const uint16_t size)
Definition: LArFebHeader.h:146
LArFebHeader::SetBCId
void SetBCId(const uint16_t bcid)
set the Bunch Crossing ID
Definition: LArFebHeader.h:138
LArRodBlockStructure::getDspEventCounter
virtual int32_t getDspEventCounter() const
Definition: LArRodBlockStructure.cxx:264
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
LArFebHeader::SetFebELVL1Id
void SetFebELVL1Id(const uint16_t elvl1Id)
set the FEB Event ID
Definition: LArFebHeader.h:178
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArFebHeader::SetRunNumber
void SetRunNumber(const uint32_t runNumber)
set the run number
Definition: LArFebHeader.h:130
LArRodBlockStructure::hasControlWords
virtual uint32_t hasControlWords() const
Definition: LArRodBlockStructure.h:126
LArFebHeader::SetDspCodeVersion
void SetDspCodeVersion(const uint32_t codeVersion)
set the version of the DSP code
Definition: LArFebHeader.h:170
LArFebHeader::SetRodResults2Size
void SetRodResults2Size(const uint16_t size)
Definition: LArFebHeader.h:144
LArFebHeader::SetOnlineChecksum
void SetOnlineChecksum(const uint32_t checksum)
Definition: LArFebHeader.h:156
LArFebHeader
Holds information from the FEB Header.
Definition: LArFebHeader.h:21
LArFebHeader::SetDspEventCounter
void SetDspEventCounter(const uint32_t eventCounter)
set the Event number counted by the DSP code
Definition: LArFebHeader.h:174
LArFebHeader::SetSourceId
void SetSourceId(const uint32_t sourceID)
set the source Id
Definition: LArFebHeader.h:126
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
LArRodBlockStructure::getResults2Size
virtual uint16_t getResults2Size() const
Definition: LArRodBlockStructure.cxx:253
LArFebHeader::SetRodResults1Size
void SetRodResults1Size(const uint16_t size)
set the ROD block sizes
Definition: LArFebHeader.h:142
LArFebHeader::SetFebCtrl2
void SetFebCtrl2(const uint16_t ctrl2)
set the FEB Control Word #2
Definition: LArFebHeader.h:190
LArRodBlockStructure.h
LArFebHeader::SetNbSamples
void SetNbSamples(const uint16_t n)
Definition: LArFebHeader.h:154
LArFebHeader::SetFebSCA
void SetFebSCA(const uint16_t sca)
set the SCA's
Definition: LArFebHeader.h:202
LArFebHeaderReader.h
LArRodBlockStructure::getCtrl3
virtual uint16_t getCtrl3(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:250
LArRodBlockStructure::getStatus
virtual uint32_t getStatus() const
Definition: LArRodBlockStructure.cxx:251
LArFebHeader::SetFebCtrl3
void SetFebCtrl3(const uint16_t ctrl3)
set the FEB Control Word #3
Definition: LArFebHeader.h:194
LArRodBlockStructure::getCtrl1
virtual uint16_t getCtrl1(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:248
LArFebHeader.h
LArFebHeader::SetNbSweetCells2
void SetNbSweetCells2(const uint16_t n)
Definition: LArFebHeader.h:152
LArRodBlockStructure::onlineCheckSum
virtual uint32_t onlineCheckSum() const
Definition: LArRodBlockStructure.cxx:155
LArFebHeader::SetFebBCId
void SetFebBCId(const uint16_t bcid)
set the FEB Bunch Crossing ID
Definition: LArFebHeader.h:182
LArFebHeader::SetFebCtrl1
void SetFebCtrl1(const uint16_t ctrl1)
set the FEB Control Word #1
Definition: LArFebHeader.h:186
LArFebHeader::SetDetEventType
void SetDetEventType(const uint32_t detEvType)
set the Detector event type ID
Definition: LArFebHeader.h:166
LArRodBlockStructure::getResults1Size
virtual uint16_t getResults1Size() const
Definition: LArRodBlockStructure.cxx:252
LArFebHeader::SetRodStatus
void SetRodStatus(const uint32_t status)
set the ROD Status
Definition: LArFebHeader.h:198
LArFebHeader::SetNbSweetCells1
void SetNbSweetCells1(const uint16_t n)
set the number of samples and cells above thresholds
Definition: LArFebHeader.h:150
LArFebHeader::SetOfflineChecksum
void SetOfflineChecksum(const uint32_t checksum)
Definition: LArFebHeader.h:158