5#ifndef TILEBYTESTREAM_TILEROD_DECODER_H
6#define TILEBYTESTREAM_TILEROD_DECODER_H
45#include "eformat/ROBFragment.h"
50#include "GaudiKernel/ToolHandle.h"
73template <
class COLLECTION>
138 TileROD_Decoder(
const std::string&
type,
const std::string& name,
const IInterface* parent);
155 template<
class COLLECTION>
181 for (
unsigned int i = 0; i <
vec.size(); ++i) {
186 void loadMBTS(std::map<unsigned int, unsigned int>& mapMBTS,
int MBTS_channel);
197 for (
unsigned int i = 0; i <
vec.size(); ++i) {
215 std::lock_guard<std::mutex> lock (
m_HidMutex);
250 const uint32_t*
getOFW(
int fragId,
int unit)
const;
254 void unpack_frag0(uint32_t version, uint32_t sizeOverhead,
256 const uint32_t* p,
pDigiVec & pDigits,
int fragID,
int demoType)
const;
261 void unpack_frag1(uint32_t version, uint32_t sizeOverhead,
263 const uint32_t* p,
pDigiVec & pDigits,
int fragID,
int demoType)
const;
272 void unpack_frag2(uint32_t version, uint32_t sizeOverhead,
273 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
282 void unpack_frag3(uint32_t version, uint32_t sizeOverhead,
283 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
296 void unpack_frag4(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
298 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
312 void unpack_frag5(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
314 const uint32_t* p,
pDigiVec & pDigits,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
318 void unpack_frag6(uint32_t version, uint32_t sizeOverhead,
320 const uint32_t* p,
pDigiVec & pDigits,
int fragID,
int demoType)
const;
331 const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
342 const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
356 void unpack_frag4HLT(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
369 void unpack_frag5HLT(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
375 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
378 void unpack_fragAHLT(uint32_t version,
const uint32_t* p, uint16_t rob_bcid,
379 uint16_t& mask,
int fragID,
int demoType)
const;
441 void unpack_brod(uint32_t version, uint32_t sizeOverhead,
const uint32_t* p,
pBeamVec & pBeam,
int fragID)
const;
477 bool correctAmplitude,
488 template<
typename ELEMENT>
489 inline void delete_vec(std::vector<ELEMENT *> & v)
const;
491 template<
typename ELEMENT,
class COLLECTION>
492 inline void copy_vec(std::vector<ELEMENT *> & v, COLLECTION & coll)
const;
496 bool checkBit(
const uint32_t* p,
int chan)
const;
506 Gaudi::Property<bool>
m_useFrag0{
this,
"useFrag0",
true,
"Use frag0"};
507 Gaudi::Property<bool>
m_useFrag1{
this,
"useFrag1",
true,
"Use frag1"};
508 Gaudi::Property<bool>
m_useFrag4{
this,
"useFrag4",
true,
"User frag4"};
509 Gaudi::Property<bool>
m_useFrag5Raw{
this,
"useFrag5Raw",
false,
"Use frag5 raw"};
510 Gaudi::Property<bool>
m_useFrag5Reco{
this,
"useFrag5Reco",
false,
"Use frag5 reco"};
515 "Set amplitude to zero if time is below allowed time minimum"};
517 "Set amplitude to zero if time is above allowed time maximum"};
521 "Correct amplitude if it's above amplitude threshold (in ADC counts)"};
523 "Correct amplitude is time is above time minimum threshold"};
525 "Correct amplitude is time is below time maximum threshold"};
528 "Run from which to take the cabling (for the moment, either 320000 - full 2017 mode (default) - or 0 - 2016 mode)"};
531 "DemoFragIDs", {},
"List of Tile frag IDs with new electronics (demonstrator)"};
533 Gaudi::Property<bool>
m_verbose{
this,
"VerboseOutput",
false,
"Print extra information"};
534 Gaudi::Property<bool>
m_calibrateEnergy{
this,
"calibrateEnergy",
true,
"Convert ADC counts to pCb for RawChannels"};
537 "Put -1 in digits vector for channels with bad BCID or CRC in unpack_frag0"};
539 Gaudi::Property<int>
m_maxWarningPrint{
this,
"MaxWarningPrint", 1000,
"Maximum warning messages to print"};
540 Gaudi::Property<int>
m_maxErrorPrint{
this,
"MaxErrorPrint", 1000,
"Maximum error messages to print"};
543 "TileHid2RESrcID",
"TileHid2RESrcID",
"TileHid2RESrcID key"};
546 "TileCondToolTiming",
"TileCondToolTiming",
"Tile timing tool"};
548 "TileCondToolOfcCool",
"TileCondToolOfcCool",
"Tile OFC tool"};
550 "TileCondToolEmscale",
"TileCondToolEmscale",
"Tile EM scale calibration tool"};
552 "TileBadChanTool",
"TileBadChanTool",
"Tile bad channel tool"};
554 "TileL2Builder",
"",
"Tile L2 builder tool"};
560 "TileCablingSvc",
"TileCablingSvc",
"The Tile cabling service"};
611 if (rob->rod_status_position()==0 &&
612 rob->rod_nstatus() + rob->rod_header_size_word() + rob->rod_trailer_size_word() >= rob->rod_fragment_size_word()) {
621 uint32_t size = rob->rod_ndata();
622 uint32_t max_allowed_size = rob->rod_fragment_size_word();
623 uint32_t delta = rob->rod_header_size_word() + rob->rod_trailer_size_word();
624 if (max_allowed_size > delta)
625 max_allowed_size -= delta;
627 max_allowed_size = 0;
628 if (size < 3 && size > 0) {
629 if (rob->rod_source_id() > 0x50ffff)
error |= 0x10000;
632 <<
" ROD " << rob->rod_source_id() << MSG::dec
633 <<
" has unexpected data size: " << size <<
" - assuming zero size " );
636 }
else if (rob->rod_header_size_word() >= rob->rod_fragment_size_word()) {
637 if (rob->rod_source_id() > 0x50ffff)
error |= 0x10000;
640 <<
" ROD " << rob->rod_source_id() << MSG::dec
641 <<
" has unexpected header size: " << rob->rod_header_size_word()
642 <<
" bigger than full size " << rob->rod_fragment_size_word()
643 <<
" - assuming no data " );
646 }
else if (size > max_allowed_size) {
647 if (rob->rod_source_id() > 0x50ffff)
error |= 0x10000;
649 if (size - rob->rod_trailer_size_word() < max_allowed_size) {
652 <<
" ROD " << rob->rod_source_id() << MSG::dec
653 <<
" data size " << size <<
" is longer than allowed size " << max_allowed_size
654 <<
" - assuming that ROD trailer is shorter: "
655 << rob->rod_trailer_size_word()-(size-max_allowed_size)
656 <<
" words instead of " << rob->rod_trailer_size_word());
658 max_allowed_size = size;
659 }
else if (size - rob->rod_trailer_size_word() == max_allowed_size) {
662 <<
" ROD " << rob->rod_source_id() << MSG::dec
663 <<
" data size " << size <<
" is longer than allowed size " << max_allowed_size
664 <<
" - assuming that ROD trailer ("
665 << rob->rod_trailer_size_word()
666 <<
" words) is absent");
668 max_allowed_size = size;
670 max_allowed_size += rob->rod_trailer_size_word();
673 <<
" ROD " << rob->rod_source_id() << MSG::dec
674 <<
" has unexpected data size: " << size
675 <<
" - assuming data size = " << max_allowed_size <<
" words and no ROD trailer at all" );
678 return max_allowed_size;
685template<
typename ELEMENT>
687 typedef typename std::vector<ELEMENT *>::const_iterator ELEMENT_const_iterator;
689 ELEMENT_const_iterator iCh = v.begin();
690 ELEMENT_const_iterator iEnd = v.end();
691 for (; iCh != iEnd; ++iCh)
delete (*iCh);
695template<
typename ELEMENT,
class COLLECTION>
697 typedef typename std::vector<ELEMENT *>::const_iterator ELEMENT_const_iterator;
699 ELEMENT_const_iterator iCh = v.begin();
700 ELEMENT_const_iterator iEnd = v.end();
701 for (; iCh != iEnd; ++iCh) coll.push_back(*iCh);
718 if (pChannel.size() > 0) {
722 v.setLvl1Id(rob->rod_lvl1_id());
723 v.setLvl1Type(rob->rod_lvl1_trigger_type());
724 v.setDetEvType(rob->rod_detev_type());
725 v.setRODBCID(rob->rod_bc_id());
728 for (
size_t j=0; j<digitsMetaData[6].size(); ++j) {
729 status |= digitsMetaData[6][j];
734 v.setFragSize(digitsMetaData[0][0]);
735 v.setFragBCID(digitsMetaData[0][2] | (status<<16));
737 v.setFragExtraWords(digitsMetaData[1]);
739 v.setFragChipHeaderWords(digitsMetaData[2]);
740 v.setFragChipCRCWords(digitsMetaData[3]);
742 if (v.isCalibMode()) {
743 v.setFragChipHeaderWordsHigh(digitsMetaData[4]);
744 v.setFragChipCRCWordsHigh(digitsMetaData[5]);
747 }
else if ( digitsMetaData[0].size() == 0 ) {
750 v.setFragBCID(0xDEAD | (status<<16));
755 ATH_MSG_DEBUG(
"Status for drawer 0x" << MSG::hex << v.identify() <<
" in Digi frag is 0x" << status << MSG::dec);
770 if (pChannel.size() > 0) {
774 <<
" - setting unit in TileRawChannelContainer " );
779 ATH_MSG_ERROR(
"Can't set unit=" << rChUnit <<
" in TileRawChannelContainer" );
788 if (pDigits.size() > 0) {
796 ATH_MSG_DEBUG(
"data for drawer 0x" << MSG::hex << v.identify() << MSG::dec <<
" not found in BS" );
807 v.setLvl1Id(rob->rod_lvl1_id());
808 v.setLvl1Type(rob->rod_lvl1_trigger_type());
809 v.setDetEvType(rob->rod_detev_type());
810 v.setRODBCID(rob->rod_bc_id());
813 rawchannelMetaData[0].push_back(0);
814 rawchannelMetaData[0].push_back(0xDEAD);
815 rawchannelMetaData[5].push_back(0xFFFF);
816 rawchannelMetaData[5].push_back(0xFFFF);
819 for (
unsigned int i = 0; i < 6; ++i) {
820 for (
size_t j=rawchannelMetaData[i].size(); j<2; ++j) {
821 rawchannelMetaData[i].push_back(0);
826 for (
size_t j=0; j<rawchannelMetaData[6].size(); ++j) {
827 status |= rawchannelMetaData[6][j];
830 ATH_MSG_DEBUG(
"Status for drawer 0x" << MSG::hex << v.identify() <<
" is 0x" << status << MSG::dec);
832 v.setFragGlobalCRC(status);
833 v.setFragDSPBCID(rawchannelMetaData[0][1]);
834 v.setFragBCID(rawchannelMetaData[1][0]);
835 v.setFragMemoryPar(rawchannelMetaData[1][1]);
836 v.setFragSstrobe(rawchannelMetaData[2][0]);
837 v.setFragDstrobe(rawchannelMetaData[2][1]);
838 v.setFragHeaderBit(rawchannelMetaData[3][0]);
839 v.setFragHeaderPar(rawchannelMetaData[3][1]);
840 v.setFragSampleBit(rawchannelMetaData[4][0]);
841 v.setFragSamplePar(rawchannelMetaData[4][1]);
842 v.setFragFEChipMask(rawchannelMetaData[5][0]);
844 v.setFragRODChipMask(rawchannelMetaData[5][0]);
846 v.setFragRODChipMask(rawchannelMetaData[5][1]);
869 v.setLvl1Id(rob->rod_lvl1_id());
870 v.setLvl1Type(rob->rod_lvl1_trigger_type());
871 v.setDetEvType(rob->rod_detev_type());
872 v.setRODBCID(rob->rod_bc_id());
903template<
class COLLECTION>
929 uint32_t version = rob->rod_version() & 0xFFFF;
931 bool isBeamROD =
false;
935 const std::vector<uint32_t> & drawer_info = hid2re->getDrawerInfo(frag_id);
936 int bs_frag_id = drawer_info.size()>1 ?
static_cast<int>(drawer_info[1]) : frag_id;
937 int drawer_type = drawer_info.size()>2 ?
static_cast<int>(drawer_info[2]) : -1;
939 uint32_t mask = 0xFFFF;
942 if (frag_id < 0x100) {
949 std::vector<const uint32_t *> pFrag;
959 uint32_t sizeOverhead = 2;
964 bool V3format = (*(p) == 0xff1234ff);
965 V3format |= (*(p) == 0x00123400);
966 if (!V3format && version>0xff) {
969 ATH_MSG_WARNING(
"fillCollection: corrupted frag separator 0x" << MSG::hex << (*p) <<
" instead of 0xff1234ff in ROB 0x" << rob->rod_source_id() << MSG::dec );
988 uint32_t
count = *(p);
990 uint32_t idAndType = *(p + 1);
991 int frag = (idAndType & mask);
992 int type = (idAndType & 0xF00000) >> 16;
996 for (; wc < size; ++wc, ++cnt, ++p) {
997 if ((*p) == 0xff1234ff) {
1005 msg(MSG::WARNING) <<
"Frag 0x" << MSG::hex << frag << MSG::dec
1006 <<
" has unexpected size: " <<
count;
1008 msg(MSG::WARNING) <<
" skipping " << cnt <<
" words to the next frag" <<
endmsg;
1010 msg(MSG::WARNING) <<
" ignoring " << cnt <<
" words till the end of ROD frag" <<
endmsg;
1016 if (
type != 0x10 && frag == bs_frag_id) pFrag.push_back(p);
1032 ATH_MSG_WARNING(
"Incorrect ROD size: " << wc <<
" words instead of " << size );
1038 static const bool unpackDigits = std::is_same_v<COLLECTION, TileDigitsCollection>;
1039 static const bool unpackChannels = std::is_same_v<COLLECTION, TileRawChannelCollection>;
1046 std::vector<const uint32_t *>::const_iterator it = pFrag.begin();
1047 std::vector<const uint32_t *>::const_iterator itEnd = pFrag.end();
1049 for (; it != itEnd; ++it) {
1053 unpack_brod(version, sizeOverhead, p, pBeam, frag_id);
1062 pChannel.reserve(48);
1067 for (
unsigned int i = 0; i < 7; ++i) {
1068 digitsMetaData[i].reserve(16);
1069 rawchannelMetaData[i].reserve(2);
1075 std::vector<const uint32_t *>::const_iterator it = pFrag.begin();
1076 std::vector<const uint32_t *>::const_iterator itEnd = pFrag.end();
1078 uint32_t bsflags = 0;
1082 for (; it != itEnd; ++it) {
1088 uint32_t idAndType = *(p + 1);
1089 int type = (idAndType & 0x00FF0000) >> 16;
1091 ATH_MSG_VERBOSE(
"Unpacking frag: 0x" << MSG::hex << (idAndType & 0xFFFF)
1092 <<
" type " <<
type << MSG::dec );
1096 if (unpackDigits &&
m_useFrag0)
unpack_frag0(version, sizeOverhead, digitsMetaData, p, pDigits, frag_id, drawer_type);
1099 if (unpackDigits &&
m_useFrag1)
unpack_frag1(version, sizeOverhead, digitsMetaData, p, pDigits, frag_id, drawer_type);
1102 if (unpackChannels &&
m_useFrag4)
unpack_frag2(version, sizeOverhead, p, pChannel, frag_id, drawer_type);
1105 if (unpackChannels &&
m_useFrag4)
unpack_frag3(version, sizeOverhead, p, pChannel, frag_id, drawer_type);
1109 bsflags = idAndType & 0xFFFF0000;
1110 int unit = (idAndType & 0xC0000000) >> 30;
1112 int DataType = (idAndType & 0x30000000) >> 28;
1130 int AlgoType = (idAndType & 0x7000000) >> 24;
1136 const_cast<Gaudi::Property<std::vector<int>
> &> (
m_demoFragIDs ) = {};
1137 ATH_MSG_INFO(
"Disable channel remapping for demonstrator in MC");
1141 unpack_frag4(version, sizeOverhead,
unit, rawchannelMetaData, p, pChannel, frag_id, drawer_type);
1147 bsflags = idAndType & 0xFFFF0000;
1148 int unit = (idAndType & 0xC0000000) >> 30;
1156 p, pDigits, pChannel, frag_id, drawer_type);
1164 if (unpackChannels)
unpack_fragA(version, rawchannelMetaData, p, pChannel, frag_id, drawer_type);
1168 int frag = idAndType & 0xFFFF;
1175 make_copy(bsflags, rChType, rChUnit, digitsMetaData, rawchannelMetaData,
const boost::regex re(r_e)
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::vector< size_t > vec
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
TileContainer< TileMuonReceiverObj > TileMuonReceiverContainer
TileContainer< TileL2 > TileL2Container
Define macros for attributes used to control the static checker.
static const unsigned int MAX_DRAWERIDX
Maximal drawer index.
This class creates Cells from RawChannels and stores them in a container.
This class converts TileDigits to and from bytestream in ROD format.
Hash table for Tile fragments (==drawers ==collections in StoreGate)
Helper class for TileCal online (hardware) identifiers.
This class provides conversion between fragment ID and RESrcID.
void setVersion(const int version)
void unpack_frag11(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag11 decodes tile subfragment type 0x11.
const TileHWID * getTileHWID() const
Gaudi::Property< bool > m_useFrag1
std::vector< int > m_Rw2Pmt[4]
void make_copy(uint32_t bsflags, TileFragHash::TYPE rChType, TileRawChannelUnit::UNIT rChUnit, DigitsMetaData_t &digitsMetaData, RawChannelMetaData_t &rawchannelMetaData, const ROBData *rob, pDigiVec &pDigits, pRwChVec &pChannel, TileBeamElemCollection &v, TileBeamElemContainer *container) const
uint32_t fillCollectionHLT(const ROBData *rob, TileCellCollection &v, D0CellsHLT &d0cells, TileCellCollection *MBTS, const TileHid2RESrcID *hid2reHLT) const
std::vector< int > m_demoChanEB
void mergeD0cellsHLT(const D0CellsHLT &d0cells, TileCellCollection &) const
float m_ampMinThresh_pC
correct amplitude if it's above amplitude threshold (in pC)
Gaudi::Property< float > m_allowedTimeMin
void fillTileLaserObj(const ROBData *rob, TileLaserObject &v) const
void unpack_frag14(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag14 decodes tile subfragment type 0x14.
bool m_checkMaskedDrawers
const TileHid2RESrcID * getHid2reHLT()
SG::ReadCondHandleKey< TileHid2RESrcID > m_hid2RESrcIDKey
TileHid2RESrcID * m_hid2re
StatusCode convert(const RawEvent *re, TileL2Container *L2Cnt) const
Gaudi::Property< bool > m_calibrateEnergy
void unpack_frag42(uint32_t sourceid, uint32_t version, const uint32_t *p, int size, TileMuonReceiverContainer &v) const
std::vector< uint32_t > get_correct_data(const uint32_t *p) const
void unpack_frag5(uint32_t version, uint32_t sizeOverhead, unsigned int unit, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag5 decodes tile subfragment type 0x4.
void unpack_frag15(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag15 decodes tile subfragment type 0x15.
std::vector< TileDigits * > pDigiVec
void unpack_frag12(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag12 decodes tile subfragment type 0x12.
void updateAmpThreshold(int run=-1)
void unpack_frag41(uint32_t collid, uint32_t version, const uint32_t *p, int size, TileRawChannelCollection &coll) const
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
void copy_vec(std::vector< ELEMENT * > &v, COLLECTION &coll) const
uint32_t make_copyHLT(bool of2, TileRawChannelUnit::UNIT rChUnit, bool correctAmplitude, const FRwChVec &pChannel, TileCellCollection &v, const uint16_t DQuality, D0CellsHLT &d0cells, TileCellCollection *MBTS) const
friend class TileHid2RESrcID
Gaudi::Property< bool > m_useFrag4
Gaudi::Property< int > m_maxWarningPrint
void fillContainer_TileMuRcv_Decision(const ROBData *rob, TileMuonReceiverContainer &v) const
Gaudi::Property< int > m_maxErrorPrint
void unpack_frag3(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag3 decodes tile subfragment type 0x3.
void unpack_frag4(uint32_t version, uint32_t sizeOverhead, unsigned int unit, RawChannelMetaData_t &rawchannelMetaData, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag4 decodes tile subfragment type 0x4.
void unpack_frag4HLT(uint32_t version, uint32_t sizeOverhead, unsigned int unit, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag4HLT decodes tile subfragment type 0x4 for the high level trigger (HLT).
TileRawChannel2Bytes5 m_rc2bytes5
void unpack_frag1(uint32_t version, uint32_t sizeOverhead, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, int fragID, int demoType) const
unpack_frag1 decodes tile subfragment type 0x1.
void unpack_frag10(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag10 decodes tile subfragment type 0x10.
void loadRw2Cell(const int section, const std::vector< int > &vec)
void fillCollectionL2(const ROBData *rob, TileL2Container &v) const
const TileHWID * m_tileHWID
std::vector< std::vector< uint32_t > > RawChannelMetaData_t
Gaudi::Property< float > m_ampMinThresh
Gaudi::Property< float > m_timeMinThresh
Gaudi::Property< bool > m_useFrag5Reco
std::map< unsigned int, unsigned int > m_mapMBTS
std::vector< uint32_t > m_OFWeights[4 *TileCalibUtils::MAX_DRAWERIDX] ATLAS_THREAD_SAFE
std::mutex m_OFWeightMutex
TileRawChannel2Bytes m_rc2bytes
void printWarningCounter(bool printIfNoWarning)
std::vector< TileFastRawChannel > FRwChVec
TileRawChannel2Bytes4 m_rc2bytes4
void loadMBTS(std::map< unsigned int, unsigned int > &mapMBTS, int MBTS_channel)
ToolHandle< TileL2Builder > m_L2Builder
TileDigits2Bytes m_d2Bytes
bool unpack_frag4L2(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag4L2 decodes tile subfragment type 0x4 and extract transverse energy from this fragment
unsigned int m_maxChannels
ToolHandle< TileCondToolOfcCool > m_tileCondToolOfcCool
std::vector< int > m_Rw2Cell[4]
Gaudi::Property< float > m_allowedTimeMax
void unpack_frag6(uint32_t version, uint32_t sizeOverhead, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, int fragID, int demoType) const
unpack_frag6 decodes tile subfragment type 0x6.
TileHid2RESrcID * m_hid2reHLT
void fillCollection_TileMuRcv_RawChannel(const ROBData *rob, TileRawChannelCollection &v) const
Gaudi::Property< std::vector< int > > m_demoFragIDs
void unpack_frag16(uint32_t version, const uint32_t *p, TileLaserObject &v) const
unpack_frag16 decodes tile subfragment type 0x16 or 0x20.
virtual StatusCode finalize()
Gaudi::Property< bool > m_maskBadDigits
std::vector< TileCell * > pCellVec
void unpack_fragAHLT(uint32_t version, const uint32_t *p, uint16_t rob_bcid, uint16_t &mask, int fragID, int demoType) const
unpack_fragAHLT decodes tile subfragment type 0XA.
void unpack_frag2(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag2 decodes tile subfragment type 0x2.
std::vector< int > m_list_of_masked_drawers
void setUseFrag5Reco(bool f)
virtual ~TileROD_Decoder()
destructor
const uint32_t * get_data(const ROBData *rob) const
Gaudi::Property< bool > m_verbose
StatusCode convertTMDBDecision(const RawEvent *re, TileMuonReceiverContainer *tileMuRcv) const
std::atomic< int > m_ErrorCounter
void unpack_frag40(uint32_t collid, uint32_t version, const uint32_t *p, int size, TileDigitsCollection &coll) const
unpacking methods dedicated to the TMDB ROD format sub-fragments 0x40 0x41 0x42
ToolHandle< ITileBadChanTool > m_tileBadChanTool
std::vector< std::vector< uint32_t > > DigitsMetaData_t
void unpack_frag17(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, TileLaserObject &v) const
unpack_frag17 decodes tile subfragment type 0x17 or 0x20.
std::vector< TileRawChannel * > pRwChVec
void fillCollectionL2ROS(const ROBData *rob, TileL2Container &v) const
void fillCollection_TileMuRcv_Digi(const ROBData *rob, TileDigitsCollection &v) const
bool checkBit(const uint32_t *p, int chan) const
check the bitmap for a channel
void unpack_frag3HLT(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag3HLT decodes tile subfragment type 0x3 for the high level trigger (HLT).
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
void printErrorCounter(bool printIfNoError)
void unpack_frag5HLT(uint32_t version, uint32_t sizeOverhead, unsigned int unit, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag5HLT decodes tile subfragment type 0x5 for the high level trigger (HLT).
Gaudi::Property< float > m_timeMaxThresh
void unpack_frag0(uint32_t version, uint32_t sizeOverhead, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, int fragID, int demoType) const
unpack_frag0 decodes tile subfragment type 0x0.
virtual StatusCode initialize()
const TileFragHash * hashFunc() const
std::vector< TileBeamElem * > pBeamVec
void loadRw2Pmt(const int section, const std::vector< int > &vec)
void setUseFrag5Raw(bool f)
void delete_vec(std::vector< ELEMENT * > &v) const
bool unpack_frag5L2(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag5L2 decodes tile subfragment type 0x5 and extract transverse energy from this fragment
TileROD_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
constructor
void setLaserVersion(TileLaserObject &laserObject) const
ToolHandle< TileCondToolTiming > m_tileToolTiming
float m_ampMinThresh_MeV
correct amplitude if it's above amplitude threshold (in MeV)
void fillCollection(const ROBData *rob, COLLECTION &v, typename TileROD_Helper::ContainerForCollection< COLLECTION >::type *container=nullptr) const
This method calls the unpacking methods to decode the ROD data and fills the TileDigitsContainer and/...
Gaudi::Property< bool > m_useFrag5Raw
Gaudi::Property< unsigned int > m_fullTileRODs
Gaudi::Property< bool > m_useFrag0
ServiceHandle< TileCablingSvc > m_cablingSvc
uint32_t data_size(const ROBData *rob, uint32_t &error) const
void unpack_frag13(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag13 decodes tile subfragment type 0x13.
eformat::ROBFragment< const uint32_t * > ROBData
convert ROD Data words into either TileCell or TileRawChannel.
Gaudi::Property< bool > m_ignoreFrag4HLT
std::vector< int > m_demoChanLB
const uint32_t * getOFW(int fragId, int unit) const
getOFW returns Optimal Filtering Weights for Frag5 decoder loaded from COOL for correspondent units.
TileRawChannel2Bytes2 m_rc2bytes2
const TileHid2RESrcID * getHid2re()
std::atomic< int > m_WarningCounter
StatusCode convertLaser(const RawEvent *re, TileLaserObject *TileLaserObj) const
void fillCollection_FELIX_Digi(const ROBData *rob, TileDigitsCollection &v) const
void unpack_brod(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, pBeamVec &pBeam, int fragID) const
unpack_brod decodes all ancillary tile subfragments coming from beam ROD at the testbeam or LASTROD i...
Gaudi::Property< bool > m_suppressDummyFragments
void unpack_frag2HLT(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag2HLT decodes tile subfragment type 0x2 for the high level trigger (HLT).
void unpack_fragA(uint32_t version, RawChannelMetaData_t &rawchannelMetaData, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_fragA decodes tile subfragment type 0XA.
Converts the TileRawChannel object into bytes as it is defined at the testbeam.
Converts the TileRawChannel object into bytes as it is defined at the commissioning 2007.
Converts the TileRawChannel object into bytes as it.
Converts the TileRawChannel object into bytes.
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
TileFastRawChannel m_D0channeg[64]
TileFastRawChannel m_D0chanpos[64]
TileBeamElemContainer type
TileRawChannelContainer type