|
ATLAS Offline Software
|
This class is the ByteStreamInputSvc for reading events written by EventStorage.
More...
#include <ByteStreamEventStorageInputSvc.h>
This class is the ByteStreamInputSvc for reading events written by EventStorage.
Definition at line 35 of file ByteStreamEventStorageInputSvc.h.
◆ Advance
◆ ByteStreamEventStorageInputSvc()
ByteStreamEventStorageInputSvc::ByteStreamEventStorageInputSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructors:
Definition at line 38 of file ByteStreamEventStorageInputSvc.cxx.
40 : base_class(
name, pSvcLocator)
52 ,
m_dump (
this,
"DumpFlag",
false,
"Dump fragments")
53 ,
m_wait (
this,
"WaitSecs", 0.,
"Seconds to wait if input is in wait state")
54 ,
m_valEvent (
this,
"ValidateEvent",
true,
"switch on check_tree when reading events")
55 ,
m_eventInfoKey (
this,
"EventInfoKey",
"EventInfo",
"Key of EventInfo in metadata store")
57 assert(pSvcLocator !=
nullptr);
◆ ~ByteStreamEventStorageInputSvc()
ByteStreamEventStorageInputSvc::~ByteStreamEventStorageInputSvc |
( |
| ) |
|
|
virtual |
◆ buildFragment()
void ByteStreamEventStorageInputSvc::buildFragment |
( |
EventCache * |
cache, |
|
|
uint32_t |
eventSize, |
|
|
bool |
validate |
|
) |
| const |
|
private |
Definition at line 321 of file ByteStreamEventStorageInputSvc.cxx.
329 const DataType headWord = fragment[0];
330 ATH_MSG_DEBUG(
"First word of the fragment " << MSG::hex << headWord << MSG::dec);
332 const DataType formatVersion = eformat::helper::Version(fragment[3]).major_version();
333 ATH_MSG_DEBUG(
"Format version" << MSG::hex << formatVersion << MSG::dec);
335 if((formatVersion != eformat::MAJOR_DEFAULT_VERSION) &&
336 (formatVersion != eformat::MAJOR_V24_VERSION) &&
337 (formatVersion != eformat::MAJOR_V30_VERSION) &&
338 (formatVersion != eformat::MAJOR_V40_VERSION) &&
339 (formatVersion != eformat::MAJOR_V31_VERSION) ) {
341 << MSG::hex << formatVersion << MSG::dec);
344 if(eformat::FULL_EVENT == headWord || 0xcc1234cc == headWord) {
347 if(formatVersion != eformat::MAJOR_DEFAULT_VERSION) {
349 const uint32_t newEventSize = eventSize + 1000;
354 delete [] fragment; fragment =
nullptr;
357 fragment = newFragment;
358 cache->data =
reinterpret_cast< char*
>(fragment);
368 ATH_MSG_FATAL(
"Unknown Header work in input fragment " << MSG::hex << headWord);
375 cache->eventStatus = 0;
376 if(fragment[5] > 0) {
383 cache->rawEvent = std::make_unique<RawEvent>(fragment);
384 ATH_MSG_DEBUG(
"Made an FullEventFragment from ES " << fragment);
◆ closeBlockIterator()
void ByteStreamEventStorageInputSvc::closeBlockIterator |
( |
bool |
clearMetadata = true | ) |
|
|
overridevirtual |
◆ currentEvent()
const RawEvent * ByteStreamEventStorageInputSvc::currentEvent |
( |
| ) |
const |
|
overridevirtual |
◆ currentEventStatus()
unsigned int ByteStreamEventStorageInputSvc::currentEventStatus |
( |
| ) |
const |
|
overridevirtual |
◆ deleteEntry()
template<typename T >
StatusCode ByteStreamEventStorageInputSvc::deleteEntry |
( |
const std::string & |
key | ) |
|
|
inlineprivate |
◆ finalize()
StatusCode ByteStreamEventStorageInputSvc::finalize |
( |
| ) |
|
|
overridevirtual |
◆ generateDataHeader()
StatusCode ByteStreamEventStorageInputSvc::generateDataHeader |
( |
| ) |
|
|
overridevirtual |
Definition at line 390 of file ByteStreamEventStorageInputSvc.cxx.
404 std::string
key =
"ByteStreamDataHeader";
410 std::unique_ptr<DataHeader> dataHeader = std::make_unique<DataHeader>();
414 dataHeader->
insert(*std::move(dataHeaderElement));
422 std::unique_ptr<IOpaqueAddress> iopx = std::make_unique<ByteStreamAddress>(
427 if (ptmpx !=
nullptr) {
429 dataHeader->
insert(element);
436 std::unique_ptr<IOpaqueAddress> iopaux = std::make_unique<ByteStreamAddress>(
443 dataHeader->
insert(element);
449 "ByteStreamDataHeader",
true,
false,
true));
451 return StatusCode::SUCCESS;
◆ getBlockIterator()
std::pair< long, std::string > ByteStreamEventStorageInputSvc::getBlockIterator |
( |
const std::string & |
fileName | ) |
|
|
overridevirtual |
Definition at line 520 of file ByteStreamEventStorageInputSvc.cxx.
525 m_reader = std::unique_ptr<EventStorage::DataReader>(pickDataReader(
fileName));
530 return std::make_pair(-1,
"END");
540 ATH_MSG_DEBUG(
"Recorded ByteStreamMetadata in InputMetaDataStore");
542 ATH_MSG_ERROR(
"Unable to record ByteStreamMetadata in InputMetaDataStore");
543 return std::make_pair(-1,
"FAIL");
551 if (!
test)
return std::make_pair(-1,
"SEQ");
◆ getEvent()
◆ initialize()
StatusCode ByteStreamEventStorageInputSvc::initialize |
( |
| ) |
|
|
overridevirtual |
◆ loadMetadata()
StatusCode ByteStreamEventStorageInputSvc::loadMetadata |
( |
| ) |
|
|
private |
◆ makeBSProvenance()
std::unique_ptr< DataHeaderElement > ByteStreamEventStorageInputSvc::makeBSProvenance |
( |
| ) |
const |
|
private |
◆ nextEvent()
++, new
Definition at line 196 of file ByteStreamEventStorageInputSvc.cxx.
199 const EventContext& context{ Gaudi::Hive::currentContext() };
203 cache->releaseEvent();
206 unsigned int eventSize;
216 ecode =
m_reader->getData(eventSize, &(cache->data));
224 if (DRWAIT == ecode &&
m_wait > 0) {
233 }
while(
m_reader->getData(eventSize, &(cache->data)) == DRWAIT);
234 }
else if (DROK != ecode) {
241 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
254 if (cache->rawEvent ==
nullptr) {
270 return(cache->rawEvent.get());
◆ positionInBlock()
long ByteStreamEventStorageInputSvc::positionInBlock |
( |
| ) |
|
|
overridevirtual |
◆ previousEvent()
const RawEvent * ByteStreamEventStorageInputSvc::previousEvent |
( |
| ) |
|
|
overridevirtual |
–, old
Definition at line 129 of file ByteStreamEventStorageInputSvc.cxx.
132 const EventContext& context{Gaudi::Hive::currentContext()};
135 cache->releaseEvent();
138 unsigned int eventSize;
145 if (DRWAIT == ecode &&
m_wait > 0) {
155 }
else if (DROK != ecode) {
162 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
175 if (cache->rawEvent ==
nullptr) {
188 ATH_MSG_DEBUG(
"switched to previous event in slot " << context);
189 return(cache->rawEvent.get());
◆ readerReady()
bool ByteStreamEventStorageInputSvc::readerReady |
( |
| ) |
|
|
private |
◆ ready()
bool ByteStreamEventStorageInputSvc::ready |
( |
| ) |
|
|
overridevirtual |
◆ ROBFragmentCheck()
bool ByteStreamEventStorageInputSvc::ROBFragmentCheck |
( |
const RawEvent * |
re | ) |
const |
|
private |
Definition at line 581 of file ByteStreamEventStorageInputSvc.cxx.
586 std::vector<eformat::FragmentProblem> problems;
588 for (
size_t i = 0;
i<total; ++
i) {
593 lastId =
f.source_id();
596 f.problems(problems);
597 if(!problems.empty()) {
599 for(
const auto& problem : problems) {
601 << eformat::helper::SourceIdentifier(lastId).human() <<
" : "
602 << eformat::helper::FragmentProblemDictionary.
string(problem));
◆ setEvent() [1/2]
void ByteStreamEventStorageInputSvc::setEvent |
( |
const EventContext & |
context, |
|
|
void * |
data, |
|
|
unsigned int |
eventStatus |
|
) |
| |
|
private |
Definition at line 622 of file ByteStreamEventStorageInputSvc.cxx.
627 cache->releaseEvent();
630 cache->rawEvent = std::make_unique<RawEvent>(fragment);
631 cache->eventStatus = eventStatus;
639 if (rec_sg != StatusCode::SUCCESS) {
640 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! "
◆ setEvent() [2/2]
void ByteStreamEventStorageInputSvc::setEvent |
( |
void * |
data, |
|
|
unsigned int |
eventStatus |
|
) |
| |
|
overridevirtual |
◆ setSequentialRead()
bool ByteStreamEventStorageInputSvc::setSequentialRead |
( |
| ) |
|
|
virtual |
◆ stop()
StatusCode ByteStreamEventStorageInputSvc::stop |
( |
| ) |
|
|
overridevirtual |
◆ validateEvent() [1/2]
void ByteStreamEventStorageInputSvc::validateEvent |
( |
| ) |
|
|
overridevirtual |
◆ validateEvent() [2/2]
unsigned ByteStreamEventStorageInputSvc::validateEvent |
( |
const RawEvent *const |
rawEvent | ) |
const |
|
private |
Definition at line 286 of file ByteStreamEventStorageInputSvc.cxx.
291 std::vector<eformat::FragmentProblem> problems;
292 rawEvent->problems(problems);
294 if(!problems.empty()) {
299 for(
const auto& problem : problems)
300 ATH_MSG_WARNING(eformat::helper::FragmentProblemDictionary.
string(problem));
◆ m_dump
Gaudi::Property<bool> ByteStreamEventStorageInputSvc::m_dump |
|
private |
◆ m_eventInfoKey
Gaudi::Property<std::string> ByteStreamEventStorageInputSvc::m_eventInfoKey |
|
private |
◆ m_eventsCache
◆ m_evtFileOffset
long long int ByteStreamEventStorageInputSvc::m_evtFileOffset |
|
private |
◆ m_evtInFile
unsigned int ByteStreamEventStorageInputSvc::m_evtInFile |
|
private |
◆ m_evtOffsets
std::vector<long long int> ByteStreamEventStorageInputSvc::m_evtOffsets |
|
private |
◆ m_fileGUID
std::string ByteStreamEventStorageInputSvc::m_fileGUID |
|
private |
◆ m_inputMetadata
◆ m_reader
std::unique_ptr<EventStorage::DataReader> ByteStreamEventStorageInputSvc::m_reader |
|
private |
◆ m_readerMutex
std::mutex ByteStreamEventStorageInputSvc::m_readerMutex |
|
private |
◆ m_robProvider
◆ m_sequential
Gaudi::Property<bool> ByteStreamEventStorageInputSvc::m_sequential |
|
private |
◆ m_storeGate
◆ m_valEvent
Gaudi::Property<bool> ByteStreamEventStorageInputSvc::m_valEvent |
|
private |
◆ m_wait
Gaudi::Property<float> ByteStreamEventStorageInputSvc::m_wait |
|
private |
The documentation for this class was generated from the following files:
char data[hepevt_bytes_allocation_ATLAS]
def validate(testSampleDir, thisSampleName, testSamplePath, weight_database, outputSamples)
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
const DataType * PointerType
POOL::TEvent event(POOL::TEvent::kClassAccess)
::StatusCode StatusCode
StatusCode definition for legacy code.
Default, invalid implementation of ClassID_traits.
Token & setDb(const Guid &db)
Set database name.
Token & setTechnology(int t)
Set technology type.
Token & setOid(const OID_t &oid)
Set object identifier.
std::unique_ptr< MVAUtils::BDT > convert(TMVA::MethodBDT *bdt, bool isRegression=true, bool useYesNoLeaf=false)
Status
Athena specific StatusCode values.
#define ATH_MSG_WARNING(x)
const boost::regex re(r_e)
static void dump(const RawEvent *re)
dump fragments from FullEventFragment