67 return StatusCode::SUCCESS;
79 decoder->fillCollection(rob, digitsCollection);
88 decoder->fillCollection(rob, rawChannelCollection,
container);
107 decoder->fillCollection_TileMuRcv_RawChannel(rob, rawChannelCollection);
130 return StatusCode::SUCCESS;
134template <
class GetRobOperation,
class FillCollOperation>
137 GetRobOperation getRobFromFragID, FillCollOperation fillCollection,
138 unsigned int offsetID)
const {
140 uint32_t newrob = 0x0;
141 std::vector<uint32_t> robid{0};
142 std::vector<const ROBDataProviderSvc::ROBF*> robf;
147 for (
IdentifierHash hash : digitsContainer->GetAllCurrentHashes()) {
152 newrob = getRobFromFragID(hid2re, collID + offsetID);
153 if (newrob != robid[0]) {
156 m_robSvc->getROBData(ctx, robid, robf);
159 if (robf.size() > 0 ) {
160 fillCollection(&*
m_decoder, robf[0], *digitsCollection);
163 digitsCollection->
setFragBCID(0xDEAD | (status << 16));
164 ATH_MSG_DEBUG(
"Status [" << digitsKey.key() <<
"] for " <<
"drawer 0x" << MSG::hex
165 << collID <<
" in Digi frag is 0x" << status << MSG::dec);
169 ATH_MSG_DEBUG(
"Creating digits container: " << digitsKey.key() );
174 return StatusCode::SUCCESS;
177template <
class GetRobOperation,
class FillCollOperation>
180 GetRobOperation getRobFromFragID, FillCollOperation fillCollection,
184 uint32_t newrob = 0x0;
185 std::vector<uint32_t> robid{0};
186 std::vector<const ROBDataProviderSvc::ROBF*> robf;
187 std::unordered_map<uint32_t, int> bsflags;
190 auto rawChannelContainer = std::make_unique<TileMutableRawChannelContainer>(
true,
type);
191 ATH_CHECK( rawChannelContainer->status() );
194 for (
IdentifierHash hash : rawChannelContainer->GetAllCurrentHashes()) {
199 newrob = getRobFromFragID(hid2re, collID);
200 if (newrob != robid[0]) {
203 m_robSvc->getROBData(ctx, robid, robf);
207 if (robf.size() > 0 ) {
208 fillCollection(&*
m_decoder, robf[0], *rawChannelCollection, &*rawChannelContainer);
210 flags = rawChannelContainer->get_bsflags();
211 auto result = bsflags.insert(std::pair<uint32_t, int>(flags, 1));
212 if (
result.second ==
false) {
216 ATH_MSG_DEBUG(
"ROB [" << rawChannelsKey.
key() <<
"] for " <<
"drawer 0x" << MSG::hex << collID << MSG::dec <<
" not found in BS" );
219 ATH_MSG_DEBUG(
"Status [" << rawChannelsKey.
key() <<
"] for " <<
"drawer 0x" << MSG::hex << collID <<
" is 0x" << status << MSG::dec);
223 if (bsflags.size() > 1) {
225 for (
const auto & elem : bsflags) {
226 if (elem.second > n) {
232 if (flags != rawChannelContainer->get_bsflags()) {
234 uint32_t
unit = ((flags & 0xC0000000) >> 30);
235 if ((flags & 0x30000000) < 0x30000000) {
239 ATH_MSG_DEBUG(
"Changing units [" << rawChannelsKey.
key() <<
"] for " <<
"RawChannelContainer from "
240 << rawChannelContainer->get_unit() <<
" to " <<
unit << MSG::hex
241 <<
" and BS flags from 0x" << rawChannelContainer->get_bsflags() <<
" to 0x" << flags << MSG::dec);
244 rawChannelContainer->set_bsflags(flags);
248 ATH_MSG_DEBUG(
"Creating raw channel container: " << rawChannelsKey );
253 return StatusCode::SUCCESS;
260 std::vector<uint32_t> robid{0};
261 std::vector<const ROBDataProviderSvc::ROBF*> robf;
263 auto beamElementsContainer = std::make_unique<TileMutableBeamElemContainer>(
true);
264 ATH_CHECK( beamElementsContainer->status() );
267 for (
IdentifierHash hash : beamElementsContainer->GetAllCurrentHashes()) {
273 if (newrob != robid[0]) {
276 m_robSvc->getROBData(ctx, robid, robf);
280 if (robf.size() > 0 ) {
281 m_decoder->fillCollection(robf[0], *beamElementsCollection);
285 ATH_MSG_DEBUG(
"Creating beam elements container: " << beamElementsKey );
290 return StatusCode::SUCCESS;
297 std::vector<uint32_t> robid{0};
298 std::vector<const ROBDataProviderSvc::ROBF*> robf;
300 auto laserObject = std::make_unique<TileLaserObject>() ;
301 m_decoder->setLaserVersion(*laserObject);
304 m_robSvc->getROBData(ctx, robid, robf);
306 if (robf.size() > 0 ) {
307 m_decoder->fillTileLaserObj(robf[0], *laserObject);
309 ATH_MSG_DEBUG(
" No LASTROD fragment in BS, TileLaserObject will be empty." );
312 ATH_MSG_DEBUG(
"Creating laser object: " << laserObjectKey );
317 return StatusCode::SUCCESS;
322 const EventContext& ctx)
const {
326 ATH_MSG_ERROR(
"Could not get raw event from ByteStreamInputSvc" );
327 return StatusCode::FAILURE;
330 auto muonReceiverContainer = std::make_unique<TileMuonReceiverContainer>();
332 if (!
m_decoder->convertTMDBDecision(
re, muonReceiverContainer.get()).isSuccess()) {
333 ATH_MSG_WARNING(
"Conversion tool returned an error. TileMuonReceiverContainer might be empty." );
339 return StatusCode::SUCCESS;
344 const EventContext& ctx)
const {
348 ATH_MSG_ERROR(
"Could not get raw event from ByteStreamInputSvc" );
349 return StatusCode::FAILURE;
352 auto l2Container = std::make_unique<TileL2Container>();
353 l2Container->reserve(256);
354 for(
int i = 0; i < 256; ++i) {
355 int collId =
m_decoder->hashFunc()->identifier(i);
356 l2Container->push_back (std::make_unique<TileL2>(collId));
359 if (!
m_decoder->convert(
re, l2Container.get()).isSuccess()) {
360 ATH_MSG_WARNING(
"Conversion tool returned an error. TileL2Container might be empty." );
366 return StatusCode::SUCCESS;
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_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Handle class for recording to StoreGate.
Helper for holding non-const raw data prior to recording in SG.
Helper for holding non-const raw data prior to recording in SG.
Helper for holding non-const raw data prior to recording in SG.
This is a "hash" representation of an Identifier.
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
ROB Fragment class.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Property holding a SG store/key/clid from which a WriteHandle is made.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
static const unsigned int FELIX_FRAGID_OFFSET
Offset for frag ID used for FELIX in frag ID to ROB ID map.
void setFragBCID(uint32_t bcid)
Set BCID.
This class provides conversion between fragment ID and RESrcID.
uint32_t getRobFromFragID(int frag_id) const
make a ROB SrcID for a fragment ID
uint32_t getRobFromTileMuRcvFragID(int frag_id) const
Decodes the different TileCal ROD subfragment types in bytestream data and fills TileDigitsContainer,...
void fillCollection_TileMuRcv_Digi(const ROBData *rob, TileDigitsCollection &v) const
void fillCollection_FELIX_Digi(const ROBData *rob, TileDigitsCollection &v) const
void setFragGlobalCRC(uint32_t globalcrc)
Various set methods.
StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
SG::WriteHandleKey< TileLaserObject > m_laserObjectKey
SG::ReadCondHandleKey< TileHid2RESrcID > m_hid2RESrcIDKey
bool m_doMuRcvRawChannels
StatusCode readL2(const SG::WriteHandleKey< TileL2Container > &l2Key, const EventContext &ctx) const
SG::WriteHandleKey< TileL2Container > m_l2ContainerKey
SG::WriteHandleKey< TileDigitsContainer > m_muRcvDigitsContainerKey
StatusCode initialize() override
SG::WriteHandleKey< TileDigitsContainer > m_digitsContainerKey
StatusCode readMuonReceiver(const SG::WriteHandleKey< TileMuonReceiverContainer > &muRcvKey, const EventContext &ctx) const
StatusCode readRawChannels(const SG::WriteHandleKey< TileRawChannelContainer > &rawChannelsKey, const EventContext &ctx, const TileHid2RESrcID *hid2re, GetRobOperation getRobFromFragID, FillCollOperation fillCollection, TileFragHash::TYPE type=TileFragHash::OptFilterDsp) const
ToolHandle< TileROD_Decoder > m_decoder
StatusCode readBeamElements(const SG::WriteHandleKey< TileBeamElemContainer > &beamElementsKey, const EventContext &ctx, const TileHid2RESrcID *hid2re) const
StatusCode readLaserObject(const SG::WriteHandleKey< TileLaserObject > &laserObjectKey, const EventContext &ctx, const TileHid2RESrcID *hid2re) const
SG::WriteHandleKey< TileRawChannelContainer > m_muRcvRawChannelContainerKey
SG::WriteHandleKey< TileMuonReceiverContainer > m_muonReceiverContainerKey
SG::WriteHandleKey< TileDigitsContainer > m_flxDigitsContainerKey
ServiceHandle< TileCablingSvc > m_cablingSvc
SG::WriteHandleKey< TileBeamElemContainer > m_beamElemContainerKey
ServiceHandle< IROBDataProviderSvc > m_robSvc
Name of ROB data provider service.
StatusCode readDigits(const SG::WriteHandleKey< TileDigitsContainer > &digitsKey, const EventContext &ctx, const TileHid2RESrcID *hid2re, GetRobOperation getRobFromFragID, FillCollOperation fillCollection, unsigned int offsetID=0) const