|
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);
75 "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
77 "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 1003 of file PpmByteStreamReadV1V2Tool.cxx.
1012 std::vector<uint8_t> lcpVal;
1013 std::vector<uint8_t> lcpBcidVec;
1015 std::vector<uint16_t> adcVal;
1016 std::vector<uint8_t> adcExt;
1018 for(
auto lut: luts) {
1019 lcpVal.push_back(BitField::get<uint8_t>(
lut, 0, 8));
1020 lcpBcidVec.push_back(BitField::get<uint8_t>(
lut, 8, 3));
1024 adcExt.push_back(BitField::get<uint8_t>(
f, 0, 1));
1025 adcVal.push_back(BitField::get<uint16_t>(
f, 1, 10));
1030 std::move(lcpVal), std::move(lcpBcidVec),
1031 std::move(adcVal), std::move(adcExt)));
1033 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 976 of file PpmByteStreamReadV1V2Tool.cxx.
987 std::vector<uint8_t> ljeSat80Vec;
989 std::vector<int16_t> pedCor;
990 std::vector<uint8_t> pedEn;
994 std::move(luts), std::move(lcpBcidVec),
995 std::move(luts) , std::move(ljeSat80Vec),
996 std::move(fadc), std::move(bcidExt),
997 std::move(pedCor), std::move(pedEn))
1000 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 930 of file PpmByteStreamReadV1V2Tool.cxx.
952 if (!isData && !state.m_ppmIsRetSpare && !state.m_ppmIsRetMuon){
953 return StatusCode::SUCCESS;
960 phi = 4 * pin + asic;
964 state.m_triggerTowers->push_back(
tt);
966 tt->initialize(coolId, eta, phi,
967 std::move(lcpVal), std::move(ljeVal),
968 std::move(pedCor), std::move(pedEn),
969 std::move(lcpBcidVec), std::move(adcVal),
970 std::move(adcExt), std::move(ljeSat80Vec),
971 0, state.m_caloUserHeader.lut(),
972 state.m_caloUserHeader.ppFadc());
973 return StatusCode::SUCCESS;
◆ convert() [1/3]
Definition at line 140 of file PpmByteStreamReadV1V2Tool.cxx.
144 state.m_triggerTowers = ttCollection;
145 const std::vector<uint32_t>& vID(
ppmSourceIDs(state, sgKey));
148 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"PpmByteStreamxAODReadTool");
149 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
152 return StatusCode::SUCCESS;
◆ convert() [2/3]
Definition at line 107 of file PpmByteStreamReadV1V2Tool.cxx.
115 state.m_subDetectorID = eformat::TDAQ_CALO_PREPROC;
121 for (; rob != robEnd; ++rob, ++robCounter) {
124 if (!
sc.isSuccess()) {
130 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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
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
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 500 of file PpmByteStreamReadV1V2Tool.cxx.
504 std::vector<uint16_t>
adc = {0, 0, 0, 0, 0};
511 longField =
br.getField(1);
512 numBits = longField == 0? 4: (
format * 2);
514 numBits =
i == 0? 4: (
format + 2);
518 minAdc =
br.getField(numBits);
519 if (longField == 0) {
520 minAdc += state.m_caloUserHeader.ppLowerBound();
523 adc[
i] = minAdc +
br.getField(numBits);
531 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 787 of file PpmByteStreamReadV1V2Tool.cxx.
792 uint8_t numAdc = state.m_subBlockHeader.nSlice2();
796 return std::vector<uint16_t>(numAdc,
val);
798 std::vector<uint16_t>
adc(numAdc, 0);
799 uint16_t minAdc =
br.getField(5) + state.m_caloUserHeader.ppLowerBound();
800 adc[minIndex] = minAdc;
806 std::vector<uint16_t>
adc(numAdc, 0);
810 state.m_caloUserHeader.ppLowerBound());
812 adc[minIndex] = minAdc;
814 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 84 of file PpmByteStreamReadV1V2Tool.cxx.
95 return StatusCode::SUCCESS;
◆ initSourceIDs()
void LVL1BS::PpmByteStreamReadV1V2Tool::initSourceIDs |
( |
| ) |
|
|
private |
Definition at line 1039 of file PpmByteStreamReadV1V2Tool.cxx.
1041 const int crates = 8;
1047 for (
int crate = 0; crate < crates; ++crate) {
1050 eformat::TDAQ_CALO_PREPROC);
1053 if (crate > 1 && crate < 6) {
1055 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 736 of file PpmByteStreamReadV1V2Tool.cxx.
743 minHeader =
br.getField(4);
745 minIndex = minHeader % 5;
747 if (minHeader < 10) {
759 }
else if (numAdc == 7) {
761 }
else if (numAdc < 16) {
766 uint8_t fieldSize = 1 << numBits;
767 minHeader =
br.getField(numBits);
768 uint8_t encValue = fieldSize - 1;
769 if (minHeader == encValue) {
773 minHeader +=
br.getField(2) << numBits;
774 minIndex = minHeader % fieldSize;
775 encValue = 3 * fieldSize;
777 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 1065 of file PpmByteStreamReadV1V2Tool.cxx.
1069 state.m_ppmIsRetMuon =
false;
1070 state.m_ppmIsRetSpare =
false;
1072 if (sgKey.find(
"Muon") != std::string::npos) {
1073 state.m_ppmIsRetMuon =
true;
1074 }
else if (sgKey.find(
"Spare") != std::string::npos) {
1075 state.m_ppmIsRetSpare =
true;
1078 if (state.m_ppmIsRetSpare) {
1082 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, 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 293 of file PpmByteStreamReadV1V2Tool.cxx.
295 if (state.m_ppBlock.size() > 0) {
296 if (state.m_subBlockHeader.format() == 0) {
302 if (state.m_verCode == 0x31) {
308 if (state.m_verCode == 0x41 || state.m_verCode == 0x42) {
315 if (state.m_ppLuts.size() > 0) {
316 if (state.m_verCode == 0x21 || state.m_verCode == 0x31) {
322 <<
int(state.m_subBlockHeader.format())
323 <<
"' for rob version '"
324 << MSG::hex <<
int(state.m_verCode)
325 << MSG::dec <<
"'" );
326 return StatusCode::FAILURE;
328 return StatusCode::SUCCESS;
◆ processPpmBlockR3V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlockR3V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 822 of file PpmByteStreamReadV1V2Tool.cxx.
824 if (state.m_subBlockHeader.format() == 1) {
826 return StatusCode::SUCCESS;
827 }
else if (state.m_subBlockHeader.format() >= 2) {
829 return StatusCode::FAILURE;
831 return StatusCode::FAILURE;
◆ processPpmBlockR4V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlockR4V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 577 of file PpmByteStreamReadV1V2Tool.cxx.
579 if (state.m_subBlockHeader.format() == 1) {
581 return StatusCode::SUCCESS;
582 }
else if (state.m_subBlockHeader.format() >= 2) {
584 return StatusCode::SUCCESS;
586 return StatusCode::FAILURE;
◆ processPpmCompressedR3V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmCompressedR3V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 416 of file PpmByteStreamReadV1V2Tool.cxx.
418 BitReader
br (state.m_ppBlock);
423 if (state.m_subBlockHeader.format() == 3) {
424 present =
br.getField(1);
434 std::vector<uint16_t> adcVal = {0 , 0, 0, 0, 0};
435 std::vector<uint8_t> adcExt = {0 , 0, 0, 0, 0};
438 uint8_t minIndex = minHeader % 5;
439 if (minHeader < 15) {
440 if (minHeader < 10) {
443 fmt = 2 +
br.getField( 2);
447 lutVal =
br.getField(3);
453 lutVal =
br.getField(8);
454 lutExt =
br.getField(1);
455 lutSat =
br.getField(1);
456 lutPeak =
br.getField(1);
461 adcExt[
i] =
br.getField(1);
482 state.m_subBlockHeader.crate(),
483 state.m_subBlockHeader.module(),
485 std::vector<uint8_t> {lutVal},
486 std::vector<uint8_t> {uint8_t(lutExt | (lutSat << 1) | (lutPeak << 2))},
493 }
catch (
const std::out_of_range& ex) {
497 return StatusCode::SUCCESS;
◆ processPpmCompressedR4V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmCompressedR4V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 589 of file PpmByteStreamReadV1V2Tool.cxx.
591 BitReader
br (state.m_ppBlock);
592 uint8_t numAdc = state.m_subBlockHeader.nSlice2();
593 uint8_t numLut = state.m_subBlockHeader.nSlice1();
601 std::vector<uint8_t> haveLut(numLut, 0);
602 std::vector<uint8_t> lcpVal(numLut, 0);
604 std::vector<uint8_t> lcpExt(numLut, 0);
605 std::vector<uint8_t> lcpSat(numLut, 0);
606 std::vector<uint8_t> lcpPeak(numLut, 0);
607 std::vector<uint8_t> lcpBcidVec(numLut, 0);
609 std::vector<uint8_t> ljeVal(numLut, 0);
611 std::vector<uint8_t> ljeLow(numLut, 0);
612 std::vector<uint8_t> ljeHigh(numLut, 0);
613 std::vector<uint8_t> ljeRes(numLut, 0);
614 std::vector<uint8_t> ljeSat80Vec(numLut, 0);
616 std::vector<uint16_t> adcVal(numAdc, 0);
617 std::vector<uint8_t> adcExt(numAdc, 0);
618 std::vector<int16_t> pedCor(numLut, 0);
619 std::vector<uint8_t> pedEn(numLut, 0);
622 int8_t minIndex = -1;
624 if (state.m_subBlockHeader.format() == 3) {
625 present =
br.getField(1);
633 for(
uint i=0;
i < numLut; ++
i) {
634 lcpPeak[
i] =
br.getField(1);
639 ljeLow[
i] =
br.getField(1);
646 if (lcpPeak[
i] == 1) {
647 lcpVal[
i] =
br.getField(4);
651 if (lcpPeak[
i] == 1){
652 ljeVal[
i] =
br.getField(3);
659 haveLut[
i] =
br.getField(1);
667 adcExt[
i] =
br.getField(1);
672 if (haveLut[
i] == 1) {
673 lcpVal[
i] =
br.getField(8);
674 lcpExt[
i] =
br.getField(1);
675 lcpSat[
i] =
br.getField(1);
676 lcpPeak[
i] =
br.getField(1);
681 if (haveLut[
i] == 1) {
682 ljeVal[
i] =
br.getField(8);
683 ljeLow[
i] =
br.getField(1);
684 ljeHigh[
i] =
br.getField(1);
685 ljeRes[
i] =
br.getField(1);
698 pedCor[
i] =
br.getField(6) + pedCorBase;
699 if (state.m_subBlockHeader.compVer() > 0) {
710 pedCor[
i] = ::pedCorrection(
val);
711 pedEn[
i] =
br.getField(1);
716 lcpBcidVec[
i] =
uint8_t((lcpPeak[
i] << 2) | (lcpSat[
i] << 1) | lcpExt[
i]);
717 ljeSat80Vec[
i] =
uint8_t((ljeRes[
i] << 2) | (ljeHigh[
i] << 1) | ljeLow[
i]);
720 state.m_subBlockHeader.crate(), state.m_subBlockHeader.module(),
722 std::move(lcpVal), std::move(lcpBcidVec),
723 std::move(ljeVal), std::move(ljeSat80Vec),
724 std::move(adcVal), std::move(adcExt),
725 std::move(pedCor), std::move(pedEn)));
727 }
catch (
const std::out_of_range& ex) {
732 return StatusCode::SUCCESS;
◆ processPpmNeutral_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmNeutral_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 331 of file PpmByteStreamReadV1V2Tool.cxx.
333 uint8_t numLut = state.m_subBlockHeader.nSlice1();
334 uint8_t numFadc = state.m_subBlockHeader.nSlice2();
335 uint8_t totSlice = 3 * numLut + numFadc;
338 for (
int asic = 0 ; asic < 4 ; ++asic ) {
339 for (
int mcm = 0 ; mcm < 16 ; ++mcm ) {
341 std::vector<uint32_t> rotated(totSlice);
344 for (
uint8_t bit = 0 ; bit < 11 ; ++bit ) {
345 if ( state.m_ppBlock[
slice * 11 + asic * (11 * totSlice) + bit + 1] & (1 << mcm))
346 rotated[
slice] |= (1 << bit);
350 bool nonZeroData =
false;
353 || rotated[
slice + numLut]
354 || rotated[
slice + 2 * numLut + numFadc]) {
360 std::vector<uint8_t> lcpVal;
361 std::vector<uint8_t> lcpBcidVec;
362 std::vector<uint8_t> ljeVal;
363 std::vector<uint8_t> ljeSat80Vec;
364 std::vector<int16_t> pedCor;
365 std::vector<uint8_t> pedEn;
367 std::vector<uint16_t> adcVal;
368 std::vector<uint8_t> adcExt;
372 lcpVal.push_back(rotated[
slice] & 0xff);
373 ljeVal.push_back(rotated[
slice + numLut] & 0xff);
374 pedCor.push_back(::pedCorrection(rotated[
slice + 2 * numLut + numFadc] & 0x3ff));
376 lcpBcidVec.push_back((rotated[
slice] >> 8) & 0x7);
377 ljeSat80Vec.push_back((rotated[
slice + numLut] >> 8) & 0x7);
378 pedEn.push_back((rotated[
slice + 2 * numLut + numFadc] >> 10) & 0x1);
383 if (rotated[
slice + numLut]) {
391 adcVal.push_back(rotated[
slice + 2 * numLut] & 0x3ff);
392 adcExt.push_back((rotated[
slice + 2 * numLut] >> 10 & 0
x1) & 0x3ff);
398 state.m_subBlockHeader.crate(),
399 state.m_subBlockHeader.module(),
402 std::move(lcpBcidVec),
404 std::move(ljeSat80Vec),
413 return StatusCode::SUCCESS;
◆ processPpmStandardR3V1_() [1/2]
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR3V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 894 of file PpmByteStreamReadV1V2Tool.cxx.
896 for(
auto lut : state.m_ppLuts) {
899 state.m_subBlockHeader.crate(),
900 state.m_subBlockHeader.module(),
903 state.m_ppFadcs[
lut.first]));
905 return StatusCode::SUCCESS;
◆ processPpmStandardR3V1_() [2/2]
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR3V1_ |
( |
State & |
state, |
|
|
uint32_t |
word, |
|
|
int |
indata |
|
) |
| const |
|
private |
Definition at line 538 of file PpmByteStreamReadV1V2Tool.cxx.
544 if (state.m_subBlockHeader.seqNum() == 63) {
548 const uint8_t numAdc = state.m_subBlockHeader.nSlice2();
549 const uint8_t numLut = state.m_subBlockHeader.nSlice1();
550 const uint8_t nTotal = numAdc + numLut;
551 const uint8_t wordsPerBlock = 8;
552 const uint8_t iBlk = inData / wordsPerBlock;
553 uint8_t iChan = state.m_subBlockHeader.seqNum() + 2 * (inData % wordsPerBlock);
557 uint16_t subword = (word >> 16 *
i) & 0x7ff;
558 state.m_ppLuts[iChan].push_back(subword);
561 }
else if (iBlk < nTotal) {
563 uint16_t subword = (word >> (16 *
i)) & 0x7ff;
564 state.m_ppFadcs[iChan].push_back(subword);
570 sc = StatusCode::FAILURE;
◆ processPpmStandardR4V1_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR4V1_ |
( |
State & |
state | ) |
const |
|
private |
Definition at line 834 of file PpmByteStreamReadV1V2Tool.cxx.
836 BitReader
br (state.m_ppBlock);
837 uint8_t numAdc = state.m_subBlockHeader.nSlice2();
838 uint8_t numLut = state.m_subBlockHeader.nSlice1();
839 uint8_t crate = state.m_subBlockHeader.crate();
845 std::vector<uint8_t> lcpVal;
846 std::vector<uint8_t> lcpBcidVec;
848 std::vector<uint8_t> ljeVal;
849 std::vector<uint8_t> ljeSat80Vec;
853 std::vector<uint16_t> adcVal;
854 std::vector<uint8_t> adcExt;
855 std::vector<int16_t> pedCor;
856 std::vector<uint8_t> pedEn;
858 for (
int i = 0;
i < numLut; ++
i) {
859 lcpVal.push_back(
br.getField(8));
860 lcpBcidVec.push_back(
br.getField(3));
863 for (
int i = 0;
i < numLut; ++
i) {
864 ljeVal.push_back(
br.getField(8));
865 ljeSat80Vec.push_back(
br.getField(3));
868 for (
int i = 0;
i < numAdc; ++
i) {
869 adcVal.push_back(
br.getField(10));
870 adcExt.push_back(
br.getField(1));
873 for (
int i = 0;
i < numLut; ++
i) {
875 pedCor.push_back(pedCorrection(
pc));
876 pedEn.push_back(
br.getField(1));
878 }
catch (
const std::out_of_range& ex) {
885 std::move(lcpVal), std::move(lcpBcidVec),
886 std::move(ljeVal), std::move(ljeSat80Vec),
887 std::move(adcVal), std::move(adcExt),
888 std::move(pedCor), std::move(pedEn)));
891 return StatusCode::SUCCESS;
◆ processPpmWord_()
StatusCode LVL1BS::PpmByteStreamReadV1V2Tool::processPpmWord_ |
( |
State & |
state, |
|
|
uint32_t |
word, |
|
|
int |
indata |
|
) |
| const |
|
private |
Definition at line 273 of file PpmByteStreamReadV1V2Tool.cxx.
277 if ( (state.m_subBlockHeader.format() == 0)
278 || (state.m_subBlockHeader.format() >= 2)
279 || (state.m_verCode >= 0x41)) {
280 state.m_ppBlock.push_back(word);
281 }
else if ((state.m_verCode == 0x21) || (state.m_verCode == 0x31)) {
285 << state.m_verCode <<
":" << state.m_subBlockHeader.format()
287 return StatusCode::FAILURE;
289 return StatusCode::SUCCESS;
◆ processRobFragment_()
Definition at line 156 of file PpmByteStreamReadV1V2Tool.cxx.
160 auto rob = **robIter;
163 "Treating ROB fragment source id #" << MSG::hex << rob.rob_source_id());
166 state.m_rodSourceId = rob.rod_source_id();
167 state.m_robSourceId = rob.source_id();
168 const auto sourceID = (state.m_rodSourceId >> 16) & 0xff;
173 if (rob.nstatus() > 0) {
178 m_errorTool->robError(state.m_rodSourceId, *robData);
179 return StatusCode::FAILURE;
187 rob.rod_data(payloadBeg);
188 payloadEnd = payloadBeg + rob.rod_ndata();
193 return StatusCode::FAILURE;
198 uint16_t rodVer = rob.rod_version() & 0xffff;
199 uint32_t rodRunNumber = rob.rod_run_no() & 0xffffff;
200 state.m_verCode = ((rodVer & 0xfff) << 4) | 1;
203 if (sourceID != state.m_subDetectorID) {
204 ATH_MSG_ERROR(
"Wrong subdetector source id for requested objects: " << state.m_rodSourceId);
205 return StatusCode::FAILURE;
208 ATH_MSG_DEBUG(
"Treating crate " << rodCrate <<
" slink " << rodSlink);
209 state.m_caloUserHeader = CaloUserHeader(*
payload);
210 if (!state.m_caloUserHeader.isValid()) {
212 return StatusCode::FAILURE;
216 "Run number: " << MSG::dec << rodRunNumber <<
endmsg
217 <<
"Version code: 0x" << MSG::hex <<
int(state.m_verCode) << MSG::dec
218 <<
endmsg <<
"LUT triggered slice offset: "
219 <<
int(state.m_caloUserHeader.lut()) <<
endmsg
220 <<
"FADC triggered slice offset: " <<
int(state.m_caloUserHeader.ppFadc())
221 <<
endmsg <<
"FADC baseline lower bound: "
222 <<
int(state.m_caloUserHeader.ppLowerBound()));
235 state.m_ppLuts.clear();
236 state.m_ppFadcs.clear();
237 state.m_ppBlock.clear();
242 state.m_subBlockHeader = SubBlockHeader(*
payload);
244 "SubBlock version #" <<
int(state.m_subBlockHeader.version())
245 <<
" format #" <<
int(state.m_subBlockHeader.format())
246 <<
" seqNum (compVer) #" <<
int(state.m_subBlockHeader.seqNum())
247 <<
" nslice1 #" <<
int(state.m_subBlockHeader.nSlice1())
248 <<
" nslice2 #" <<
int(state.m_subBlockHeader.nSlice2())
251 }
else if (
blockType == (subBlock | 1)) {
256 switch(state.m_subDetectorID){
257 case eformat::TDAQ_CALO_PREPROC:
267 state.m_ppLuts.clear();
268 state.m_ppFadcs.clear();
269 state.m_ppBlock.clear();
270 return StatusCode::SUCCESS;
◆ processSubBlockStatus_()
void LVL1BS::PpmByteStreamReadV1V2Tool::processSubBlockStatus_ |
( |
State & |
state, |
|
|
uint8_t |
crate, |
|
|
uint8_t |
module, |
|
|
uint32_t |
word |
|
) |
| const |
|
private |
Definition at line 908 of file PpmByteStreamReadV1V2Tool.cxx.
915 int curr = state.m_triggerTowers->size() - 1;
920 auto tt = (*state.m_triggerTowers)[curr--];
921 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_useSWROD
bool LVL1BS::PpmByteStreamReadV1V2Tool::m_useSWROD = false |
|
private |
◆ 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.
static void useSWROD(bool in)
Flag to decide if SWROD readout should be used instead of legacy.
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
constexpr auto lut(Generator &&f)
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.
CalibratedSpacePoint::State State
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.