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;
158 inline bool check_valid (
const T* frag, MsgStream& log)
const;
169 std::unique_ptr<LArRodBlockStructure>
171 unsigned int rodMinorVersion)
const;
174 LArCell* element,
int energy,
int time,
221 catch (eformat::Issue& ex) {
222 msg(MSG::WARNING) <<
"Exception while checking eformat fragment validity: " << ex.what() <<
endmsg;
234 const uint32_t* p, uint32_t n,
242 ATH_MSG_VERBOSE(
"Prepare LArRodBlockStructure. Got a fragment of size " << n);
244 const uint32_t blocksize=p[0];
246 msg(MSG::ERROR) <<
"Got truncated ROD Fragment!" <<
endmsg;
253 eformat::helper::Version ver(robFrag.rod_version());
254 const uint16_t rMV_present=ver.minor_version();
255 const uint32_t rBT_present=robFrag.rod_detev_type()&0xff;
258 if ( !providedRodBlockStructure || (rodMinorVersion!=rMV_present) || (robBlockType!=rBT_present) ){
265 providedRodBlockStructure = BlStruct;
266 rodMinorVersion = rMV_present;
267 robBlockType = rBT_present;
268 }
else BlStruct = providedRodBlockStructure;
272 (*ii)->setEnergyFast(0.0);
282 if(!BlStruct->
setGain(calogain)){
292 ATH_MSG_DEBUG(
"Bad FebID=0x"<< std::hex << BlStruct->
getFEBID() << std::dec <<
" found for this FEB, skipping it!");
303 msg(MSG::WARNING) <<
"Checksum error:" <<
endmsg;
304 msg(MSG::WARNING) <<
" online checksum = 0x" << MSG::hex << onsum <<
endmsg;
305 msg(MSG::WARNING) <<
" offline checksum = 0x" << MSG::hex << offsum << MSG::dec <<
endmsg;
316 int NthisFebChannel=128 ;
318 uint16_t iprovenance;
319 while (BlStruct->
getNextEnergy(fcNb,energy,time,quality,gain)) {
320 if (fcNb>=NthisFebChannel)
continue;
321 collElem = coll[fcNb+nfeb];
324 if ( quality>=0 ) { iprovenance|= 0x2000; iquality=(quality& 0xffff);}
335 unsigned int collection_size = coll.
size();
336 if ( feb_number== 0 && collection_size>0 )
error |= 0x20;
337 if ( feb_number== 1 && collection_size !=128 )
error |= 0x20;
338 if ( feb_number== 2 && collection_size !=256 )
error |= 0x20;
343 LArCell* element,
int energy,
int time,
347 element->
set((
float)energy, (
float)time, (
double)quality, gain);
#define ATH_MSG_DEBUG(x,...)
#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 LArCell in a ROB used by EF.
void addfebenergy(LArFebEnergy &larfebenergy)
set the feb energy
Data object for LAr calorimeter readout cell.
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