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"
135 const IInterface* parent ) ;
151 uint16_t& rodMinorVersion, uint32_t& robBlockType)
const;
187 inline bool check_valid (
const T* frag, MsgStream& log)
const;
198 std::unique_ptr<LArRodBlockStructure>
200 unsigned int rodMinorVersion)
const;
203 LArCell* element,
int energy,
int time,
250 catch (eformat::Issue& ex) {
251 msg(MSG::WARNING) <<
"Exception while checking eformat fragment validity: " << ex.what() <<
endmsg;
263 const uint32_t* p, uint32_t n,
271 ATH_MSG_VERBOSE(
"Prepare LArRodBlockStructure. Got a fragment of size " << n);
273 const uint32_t blocksize=p[0];
275 msg(MSG::ERROR) <<
"Got truncated ROD Fragment!" <<
endmsg;
282 eformat::helper::Version ver(robFrag.rod_version());
283 const uint16_t rMV_present=ver.minor_version();
284 const uint32_t rBT_present=robFrag.rod_detev_type()&0xff;
287 if ( !providedRodBlockStructure || (rodMinorVersion!=rMV_present) || (robBlockType!=rBT_present) ){
294 providedRodBlockStructure = BlStruct;
295 rodMinorVersion = rMV_present;
296 robBlockType = rBT_present;
297 }
else BlStruct = providedRodBlockStructure;
301 (*ii)->setEnergyFast(0.0);
311 if(!BlStruct->
setGain(calogain)){
321 ATH_MSG_DEBUG(
"Bad FebID=0x"<< std::hex << BlStruct->
getFEBID() << std::dec <<
" found for this FEB, skipping it!");
332 msg(MSG::WARNING) <<
"Checksum error:" <<
endmsg;
333 msg(MSG::WARNING) <<
" online checksum = 0x" << MSG::hex << onsum <<
endmsg;
334 msg(MSG::WARNING) <<
" offline checksum = 0x" << MSG::hex << offsum << MSG::dec <<
endmsg;
345 int NthisFebChannel=128 ;
347 uint16_t iprovenance;
348 while (BlStruct->
getNextEnergy(fcNb,energy,time,quality,gain)) {
349 if (fcNb>=NthisFebChannel)
continue;
350 collElem = coll[fcNb+nfeb];
353 if ( quality>=0 ) { iprovenance|= 0x2000; iquality=(quality& 0xffff);}
364 unsigned int collection_size = coll.
size();
365 if ( feb_number== 0 && collection_size>0 )
error |= 0x20;
366 if ( feb_number== 1 && collection_size !=128 )
error |= 0x20;
367 if ( feb_number== 2 && collection_size !=256 )
error |= 0x20;
372 LArCell* element,
int energy,
int time,
376 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