36 const std::string& name,
const IInterface* parent)
42 declareInterface<TileRawChannelContByteStreamTool>(
this);
52 ATH_MSG_INFO (
"Initializing TileRawChannelContByteStreamTool");
56 ToolHandle<TileROD_Decoder> dec(
"TileROD_Decoder");
69 return StatusCode::SUCCESS;
73 ATH_MSG_INFO (
"Finalizing TileRawChannelContByteStreamTool successfuly");
74 return StatusCode::SUCCESS;
79 bool isTMDB =
evtStore()->proxy(rawChannelContainer)->name() ==
"MuRcvRawChCnt";
90 ATH_MSG_DEBUG(
" Number of raw channel collections... " << rawChannelContainer->size() <<
" " <<
evtStore()->proxy(rawChannelContainer)->name());
92 std::map<uint32_t, TileROD_Encoder> mapEncoder;
93 std::vector<TileFastRawChannel> channels;
94 channels.reserve (
m_tileHWID->channel_hash_max());
102 if (isTMDB) reid = hid2re->getRodTileMuRcvID(frag_id);
103 else reid = hid2re->getRodID(frag_id);
124 float amplitude = rawChannel->amplitude();
125 float time = rawChannel->time();
126 float quality = rawChannel->quality();
128 channels.emplace_back (frag_id, channel, adc, amplitude, 0., 0.);
131 if (quality > 15.0) quality = 15.0;
132 if (
m_tileBadChanTool->getAdcStatus(drawerIdx, channel, adc).isBad()) quality += 16.;
135 channels.emplace_back (frag_id, channel, adc, amplitude, time, quality);
139 encoder.
add(&channels.back());
144 <<
" ROD " <<
"0x" << reid
145 <<
" number of channels " << MSG::dec << nChannels );
151 for (std::pair<const uint32_t, TileROD_Encoder>& reidAndEncoder: mapEncoder) {
153 theROD = fea->
getRodData(reidAndEncoder.first);
156 if ((reidAndEncoder.first & 0xf00)) {
162 ATH_MSG_DEBUG(
" Number of TileRawChannel words in ROD " << MSG::hex <<
" 0x" << reidAndEncoder.first << MSG::dec <<
" : " << theROD->size() );
165 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
Template class for assembling a full atlas raw event from subfragments.
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
RODDATA * getRodData(uint32_t id)
get a block of ROD data
static const TileCablingService * getInstance()
get pointer to service instance
int getMaxChannels(void) const
Static class providing several utility functions and constants.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Provides conversion from TileRawChannel, TileL2 and TMDB (digits,MF raw channel,decision) to ROD form...
void setMaxChannels(int maxChannels)
set maximum number of channels in a drawer
void fillROD5(std::vector< uint32_t > &v)
void setTypeAndUnit(TileFragHash::TYPE type, TileRawChannelUnit::UNIT unit)
set OF algorigtm type and amplitude units for a drawer
void fillRODTileMuRcvRawChannel(std::vector< uint32_t > &v)
void setTileHWID(const TileHWID *tileHWID, bool verbose, unsigned int type=4)
set all necessary parameters for the encoder
void fillROD4(std::vector< uint32_t > &v)
void add(const TileFastRawChannel *rc)
add TileRawChannels to the current list