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) {
253 const uint32_t*
getOFW(
int fragId,
int unit)
const;
257 void unpack_frag0(uint32_t version, uint32_t sizeOverhead,
259 const uint32_t* p,
pDigiVec & pDigits,
int fragID,
int demoType)
const;
264 void unpack_frag1(uint32_t version, uint32_t sizeOverhead,
266 const uint32_t* p,
pDigiVec & pDigits,
int fragID,
int demoType)
const;
275 void unpack_frag2(uint32_t version, uint32_t sizeOverhead,
276 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
285 void unpack_frag3(uint32_t version, uint32_t sizeOverhead,
286 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
299 void unpack_frag4(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
301 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
315 void unpack_frag5(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
317 const uint32_t* p,
pDigiVec & pDigits,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
321 void unpack_frag6(uint32_t version, uint32_t sizeOverhead,
323 const uint32_t* p,
pDigiVec & pDigits,
int fragID,
int demoType)
const;
334 const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
345 const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
359 void unpack_frag4HLT(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
372 void unpack_frag5HLT(uint32_t version, uint32_t sizeOverhead,
unsigned int unit,
const uint32_t* p,
FRwChVec & pChannel,
int fragID,
int demoType)
const;
378 const uint32_t* p,
pRwChVec & pChannel,
int fragID,
int demoType)
const;
381 void unpack_fragAHLT(uint32_t version,
const uint32_t* p, uint16_t rob_bcid,
382 uint16_t& mask,
int fragID,
int demoType)
const;
444 void unpack_brod(uint32_t version, uint32_t sizeOverhead,
const uint32_t* p,
pBeamVec & pBeam,
int fragID)
const;
480 bool correctAmplitude,
491 template<
typename ELEMENT>
492 inline void delete_vec(std::vector<ELEMENT *> & v)
const;
494 template<
typename ELEMENT,
class COLLECTION>
495 inline void copy_vec(std::vector<ELEMENT *> & v, COLLECTION & coll)
const;
499 bool checkBit(
const uint32_t* p,
int chan)
const;
509 Gaudi::Property<bool>
m_useFrag0{
this,
"useFrag0",
true,
"Use frag0"};
510 Gaudi::Property<bool>
m_useFrag1{
this,
"useFrag1",
true,
"Use frag1"};
511 Gaudi::Property<bool>
m_useFrag4{
this,
"useFrag4",
true,
"User frag4"};
512 Gaudi::Property<bool>
m_useFrag5Raw{
this,
"useFrag5Raw",
false,
"Use frag5 raw"};
513 Gaudi::Property<bool>
m_useFrag5Reco{
this,
"useFrag5Reco",
false,
"Use frag5 reco"};
518 "Set amplitude to zero if time is below allowed time minimum"};
520 "Set amplitude to zero if time is above allowed time maximum"};
524 "Correct amplitude if it's above amplitude threshold (in ADC counts)"};
526 "Correct amplitude is time is above time minimum threshold"};
528 "Correct amplitude is time is below time maximum threshold"};
531 "Run from which to take the cabling (for the moment, either 320000 - full 2017 mode (default) - or 0 - 2016 mode)"};
534 "DemoFragIDs", {},
"List of Tile frag IDs with new electronics (demonstrator)"};
536 Gaudi::Property<bool>
m_verbose{
this,
"VerboseOutput",
false,
"Print extra information"};
537 Gaudi::Property<bool>
m_calibrateEnergy{
this,
"calibrateEnergy",
true,
"Convert ADC counts to pCb for RawChannels"};
540 "Put -1 in digits vector for channels with bad BCID or CRC in unpack_frag0"};
542 Gaudi::Property<int>
m_maxWarningPrint{
this,
"MaxWarningPrint", 1000,
"Maximum warning messages to print"};
543 Gaudi::Property<int>
m_maxErrorPrint{
this,
"MaxErrorPrint", 1000,
"Maximum error messages to print"};
546 "TileHid2RESrcID",
"TileHid2RESrcID",
"TileHid2RESrcID key"};
549 "TileCondToolTiming",
"TileCondToolTiming",
"Tile timing tool"};
551 "TileCondToolOfcCool",
"TileCondToolOfcCool",
"Tile OFC tool"};
553 "TileCondToolEmscale",
"TileCondToolEmscale",
"Tile EM scale calibration tool"};
555 "TileBadChanTool",
"TileBadChanTool",
"Tile bad channel tool"};
557 "TileL2Builder",
"",
"Tile L2 builder tool"};
563 "TileCablingSvc",
"TileCablingSvc",
"The Tile cabling service"};
614 if (rob->rod_status_position()==0 &&
615 rob->rod_nstatus() + rob->rod_header_size_word() + rob->rod_trailer_size_word() >= rob->rod_fragment_size_word()) {
624 uint32_t
size = rob->rod_ndata();
625 uint32_t max_allowed_size = rob->rod_fragment_size_word();
626 uint32_t delta = rob->rod_header_size_word() + rob->rod_trailer_size_word();
627 if (max_allowed_size > delta)
628 max_allowed_size -= delta;
630 max_allowed_size = 0;
632 if (rob->rod_source_id() > 0x50ffff)
error |= 0x10000;
635 <<
" ROD " << rob->rod_source_id() << MSG::dec
636 <<
" has unexpected data size: " <<
size <<
" - assuming zero size " );
639 }
else if (rob->rod_header_size_word() >= rob->rod_fragment_size_word()) {
640 if (rob->rod_source_id() > 0x50ffff)
error |= 0x10000;
643 <<
" ROD " << rob->rod_source_id() << MSG::dec
644 <<
" has unexpected header size: " << rob->rod_header_size_word()
645 <<
" bigger than full size " << rob->rod_fragment_size_word()
646 <<
" - assuming no data " );
649 }
else if (
size > max_allowed_size) {
650 if (rob->rod_source_id() > 0x50ffff)
error |= 0x10000;
652 if (
size - rob->rod_trailer_size_word() < max_allowed_size) {
655 <<
" ROD " << rob->rod_source_id() << MSG::dec
656 <<
" data size " <<
size <<
" is longer than allowed size " << max_allowed_size
657 <<
" - assuming that ROD trailer is shorter: "
658 << rob->rod_trailer_size_word()-(
size-max_allowed_size)
659 <<
" words instead of " << rob->rod_trailer_size_word());
661 max_allowed_size =
size;
662 }
else if (
size - rob->rod_trailer_size_word() == max_allowed_size) {
665 <<
" ROD " << rob->rod_source_id() << MSG::dec
666 <<
" data size " <<
size <<
" is longer than allowed size " << max_allowed_size
667 <<
" - assuming that ROD trailer ("
668 << rob->rod_trailer_size_word()
669 <<
" words) is absent");
671 max_allowed_size =
size;
673 max_allowed_size += rob->rod_trailer_size_word();
676 <<
" ROD " << rob->rod_source_id() << MSG::dec
677 <<
" has unexpected data size: " <<
size
678 <<
" - assuming data size = " << max_allowed_size <<
" words and no ROD trailer at all" );
681 return max_allowed_size;
688template<
typename ELEMENT>
690 typedef typename std::vector<ELEMENT *>::const_iterator ELEMENT_const_iterator;
692 ELEMENT_const_iterator iCh = v.begin();
693 ELEMENT_const_iterator iEnd = v.end();
694 for (; iCh != iEnd; ++iCh)
delete (*iCh);
698template<
typename ELEMENT,
class COLLECTION>
700 typedef typename std::vector<ELEMENT *>::const_iterator ELEMENT_const_iterator;
702 ELEMENT_const_iterator iCh = v.begin();
703 ELEMENT_const_iterator iEnd = v.end();
704 for (; iCh != iEnd; ++iCh) coll.push_back(*iCh);
721 if (pChannel.size() > 0) {
725 v.setLvl1Id(rob->rod_lvl1_id());
726 v.setLvl1Type(rob->rod_lvl1_trigger_type());
727 v.setDetEvType(rob->rod_detev_type());
728 v.setRODBCID(rob->rod_bc_id());
731 for (
size_t j=0; j<digitsMetaData[6].size(); ++j) {
732 status |= digitsMetaData[6][j];
737 v.setFragSize(digitsMetaData[0][0]);
738 v.setFragBCID(digitsMetaData[0][2] | (status<<16));
740 v.setFragExtraWords(digitsMetaData[1]);
742 v.setFragChipHeaderWords(digitsMetaData[2]);
743 v.setFragChipCRCWords(digitsMetaData[3]);
745 if (v.isCalibMode()) {
746 v.setFragChipHeaderWordsHigh(digitsMetaData[4]);
747 v.setFragChipCRCWordsHigh(digitsMetaData[5]);
750 }
else if ( digitsMetaData[0].
size() == 0 ) {
753 v.setFragBCID(0xDEAD | (status<<16));
758 ATH_MSG_DEBUG(
"Status for drawer 0x" << MSG::hex << v.identify() <<
" in Digi frag is 0x" << status << MSG::dec);
773 if (pChannel.size() > 0) {
777 <<
" - setting unit in TileRawChannelContainer " );
778 container->set_unit(rChUnit);
779 container->set_type(rChType);
780 container->set_bsflags(bsflags);
782 ATH_MSG_ERROR(
"Can't set unit=" << rChUnit <<
" in TileRawChannelContainer" );
791 if (pDigits.size() > 0) {
799 ATH_MSG_DEBUG(
"data for drawer 0x" << MSG::hex << v.identify() << MSG::dec <<
" not found in BS" );
810 v.setLvl1Id(rob->rod_lvl1_id());
811 v.setLvl1Type(rob->rod_lvl1_trigger_type());
812 v.setDetEvType(rob->rod_detev_type());
813 v.setRODBCID(rob->rod_bc_id());
816 rawchannelMetaData[0].push_back(0);
817 rawchannelMetaData[0].push_back(0xDEAD);
818 rawchannelMetaData[5].push_back(0xFFFF);
819 rawchannelMetaData[5].push_back(0xFFFF);
822 for (
unsigned int i = 0; i < 6; ++i) {
823 for (
size_t j=rawchannelMetaData[i].
size(); j<2; ++j) {
824 rawchannelMetaData[i].push_back(0);
829 for (
size_t j=0; j<rawchannelMetaData[6].size(); ++j) {
830 status |= rawchannelMetaData[6][j];
833 ATH_MSG_DEBUG(
"Status for drawer 0x" << MSG::hex << v.identify() <<
" is 0x" << status << MSG::dec);
835 v.setFragGlobalCRC(status);
836 v.setFragDSPBCID(rawchannelMetaData[0][1]);
837 v.setFragBCID(rawchannelMetaData[1][0]);
838 v.setFragMemoryPar(rawchannelMetaData[1][1]);
839 v.setFragSstrobe(rawchannelMetaData[2][0]);
840 v.setFragDstrobe(rawchannelMetaData[2][1]);
841 v.setFragHeaderBit(rawchannelMetaData[3][0]);
842 v.setFragHeaderPar(rawchannelMetaData[3][1]);
843 v.setFragSampleBit(rawchannelMetaData[4][0]);
844 v.setFragSamplePar(rawchannelMetaData[4][1]);
845 v.setFragFEChipMask(rawchannelMetaData[5][0]);
847 v.setFragRODChipMask(rawchannelMetaData[5][0]);
849 v.setFragRODChipMask(rawchannelMetaData[5][1]);
872 v.setLvl1Id(rob->rod_lvl1_id());
873 v.setLvl1Type(rob->rod_lvl1_trigger_type());
874 v.setDetEvType(rob->rod_detev_type());
875 v.setRODBCID(rob->rod_bc_id());
906template<
class COLLECTION>
932 uint32_t version = rob->rod_version() & 0xFFFF;
934 bool isBeamROD =
false;
938 const std::vector<uint32_t> & drawer_info = hid2re->getDrawerInfo(frag_id);
939 int bs_frag_id = drawer_info.size()>1 ?
static_cast<int>(drawer_info[1]) : frag_id;
940 int drawer_type = drawer_info.size()>2 ?
static_cast<int>(drawer_info[2]) : -1;
942 uint32_t mask = 0xFFFF;
945 if (frag_id < 0x100) {
952 std::vector<const uint32_t *> pFrag;
962 uint32_t sizeOverhead = 2;
967 bool V3format = (*(p) == 0xff1234ff);
968 V3format |= (*(p) == 0x00123400);
969 if (!V3format && version>0xff) {
972 ATH_MSG_WARNING(
"fillCollection: corrupted frag separator 0x" << MSG::hex << (*p) <<
" instead of 0xff1234ff in ROB 0x" << rob->rod_source_id() << MSG::dec );
991 uint32_t
count = *(p);
993 uint32_t idAndType = *(p + 1);
994 int frag = (idAndType & mask);
995 int type = (idAndType & 0xF00000) >> 16;
999 for (; wc <
size; ++wc, ++cnt, ++p) {
1000 if ((*p) == 0xff1234ff) {
1008 msg(MSG::WARNING) <<
"Frag 0x" << MSG::hex << frag << MSG::dec
1009 <<
" has unexpected size: " <<
count;
1011 msg(MSG::WARNING) <<
" skipping " << cnt <<
" words to the next frag" <<
endmsg;
1013 msg(MSG::WARNING) <<
" ignoring " << cnt <<
" words till the end of ROD frag" <<
endmsg;
1019 if (
type != 0x10 && frag == bs_frag_id) pFrag.push_back(p);
1041 static const bool unpackDigits = std::is_same_v<COLLECTION, TileDigitsCollection>;
1042 static const bool unpackChannels = std::is_same_v<COLLECTION, TileRawChannelCollection>;
1049 std::vector<const uint32_t *>::const_iterator it = pFrag.begin();
1050 std::vector<const uint32_t *>::const_iterator itEnd = pFrag.end();
1052 for (; it != itEnd; ++it) {
1056 unpack_brod(version, sizeOverhead, p, pBeam, frag_id);
1065 pChannel.reserve(48);
1070 for (
unsigned int i = 0; i < 7; ++i) {
1071 digitsMetaData[i].reserve(16);
1072 rawchannelMetaData[i].reserve(2);
1078 std::vector<const uint32_t *>::const_iterator it = pFrag.begin();
1079 std::vector<const uint32_t *>::const_iterator itEnd = pFrag.end();
1081 uint32_t bsflags = 0;
1085 for (; it != itEnd; ++it) {
1091 uint32_t idAndType = *(p + 1);
1092 int type = (idAndType & 0x00FF0000) >> 16;
1094 ATH_MSG_VERBOSE(
"Unpacking frag: 0x" << MSG::hex << (idAndType & 0xFFFF)
1095 <<
" type " <<
type << MSG::dec );
1099 if (unpackDigits &&
m_useFrag0)
unpack_frag0(version, sizeOverhead, digitsMetaData, p, pDigits, frag_id, drawer_type);
1102 if (unpackDigits &&
m_useFrag1)
unpack_frag1(version, sizeOverhead, digitsMetaData, p, pDigits, frag_id, drawer_type);
1105 if (unpackChannels &&
m_useFrag4)
unpack_frag2(version, sizeOverhead, p, pChannel, frag_id, drawer_type);
1108 if (unpackChannels &&
m_useFrag4)
unpack_frag3(version, sizeOverhead, p, pChannel, frag_id, drawer_type);
1112 bsflags = idAndType & 0xFFFF0000;
1113 int unit = (idAndType & 0xC0000000) >> 30;
1115 int DataType = (idAndType & 0x30000000) >> 28;
1133 int AlgoType = (idAndType & 0x7000000) >> 24;
1140 unpack_frag4(version, sizeOverhead,
unit, rawchannelMetaData, p, pChannel, frag_id, drawer_type);
1146 bsflags = idAndType & 0xFFFF0000;
1147 int unit = (idAndType & 0xC0000000) >> 30;
1155 p, pDigits, pChannel, frag_id, drawer_type);
1163 if (unpackChannels)
unpack_fragA(version, rawchannelMetaData, p, pChannel, frag_id, drawer_type);
1167 int frag = idAndType & 0xFFFF;
1174 make_copy(bsflags, rChType, rChUnit, digitsMetaData, rawchannelMetaData,
1175 rob, pDigits, pChannel, v, container);
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
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
size_t size() const
Number of registered mappings.
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
const std::vector< int > & getDemoChannelMapEB()
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
const std::vector< int > & getDemoChannelMapLB()
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
int run(int argc, char *argv[])