|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "eformat/Version.h"
12 #include "eformat/index.h"
40 return StatusCode::SUCCESS;
50 ATH_CHECK(rawChannelsHdl.
record(std::make_unique<LArRawChannelContainer>()));
51 rawChannels=rawChannelsHdl.
ptr();
52 rawChannels->reserve(182468);
58 digits=digitsHdl.
ptr();
64 ATH_CHECK(febHeadersHdl.
record(std::make_unique<LArFebHeaderContainer>()));
65 febHeaders=febHeadersHdl.
ptr();
71 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > rawEventTOC;
72 eformat::helper::build_toc(*fullEvent, rawEventTOC);
74 if (larRobs==rawEventTOC.end()) {
75 ATH_MSG_DEBUG(
"No LAr data found in this event. Recording empty LArRawChannelContainer");
76 return StatusCode::SUCCESS;
80 std::unique_ptr<LArRodBlockStructure> rodBlock;
85 for (
const uint32_t* robPtr : larRobs->second) {
87 ATH_MSG_VERBOSE(
"Decoding ROB fragment 0x" << std::hex << rob.rob_source_id () <<
" with " << std::dec << rob.rod_fragment_size_word() <<
" ROB words");
89 if (rob.rod_fragment_size_word() <3) {
91 ATH_MSG_ERROR(
"Encountered corrupt ROD fragment, less than 3 words!");
92 return StatusCode::FAILURE;
96 }
else if(rob.rob_source_id()& 0x1000 ){
100 }
else if(!(rob.rod_source_id()>>12& 0x0F)
101 && !((rob.rod_source_id()>>20) == 4) ){
103 ATH_MSG_WARNING(
"Found not LAr fragment " <<
" event: "<<ctx.eventID().event_number());
105 ATH_MSG_WARNING(
"Rob source id.: 0x"<< std::hex << rob.rob_source_id () <<std::dec <<
" ROD Source id: 0x"<<std::hex<<rob.rod_source_id()<<std::dec<<
" Lvl1ID: "<<eventInfo->
extendedLevel1ID());
110 eformat::helper::Version
ver(rob.rod_version());
112 if (rodBlock==
nullptr || rodMinorVersion !=
ver.minor_version() || rodBlockType!=(rob.rod_detev_type()&0xff)) {
113 rodMinorVersion=
ver.minor_version();
114 rodBlockType=rob.rod_detev_type()&0xff;
115 ATH_MSG_VERBOSE(
"Found version " << rodMinorVersion <<
" of Rod Block Type " << rodBlockType);
116 if (rodBlockType==4) {
117 switch(rodMinorVersion) {
127 ATH_MSG_ERROR(
"Found unsupported ROD Block version " << rodMinorVersion
128 <<
" of ROD block type " << rodBlockType <<
". ROD Source id: 0x" <<std::hex<<rob.rod_source_id());
129 return StatusCode::FAILURE;
132 ATH_MSG_WARNING(
"Found unsupported ROD Block version " << rodMinorVersion
133 <<
" of ROD block type " << rodBlockType <<
". ROD Source id: 0x" <<std::hex<<rob.rod_source_id());
138 else if (rodBlockType==2) {
139 switch(rodMinorVersion) {
147 ATH_MSG_WARNING(
"Found unsupported ROD Block version " << rodMinorVersion
148 <<
" of ROD block type " << rodBlockType);
154 const uint32_t* pData=rob.rod_data();
155 const uint32_t nData=rob.rod_ndata();
158 ATH_MSG_ERROR(
"ROD 0x"<<std::hex<<rob.rod_source_id() << std::dec <<
" reports data block size 0");
159 return StatusCode::FAILURE;
162 ATH_MSG_WARNING(
"ROD 0x"<<std::hex<<rob.rod_source_id() << std::dec <<
" reports data block size 0");
169 ATH_MSG_ERROR(
"Failed to assign fragment pointer to LArRodBlockStructure");
170 return StatusCode::FAILURE;
173 ATH_MSG_WARNING(
"Failed to assign fragment pointer to LArRodBlockStructure");
185 ATH_MSG_ERROR(
"offline checksum = 0x" << MSG::hex << offsum << MSG::dec);
186 return StatusCode::FAILURE;
199 return StatusCode::FAILURE;
215 if (fcNb>=NthisFebChannel)
223 iquality = (quality & 0xFFFF);
233 std::vector<short> samples;
235 if (fcNb>=NthisFebChannel)
237 if (samples.size()==0)
continue;
246 std::unique_ptr<LArFebHeader> larFebHeader(
new LArFebHeader(fId));
248 febHeaders->
push_back(std::move(larFebHeader));
253 return StatusCode::SUCCESS;
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
def retrieve(aClass, aKey=None)
value_type emplace_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandleKey< LArRawChannelContainer > m_rawChannelKey
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
virtual int getNextEnergy(int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)
value_type get_compact() const
Get the compact id.
SG::WriteHandleKey< LArFebHeaderContainer > m_febHeaderKey
SG::WriteHandleKey< LArDigitContainer > m_digitKey
virtual uint32_t offlineCheckSum() const
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
An algorithm that can be simultaneously executed in multiple threads.
BooleanProperty m_verifyChecksum
Liquid Argon digit base class.
int channelInSlotMax(const HWIdentifier Id) const
Return the Maximum channel number of a given feb slot.
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
LArRawDataReadingAlg(const std::string &name, ISvcLocator *pSvcLocator)
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
uint32_t extendedLevel1ID() const
The extended Level-1 identifier.
uint32_t getFEBID() const
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
bool isValidId(const HWIdentifier id) const
Returns false if the identifier is not a LAr-online id or any of the sub-fields is out of range.
This class provides decoding/encoding from/to ROD format.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
def time(flags, cells_name, *args, **kw)
#define ATH_MSG_WARNING(x)
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
const LArOnlineID * m_onlineId
bool setFragment(const uint32_t *p, uint32_t n)
StatusCode initialize() override
Container class for LArDigit.
virtual uint32_t onlineCheckSum() const
BooleanProperty m_failOnCorruption
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
Container for LArRawChannel (IDC using LArRawChannelCollection)