![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Tool to perform ROB fragments to trigger towers and trigger towers to raw data conversions.
More...
#include <PpmByteStreamReadV1V2Tool.h>
|
| PpmByteStreamReadV1V2Tool (const std::string &name) |
|
virtual | ~PpmByteStreamReadV1V2Tool () |
|
virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
virtual StatusCode | finalize () override |
|
StatusCode | convert (xAOD::TriggerTowerContainer *const ttCollection) const |
| Convert ROB fragments to trigger towers. More...
|
|
StatusCode | convert (const std::string &sgKey, xAOD::TriggerTowerContainer *const ttCollection) const |
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | convert (State &state, const IROBDataProviderSvc::VROBFRAG &robFrags) const |
|
void | initSourceIDs () |
|
const std::vector< uint32_t > & | ppmSourceIDs (State &state, const std::string &sgKey) const |
| Return reference to vector with all possible Source Identifiers. More...
|
|
StatusCode | processRobFragment_ (State &state, const ROBIterator &robFrag, const RequestType &requestedType) const |
|
StatusCode | processPpmWord_ (State &state, uint32_t word, int indata) const |
|
StatusCode | processPpmBlock_ (State &state) const |
|
StatusCode | processPpmBlockR4V1_ (State &state) const |
|
StatusCode | processPpmBlockR3V1_ (State &state) const |
|
StatusCode | processPpmStandardR4V1_ (State &state) const |
|
StatusCode | processPpmStandardR3V1_ (State &state) const |
|
StatusCode | processPpmStandardR3V1_ (State &state, uint32_t word, int indata) const |
|
StatusCode | processPpmCompressedR3V1_ (State &state) const |
|
std::vector< uint16_t > | getPpmAdcSamplesR3_ (State &state, BitReader &br, uint8_t format, uint8_t minIndex) const |
|
StatusCode | processPpmCompressedR4V1_ (State &state) const |
|
void | interpretPpmHeaderR4V1_ (BitReader &br, uint8_t numAdc, int8_t &encoding, int8_t &minIndex) const |
|
std::vector< uint16_t > | getPpmAdcSamplesR4_ (State &state, BitReader &br, uint8_t encoding, uint8_t minIndex) const |
|
StatusCode | processPpmNeutral_ (State &state) const |
|
StatusCode | addTriggerTowerV2_ (State &state, uint8_t crate, uint8_t module, uint8_t channel, std::vector< uint8_t > &&lcpVal, std::vector< uint8_t > &&lcpBcidVec, std::vector< uint8_t > &&ljeVal, std::vector< uint8_t > &&ljeSat80Vec, std::vector< uint16_t > &&adcVal, std::vector< uint8_t > &&adcExt, std::vector< int16_t > &&pedCor, std::vector< uint8_t > &&pedEn) const |
|
StatusCode | addTriggerTowerV1_ (State &state, uint8_t crate, uint8_t module, uint8_t channel, const std::vector< uint16_t > &luts, const std::vector< uint16_t > &fadc) const |
|
StatusCode | addTriggerTowerV1_ (State &state, uint8_t crate, uint8_t module, uint8_t channel, std::vector< uint8_t > &&luts, std::vector< uint8_t > &&lcpBcidVec, std::vector< uint16_t > &&fadc, std::vector< uint8_t > &&bcidExt) const |
|
void | processSubBlockStatus_ (State &state, uint8_t crate, uint8_t module, uint32_t word) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Tool to perform ROB fragments to trigger towers and trigger towers to raw data conversions.
- Author
- alexa.nosp@m.nder.nosp@m..mazu.nosp@m.rov@.nosp@m.cern..nosp@m.ch
Definition at line 58 of file PpmByteStreamReadV1V2Tool.h.
◆ FadcsMap
◆ LutsMap
◆ ROBIterator
◆ ROBPointer
◆ RODPointer
◆ StoreGateSvc_t
◆ RequestType
◆ PpmByteStreamReadV1V2Tool()
LVL1BS::PpmByteStreamReadV1V2Tool::PpmByteStreamReadV1V2Tool |
( |
const std::string & |
name | ) |
|
Definition at line 63 of file PpmByteStreamReadV1V2Tool.cxx.
66 m_errorTool(
"LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
67 m_ppmMaps(
"LVL1::PpmMappingTool/PpmMappingTool"),
72 declareInterface<PpmByteStreamReadV1V2Tool>(
this);
74 "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
76 "Get ROB source IDs service");
◆ ~PpmByteStreamReadV1V2Tool()
virtual LVL1BS::PpmByteStreamReadV1V2Tool::~PpmByteStreamReadV1V2Tool |
( |
| ) |
|
|
inlinevirtual |
◆ addTriggerTowerV1_() [1/2]
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::addTriggerTowerV1_ |
( |
State & |
state, |
|
|
uint8_t |
crate, |
|
|
uint8_t |
module, |
|
|
uint8_t |
channel, |
|
|
const std::vector< uint16_t > & |
luts, |
|
|
const std::vector< uint16_t > & |
fadc |
|
) |
| const |
|
private |
Definition at line 1001 of file PpmByteStreamReadV1V2Tool.cxx.
1010 std::vector<uint8_t> lcpVal;
1011 std::vector<uint8_t> lcpBcidVec;
1013 std::vector<uint16_t> adcVal;
1014 std::vector<uint8_t> adcExt;
1016 for(
auto lut: luts) {
1017 lcpVal.push_back(BitField::get<uint8_t>(lut, 0, 8));
1018 lcpBcidVec.push_back(BitField::get<uint8_t>(lut, 8, 3));
1022 adcExt.push_back(BitField::get<uint8_t>(
f, 0, 1));
1023 adcVal.push_back(BitField::get<uint16_t>(
f, 1, 10));
1028 std::move(lcpVal), std::move(lcpBcidVec),
1029 std::move(adcVal), std::move(adcExt)));
1031 return StatusCode::SUCCESS;
◆ addTriggerTowerV1_() [2/2]
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::addTriggerTowerV1_ |
( |
State & |
state, |
|
|
uint8_t |
crate, |
|
|
uint8_t |
module, |
|
|
uint8_t |
channel, |
|
|
std::vector< uint8_t > && |
luts, |
|
|
std::vector< uint8_t > && |
lcpBcidVec, |
|
|
std::vector< uint16_t > && |
fadc, |
|
|
std::vector< uint8_t > && |
bcidExt |
|
) |
| const |
|
private |
Definition at line 974 of file PpmByteStreamReadV1V2Tool.cxx.
985 std::vector<uint8_t> ljeSat80Vec;
987 std::vector<int16_t> pedCor;
988 std::vector<uint8_t> pedEn;
992 std::move(luts), std::move(lcpBcidVec),
993 std::move(luts) , std::move(ljeSat80Vec),
994 std::move(fadc), std::move(bcidExt),
995 std::move(pedCor), std::move(pedEn))
998 return StatusCode::SUCCESS;
◆ addTriggerTowerV2_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::addTriggerTowerV2_ |
( |
State & |
state, |
|
|
uint8_t |
crate, |
|
|
uint8_t |
module, |
|
|
uint8_t |
channel, |
|
|
std::vector< uint8_t > && |
lcpVal, |
|
|
std::vector< uint8_t > && |
lcpBcidVec, |
|
|
std::vector< uint8_t > && |
ljeVal, |
|
|
std::vector< uint8_t > && |
ljeSat80Vec, |
|
|
std::vector< uint16_t > && |
adcVal, |
|
|
std::vector< uint8_t > && |
adcExt, |
|
|
std::vector< int16_t > && |
pedCor, |
|
|
std::vector< uint8_t > && |
pedEn |
|
) |
| const |
|
private |
Definition at line 928 of file PpmByteStreamReadV1V2Tool.cxx.
950 if (!
isData && !state.m_ppmIsRetSpare && !state.m_ppmIsRetMuon){
951 return StatusCode::SUCCESS;
958 phi = 4 * pin + asic;
962 state.m_triggerTowers->push_back(
tt);
965 std::move(lcpVal), std::move(ljeVal),
966 std::move(pedCor), std::move(pedEn),
967 std::move(lcpBcidVec), std::move(adcVal),
968 std::move(adcExt), std::move(ljeSat80Vec),
969 0, state.m_caloUserHeader.lut(),
970 state.m_caloUserHeader.ppFadc());
971 return StatusCode::SUCCESS;
◆ convert() [1/3]
◆ convert() [2/3]
Definition at line 105 of file PpmByteStreamReadV1V2Tool.cxx.
113 state.m_subDetectorID = eformat::TDAQ_CALO_PREPROC;
119 for (; rob != robEnd; ++rob, ++robCounter) {
122 if (!
sc.isSuccess()) {
128 return StatusCode::SUCCESS;
◆ convert() [3/3]
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
124 return evtStore()->event()->getKey( ptr );
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
111 return evtStore()->event()->getName( ptr );
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getPpmAdcSamplesR3_()
std::vector< uint16_t > LVL1BS::PpmByteStreamReadV1V2Tool::getPpmAdcSamplesR3_ |
( |
State & |
state, |
|
|
BitReader & |
br, |
|
|
uint8_t |
format, |
|
|
uint8_t |
minIndex |
|
) |
| const |
|
private |
Definition at line 498 of file PpmByteStreamReadV1V2Tool.cxx.
502 std::vector<uint16_t>
adc = {0, 0, 0, 0, 0};
509 longField =
br.getField(1);
510 numBits = longField == 0? 4: (
format * 2);
512 numBits =
i == 0? 4: (
format + 2);
516 minAdc =
br.getField(numBits);
517 if (longField == 0) {
518 minAdc += state.m_caloUserHeader.ppLowerBound();
521 adc[
i] = minAdc +
br.getField(numBits);
529 adc[minIndex] = minAdc;
◆ getPpmAdcSamplesR4_()
std::vector< uint16_t > LVL1BS::PpmByteStreamReadV1V2Tool::getPpmAdcSamplesR4_ |
( |
State & |
state, |
|
|
BitReader & |
br, |
|
|
uint8_t |
encoding, |
|
|
uint8_t |
minIndex |
|
) |
| const |
|
private |
Definition at line 785 of file PpmByteStreamReadV1V2Tool.cxx.
790 uint8_t numAdc = state.m_subBlockHeader.nSlice2();
794 return std::vector<uint16_t>(numAdc,
val);
796 std::vector<uint16_t>
adc(numAdc, 0);
797 uint16_t minAdc =
br.getField(5) + state.m_caloUserHeader.ppLowerBound();
798 adc[minIndex] = minAdc;
804 std::vector<uint16_t>
adc(numAdc, 0);
808 state.m_caloUserHeader.ppLowerBound());
810 adc[minIndex] = minAdc;
812 adc[minIndex ==
i? 0:
i] =
br.getField(
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ initialize()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::initialize |
( |
| ) |
|
|
overridevirtual |
Dummy implementation of the initialisation function.
It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...
Reimplemented from asg::AsgTool.
Definition at line 83 of file PpmByteStreamReadV1V2Tool.cxx.
93 return StatusCode::SUCCESS;
◆ initSourceIDs()
void LVL1BS::PpmByteStreamReadV1V2Tool::initSourceIDs |
( |
| ) |
|
|
private |
Definition at line 1037 of file PpmByteStreamReadV1V2Tool.cxx.
1039 const int crates = 8;
1045 for (
int crate = 0; crate < crates; ++crate) {
1048 eformat::TDAQ_CALO_PREPROC);
1051 if (crate > 1 && crate < 6) {
1053 if (crate < 4 && slink == 0) {
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interpretPpmHeaderR4V1_()
void LVL1BS::PpmByteStreamReadV1V2Tool::interpretPpmHeaderR4V1_ |
( |
BitReader & |
br, |
|
|
uint8_t |
numAdc, |
|
|
int8_t & |
encoding, |
|
|
int8_t & |
minIndex |
|
) |
| const |
|
private |
Definition at line 734 of file PpmByteStreamReadV1V2Tool.cxx.
741 minHeader =
br.getField(4);
743 minIndex = minHeader % 5;
745 if (minHeader < 10) {
757 }
else if (numAdc == 7) {
759 }
else if (numAdc < 16) {
764 uint8_t fieldSize = 1 << numBits;
765 minHeader =
br.getField(numBits);
766 uint8_t encValue = fieldSize - 1;
767 if (minHeader == encValue) {
771 minHeader +=
br.getField(2) << numBits;
772 minIndex = minHeader % fieldSize;
773 encValue = 3 * fieldSize;
775 if (minHeader < encValue) {
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ ppmSourceIDs()
const std::vector< uint32_t > & LVL1BS::PpmByteStreamReadV1V2Tool::ppmSourceIDs |
( |
State & |
state, |
|
|
const std::string & |
sgKey |
|
) |
| const |
|
private |
Return reference to vector with all possible Source Identifiers.
Definition at line 1063 of file PpmByteStreamReadV1V2Tool.cxx.
1067 state.m_ppmIsRetMuon =
false;
1068 state.m_ppmIsRetSpare =
false;
1070 if (sgKey.find(
"Muon") != std::string::npos) {
1071 state.m_ppmIsRetMuon =
true;
1072 }
else if (sgKey.find(
"Spare") != std::string::npos) {
1073 state.m_ppmIsRetSpare =
true;
1076 if (state.m_ppmIsRetSpare) {
1080 if (state.m_ppmIsRetMuon) {
◆ print()
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, top::TopObjectSelection, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ processPpmBlock_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlock_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 291 of file PpmByteStreamReadV1V2Tool.cxx.
293 if (state.m_ppBlock.size() > 0) {
294 if (state.m_subBlockHeader.format() == 0) {
300 if (state.m_verCode == 0x31) {
306 if (state.m_verCode == 0x41 || state.m_verCode == 0x42) {
313 if (state.m_ppLuts.size() > 0) {
314 if (state.m_verCode == 0x21 || state.m_verCode == 0x31) {
320 <<
int(state.m_subBlockHeader.format())
321 <<
"' for rob version '"
322 << MSG::hex <<
int(state.m_verCode)
323 << MSG::dec <<
"'" );
324 return StatusCode::FAILURE;
326 return StatusCode::SUCCESS;
◆ processPpmBlockR3V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlockR3V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 820 of file PpmByteStreamReadV1V2Tool.cxx.
822 if (state.m_subBlockHeader.format() == 1) {
824 return StatusCode::SUCCESS;
825 }
else if (state.m_subBlockHeader.format() >= 2) {
827 return StatusCode::FAILURE;
829 return StatusCode::FAILURE;
◆ processPpmBlockR4V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlockR4V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 575 of file PpmByteStreamReadV1V2Tool.cxx.
577 if (state.m_subBlockHeader.format() == 1) {
579 return StatusCode::SUCCESS;
580 }
else if (state.m_subBlockHeader.format() >= 2) {
582 return StatusCode::SUCCESS;
584 return StatusCode::FAILURE;
◆ processPpmCompressedR3V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmCompressedR3V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 414 of file PpmByteStreamReadV1V2Tool.cxx.
416 BitReader
br (state.m_ppBlock);
421 if (state.m_subBlockHeader.format() == 3) {
422 present =
br.getField(1);
432 std::vector<uint16_t> adcVal = {0 , 0, 0, 0, 0};
433 std::vector<uint8_t> adcExt = {0 , 0, 0, 0, 0};
436 uint8_t minIndex = minHeader % 5;
437 if (minHeader < 15) {
438 if (minHeader < 10) {
441 fmt = 2 +
br.getField( 2);
445 lutVal =
br.getField(3);
451 lutVal =
br.getField(8);
452 lutExt =
br.getField(1);
453 lutSat =
br.getField(1);
454 lutPeak =
br.getField(1);
459 adcExt[
i] =
br.getField(1);
480 state.m_subBlockHeader.crate(),
481 state.m_subBlockHeader.module(),
483 std::vector<uint8_t> {lutVal},
484 std::vector<uint8_t> {uint8_t(lutExt | (lutSat << 1) | (lutPeak << 2))},
491 }
catch (
const std::out_of_range& ex) {
495 return StatusCode::SUCCESS;
◆ processPpmCompressedR4V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmCompressedR4V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 587 of file PpmByteStreamReadV1V2Tool.cxx.
589 BitReader
br (state.m_ppBlock);
590 uint8_t numAdc = state.m_subBlockHeader.nSlice2();
591 uint8_t numLut = state.m_subBlockHeader.nSlice1();
599 std::vector<uint8_t> haveLut(numLut, 0);
600 std::vector<uint8_t> lcpVal(numLut, 0);
602 std::vector<uint8_t> lcpExt(numLut, 0);
603 std::vector<uint8_t> lcpSat(numLut, 0);
604 std::vector<uint8_t> lcpPeak(numLut, 0);
605 std::vector<uint8_t> lcpBcidVec(numLut, 0);
607 std::vector<uint8_t> ljeVal(numLut, 0);
609 std::vector<uint8_t> ljeLow(numLut, 0);
610 std::vector<uint8_t> ljeHigh(numLut, 0);
611 std::vector<uint8_t> ljeRes(numLut, 0);
612 std::vector<uint8_t> ljeSat80Vec(numLut, 0);
614 std::vector<uint16_t> adcVal(numAdc, 0);
615 std::vector<uint8_t> adcExt(numAdc, 0);
616 std::vector<int16_t> pedCor(numLut, 0);
617 std::vector<uint8_t> pedEn(numLut, 0);
620 int8_t minIndex = -1;
622 if (state.m_subBlockHeader.format() == 3) {
623 present =
br.getField(1);
631 for(
uint i=0;
i < numLut; ++
i) {
632 lcpPeak[
i] =
br.getField(1);
637 ljeLow[
i] =
br.getField(1);
644 if (lcpPeak[
i] == 1) {
645 lcpVal[
i] =
br.getField(4);
649 if (lcpPeak[
i] == 1){
650 ljeVal[
i] =
br.getField(3);
657 haveLut[
i] =
br.getField(1);
665 adcExt[
i] =
br.getField(1);
670 if (haveLut[
i] == 1) {
671 lcpVal[
i] =
br.getField(8);
672 lcpExt[
i] =
br.getField(1);
673 lcpSat[
i] =
br.getField(1);
674 lcpPeak[
i] =
br.getField(1);
679 if (haveLut[
i] == 1) {
680 ljeVal[
i] =
br.getField(8);
681 ljeLow[
i] =
br.getField(1);
682 ljeHigh[
i] =
br.getField(1);
683 ljeRes[
i] =
br.getField(1);
696 pedCor[
i] =
br.getField(6) + pedCorBase;
697 if (state.m_subBlockHeader.compVer() > 0) {
708 pedCor[
i] = ::pedCorrection(
val);
709 pedEn[
i] =
br.getField(1);
714 lcpBcidVec[
i] =
uint8_t((lcpPeak[
i] << 2) | (lcpSat[
i] << 1) | lcpExt[
i]);
715 ljeSat80Vec[
i] =
uint8_t((ljeRes[
i] << 2) | (ljeHigh[
i] << 1) | ljeLow[
i]);
718 state.m_subBlockHeader.crate(), state.m_subBlockHeader.module(),
720 std::move(lcpVal), std::move(lcpBcidVec),
721 std::move(ljeVal), std::move(ljeSat80Vec),
722 std::move(adcVal), std::move(adcExt),
723 std::move(pedCor), std::move(pedEn)));
725 }
catch (
const std::out_of_range& ex) {
730 return StatusCode::SUCCESS;
◆ processPpmNeutral_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmNeutral_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 329 of file PpmByteStreamReadV1V2Tool.cxx.
331 uint8_t numLut = state.m_subBlockHeader.nSlice1();
332 uint8_t numFadc = state.m_subBlockHeader.nSlice2();
333 uint8_t totSlice = 3 * numLut + numFadc;
336 for (
int asic = 0 ; asic < 4 ; ++asic ) {
337 for (
int mcm = 0 ; mcm < 16 ; ++mcm ) {
339 std::vector<uint32_t> rotated(totSlice);
342 for (
uint8_t bit = 0 ; bit < 11 ; ++bit ) {
343 if ( state.m_ppBlock[
slice * 11 + asic * (11 * totSlice) + bit + 1] & (1 << mcm))
344 rotated[
slice] |= (1 << bit);
348 bool nonZeroData =
false;
351 || rotated[
slice + numLut]
352 || rotated[
slice + 2 * numLut + numFadc]) {
358 std::vector<uint8_t> lcpVal;
359 std::vector<uint8_t> lcpBcidVec;
360 std::vector<uint8_t> ljeVal;
361 std::vector<uint8_t> ljeSat80Vec;
362 std::vector<int16_t> pedCor;
363 std::vector<uint8_t> pedEn;
365 std::vector<uint16_t> adcVal;
366 std::vector<uint8_t> adcExt;
370 lcpVal.push_back(rotated[
slice] & 0xff);
371 ljeVal.push_back(rotated[
slice + numLut] & 0xff);
372 pedCor.push_back(::pedCorrection(rotated[
slice + 2 * numLut + numFadc] & 0x3ff));
374 lcpBcidVec.push_back((rotated[
slice] >> 8) & 0x7);
375 ljeSat80Vec.push_back((rotated[
slice + numLut] >> 8) & 0x7);
376 pedEn.push_back((rotated[
slice + 2 * numLut + numFadc] >> 10) & 0x1);
381 if (rotated[
slice + numLut]) {
389 adcVal.push_back(rotated[
slice + 2 * numLut] & 0x3ff);
390 adcExt.push_back((rotated[
slice + 2 * numLut] >> 10 & 0
x1) & 0x3ff);
396 state.m_subBlockHeader.crate(),
397 state.m_subBlockHeader.module(),
400 std::move(lcpBcidVec),
402 std::move(ljeSat80Vec),
411 return StatusCode::SUCCESS;
◆ processPpmStandardR3V1_() [1/2]
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR3V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 892 of file PpmByteStreamReadV1V2Tool.cxx.
894 for(
auto lut : state.m_ppLuts) {
897 state.m_subBlockHeader.crate(),
898 state.m_subBlockHeader.module(),
901 state.m_ppFadcs[lut.first]));
903 return StatusCode::SUCCESS;
◆ processPpmStandardR3V1_() [2/2]
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR3V1_ |
( |
State & |
state, |
|
|
uint32_t |
word, |
|
|
int |
indata |
|
) |
| const |
|
private |
Definition at line 536 of file PpmByteStreamReadV1V2Tool.cxx.
542 if (state.m_subBlockHeader.seqNum() == 63) {
546 const uint8_t numAdc = state.m_subBlockHeader.nSlice2();
547 const uint8_t numLut = state.m_subBlockHeader.nSlice1();
548 const uint8_t nTotal = numAdc + numLut;
549 const uint8_t wordsPerBlock = 8;
550 const uint8_t iBlk = inData / wordsPerBlock;
551 uint8_t iChan = state.m_subBlockHeader.seqNum() + 2 * (inData % wordsPerBlock);
555 uint16_t subword = (word >> 16 *
i) & 0x7ff;
556 state.m_ppLuts[iChan].push_back(subword);
559 }
else if (iBlk < nTotal) {
561 uint16_t subword = (word >> (16 *
i)) & 0x7ff;
562 state.m_ppFadcs[iChan].push_back(subword);
568 sc = StatusCode::FAILURE;
◆ processPpmStandardR4V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR4V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 832 of file PpmByteStreamReadV1V2Tool.cxx.
834 BitReader
br (state.m_ppBlock);
835 uint8_t numAdc = state.m_subBlockHeader.nSlice2();
836 uint8_t numLut = state.m_subBlockHeader.nSlice1();
837 uint8_t crate = state.m_subBlockHeader.crate();
843 std::vector<uint8_t> lcpVal;
844 std::vector<uint8_t> lcpBcidVec;
846 std::vector<uint8_t> ljeVal;
847 std::vector<uint8_t> ljeSat80Vec;
851 std::vector<uint16_t> adcVal;
852 std::vector<uint8_t> adcExt;
853 std::vector<int16_t> pedCor;
854 std::vector<uint8_t> pedEn;
856 for (
int i = 0;
i < numLut; ++
i) {
857 lcpVal.push_back(
br.getField(8));
858 lcpBcidVec.push_back(
br.getField(3));
861 for (
int i = 0;
i < numLut; ++
i) {
862 ljeVal.push_back(
br.getField(8));
863 ljeSat80Vec.push_back(
br.getField(3));
866 for (
int i = 0;
i < numAdc; ++
i) {
867 adcVal.push_back(
br.getField(10));
868 adcExt.push_back(
br.getField(1));
871 for (
int i = 0;
i < numLut; ++
i) {
873 pedCor.push_back(pedCorrection(
pc));
874 pedEn.push_back(
br.getField(1));
876 }
catch (
const std::out_of_range& ex) {
883 std::move(lcpVal), std::move(lcpBcidVec),
884 std::move(ljeVal), std::move(ljeSat80Vec),
885 std::move(adcVal), std::move(adcExt),
886 std::move(pedCor), std::move(pedEn)));
889 return StatusCode::SUCCESS;
◆ processPpmWord_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmWord_ |
( |
State & |
state, |
|
|
uint32_t |
word, |
|
|
int |
indata |
|
) |
| const |
|
private |
Definition at line 271 of file PpmByteStreamReadV1V2Tool.cxx.
275 if ( (state.m_subBlockHeader.format() == 0)
276 || (state.m_subBlockHeader.format() >= 2)
277 || (state.m_verCode >= 0x41)) {
278 state.m_ppBlock.push_back(word);
279 }
else if ((state.m_verCode == 0x21) || (state.m_verCode == 0x31)) {
283 << state.m_verCode <<
":" << state.m_subBlockHeader.format()
285 return StatusCode::FAILURE;
287 return StatusCode::SUCCESS;
◆ processRobFragment_()
Definition at line 154 of file PpmByteStreamReadV1V2Tool.cxx.
158 auto rob = **robIter;
161 "Treating ROB fragment source id #" << MSG::hex << rob.rob_source_id());
164 state.m_rodSourceId = rob.rod_source_id();
165 state.m_robSourceId = rob.source_id();
166 const auto sourceID = (state.m_rodSourceId >> 16) & 0xff;
171 if (rob.nstatus() > 0) {
176 m_errorTool->robError(state.m_rodSourceId, *robData);
177 return StatusCode::FAILURE;
185 rob.rod_data(payloadBeg);
186 payloadEnd = payloadBeg + rob.rod_ndata();
191 return StatusCode::FAILURE;
196 uint16_t rodVer = rob.rod_version() & 0xffff;
197 uint32_t rodRunNumber = rob.rod_run_no() & 0xffffff;
198 state.m_verCode = ((rodVer & 0xfff) << 4) | 1;
201 if (sourceID != state.m_subDetectorID) {
202 ATH_MSG_ERROR(
"Wrong subdetector source id for requested objects: " << state.m_rodSourceId);
203 return StatusCode::FAILURE;
206 ATH_MSG_DEBUG(
"Treating crate " << rodCrate <<
" slink " << rodSlink);
207 state.m_caloUserHeader = CaloUserHeader(*
payload);
208 if (!state.m_caloUserHeader.isValid()) {
210 return StatusCode::FAILURE;
214 "Run number: " << MSG::dec << rodRunNumber <<
endmsg
215 <<
"Version code: 0x" << MSG::hex <<
int(state.m_verCode) << MSG::dec
216 <<
endmsg <<
"LUT triggered slice offset: "
217 <<
int(state.m_caloUserHeader.lut()) <<
endmsg
218 <<
"FADC triggered slice offset: " <<
int(state.m_caloUserHeader.ppFadc())
219 <<
endmsg <<
"FADC baseline lower bound: "
220 <<
int(state.m_caloUserHeader.ppLowerBound()));
233 state.m_ppLuts.clear();
234 state.m_ppFadcs.clear();
235 state.m_ppBlock.clear();
240 state.m_subBlockHeader = SubBlockHeader(*
payload);
242 "SubBlock version #" <<
int(state.m_subBlockHeader.version())
243 <<
" format #" <<
int(state.m_subBlockHeader.format())
244 <<
" seqNum (compVer) #" <<
int(state.m_subBlockHeader.seqNum())
245 <<
" nslice1 #" <<
int(state.m_subBlockHeader.nSlice1())
246 <<
" nslice2 #" <<
int(state.m_subBlockHeader.nSlice2())
249 }
else if (
blockType == (subBlock | 1)) {
254 switch(state.m_subDetectorID){
255 case eformat::TDAQ_CALO_PREPROC:
265 state.m_ppLuts.clear();
266 state.m_ppFadcs.clear();
267 state.m_ppBlock.clear();
268 return StatusCode::SUCCESS;
◆ processSubBlockStatus_()
void LVL1BS::PpmByteStreamReadV1V2Tool::processSubBlockStatus_ |
( |
State & |
state, |
|
|
uint8_t |
crate, |
|
|
uint8_t |
module, |
|
|
uint32_t |
word |
|
) |
| const |
|
private |
Definition at line 906 of file PpmByteStreamReadV1V2Tool.cxx.
913 int curr = state.m_triggerTowers->size() - 1;
918 auto tt = (*state.m_triggerTowers)[curr--];
919 if (
tt->coolId() >> 16 & crateModuleMask(crate,
module)){
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_errorTool
◆ m_evtStore
◆ m_maxSizeSeen
std::atomic<size_t> LVL1BS::PpmByteStreamReadV1V2Tool::m_maxSizeSeen |
|
mutableprivate |
◆ m_ppmMaps
◆ m_ppmSourceIDs
std::vector<uint32_t> LVL1BS::PpmByteStreamReadV1V2Tool::m_ppmSourceIDs |
|
private |
◆ m_ppmSourceIDsMuon
std::vector<uint32_t> LVL1BS::PpmByteStreamReadV1V2Tool::m_ppmSourceIDsMuon |
|
private |
◆ m_ppmSourceIDsSpare
std::vector<uint32_t> LVL1BS::PpmByteStreamReadV1V2Tool::m_ppmSourceIDsSpare |
|
private |
◆ m_robDataProvider
◆ m_srcIdMap
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ s_channels
const uint8_t LVL1BS::PpmByteStreamReadV1V2Tool::s_channels = 64 |
|
staticprivate |
◆ s_crates
const uint8_t LVL1BS::PpmByteStreamReadV1V2Tool::s_crates = 8 |
|
staticprivate |
◆ s_maxtowers
◆ s_modules
const uint8_t LVL1BS::PpmByteStreamReadV1V2Tool::s_modules = 16 |
|
staticprivate |
The documentation for this class was generated from the following files:
T atomic_fetch_max(std::atomic< T > *a, T v, std::memory_order memorder=std::memory_order_seq_cst)
Atomically calculate maximum.
int slink(uint32_t code) const
Return slink from unpacked moduleID.
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
L1Topo::BlockTypes blockType(const uint32_t word, uint32_t offset=28, uint32_t size=0x0f)
Function to return the block type of a data word from L1Topo
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
#define ATH_MSG_VERBOSE(x)
setScaleOne setStatusOne setSaturated int16_t
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
int crate(uint32_t code) const
Return crate from unpacked moduleID.
Description of TriggerTower_v2.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< const ROBF * > VROBFRAG
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
static const std::string xAODTriggerTowerLocation
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
int maxSlinks() const
Return the maximum possible number of slinks.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.