8#ifndef LARBYTESTREAM_LARRODDECODER_H
9#define LARBYTESTREAM_LARRODDECODER_H
17#include "GaudiKernel/ToolHandle.h"
43#include "eformat/Version.h"
44#include "eformat/Issue.h"
138 const IInterface* parent ) ;
154 uint16_t& rodMinorVersion, uint32_t& robBlockType)
const;
195 inline bool check_valid (
const T* frag, MsgStream& log)
const;
206 std::unique_ptr<LArRodBlockStructure>
208 unsigned int rodMinorVersion)
const;
211 LArCell* element,
int energy,
int time,
272 catch (eformat::Issue& ex) {
273 msg(MSG::WARNING) <<
"Exception while checking eformat fragment validity: " << ex.what() <<
endmsg;
288static uint16_t rMV=99;
289static uint32_t rBT=99;
291 const uint32_t* p, uint32_t n,
293 LArRodBlockStructure*& providedRodBlockStructure, uint16_t& rodMinorVersion = rMV , uint32_t& robBlockType = rBT )
const
299 ATH_MSG_VERBOSE(
"Prepare LArRodBlockStructure. Got a fragment of size " << n);
306 const uint32_t blocksize=p[0];
308 msg(MSG::ERROR) <<
"Got truncated ROD Fragment!" <<
endmsg;
315 eformat::helper::Version ver(robFrag.rod_version());
316 const uint16_t rMV_present=ver.minor_version();
317 const uint32_t rBT_present=robFrag.rod_detev_type()&0xff;
320 if ( !providedRodBlockStructure || (rodMinorVersion!=rMV_present) || (robBlockType!=rBT_present) ){
327 providedRodBlockStructure = BlStruct;
328 rodMinorVersion = rMV_present;
329 robBlockType = rBT_present;
330 }
else BlStruct = providedRodBlockStructure;
334 (*ii)->setEnergyFast(0.0);
344 if(!BlStruct->
setGain(calogain)){
354 ATH_MSG_DEBUG(
"Bad FebID=0x"<< std::hex << BlStruct->
getFEBID() << std::dec <<
" found for this FEB, skipping it!");
365 msg(MSG::WARNING) <<
"Checksum error:" <<
endmsg;
366 msg(MSG::WARNING) <<
" online checksum = 0x" << MSG::hex << onsum <<
endmsg;
367 msg(MSG::WARNING) <<
" offline checksum = 0x" << MSG::hex << offsum << MSG::dec <<
endmsg;
378 int NthisFebChannel=128 ;
380 uint16_t iprovenance;
381 while (BlStruct->
getNextEnergy(fcNb,energy,time,quality,gain)) {
382 if (fcNb>=NthisFebChannel)
continue;
383 collElem = coll[fcNb+nfeb];
386 if ( quality>=0 ) { iprovenance|= 0x2000; iquality=(quality& 0xffff);}
398 unsigned int collection_size = coll.
size();
399 if ( feb_number== 0 && collection_size>0 )
error |= 0x20;
400 if ( feb_number== 1 && collection_size !=128 )
error |= 0x20;
401 if ( feb_number== 2 && collection_size !=256 )
error |= 0x20;
406 LArCell* element,
int energy,
int time,
410 element->
set((
float)energy, (
float)time, (
double)quality, gain);
#define ATH_MSG_VERBOSE(x)
Maintain a set of objects, one per slot.
Property holding a SG store/key/clid from which a ReadHandle is made.
Define macros for attributes used to control the static checker.
void set(const CaloDetDescrElement *caloDDE, const Identifier &ID)
Fast method to change the identity of a cell.
DataModel_detail::iterator< DataVector > iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Container class for LArAccumulatedCalibDigit.
Container class for LArAccumulatedDigit.
Container class for LArCalibDigit.
Container Class for LArCell in a ROB used by EF.
void addfebenergy(LArFebEnergy &larfebenergy)
set the feb energy
Data object for LAr calorimeter readout cell.
Container class for LArDigit.
Holds partial energy sums Ex,Ey,Ez for each Feb.
Container for LArRawChannel (IDC using LArRawChannelCollection)
bool setFragment(const uint32_t *p, uint32_t n)
virtual uint32_t hasPhysicsBlock() const
virtual int getNextEnergy(int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)
bool report_error(void) const
uint32_t getFEBID() const
virtual int setGain(const int GainValue)
virtual uint32_t offlineCheckSum() const
virtual uint32_t onlineCheckSum() const
std::vector< unsigned int > m_vFinalPreselection
virtual ~LArRodDecoder()
Destructor.
std::vector< std::string > m_LArCellCorrNames
LArRodBlockStructure * prepareBlockStructure1(const uint16_t rodMinorVersion, const uint32_t robBlockType) const
SG::SlotSpecificObj< std::vector< std::unique_ptr< LArRodBlockStructure > > > m_blstructs ATLAS_THREAD_SAFE
std::vector< int > m_vFTPreselection
const LArOnlineID * m_onlineHelper
std::vector< unsigned int > m_IgnoreCheckFEBs
std::unique_ptr< LArRodBlockStructure > makeBlockStructure(unsigned int rodBlockType, unsigned int rodMinorVersion) const
SG::ReadHandleKey< xAOD::EventInfo > m_evt
static const InterfaceID & interfaceID()
float m_LArCellEthreshold
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
void setCellEnergy(LArCell *element, int energy, int time, int quality, CaloGain::CaloGain gain) const
std::vector< const CaloCellCorrection * > m_LArCellCorrTools
unsigned short m_requiredPhysicsNSamples
std::vector< int > m_vBEPreselection
void fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, const uint32_t *p, uint32_t n, LArRawChannelContainer &coll, const CaloGain::CaloGain gain) const
LArRodBlockStructure * prepareBlockStructure(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, const uint32_t *p, uint32_t n, const CaloGain::CaloGain RequestedGain) const
void setsecfeb(HWIdentifier feb)
uint32_t fillCollectionHLT(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, const uint32_t *p, uint32_t n, LArCellCollection &coll, LArRodBlockStructure *&providedRodBlockStructure, uint16_t &rodMinorVersion, uint32_t &robBlockType) const
std::vector< int > m_vPosNegPreselection
LArRodDecoder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor Standard AlgTool constructor.
void writeFebInfo(LArCellCollection &m_coll, LArFebEnergy &febene) const
bool check_valid(const T *frag, MsgStream &log) const
Property holding a SG store/key/clid from which a ReadHandle is made.
Maintain a set of objects, one per slot.
eformat::ROBFragment< PointerType > ROBFragment