![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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 34 of file ByteStreamEventStorageInputSvc.h.
◆ Advance
◆ ByteStreamEventStorageInputSvc()
ByteStreamEventStorageInputSvc::ByteStreamEventStorageInputSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructors:
Definition at line 37 of file ByteStreamEventStorageInputSvc.cxx.
51 ,
m_dump (
this,
"DumpFlag",
false,
"Dump fragments")
52 ,
m_wait (
this,
"WaitSecs", 0.,
"Seconds to wait if input is in wait state")
53 ,
m_valEvent (
this,
"ValidateEvent",
true,
"switch on check_tree when reading events")
54 ,
m_eventInfoKey (
this,
"EventInfoKey",
"EventInfo",
"Key of EventInfo in metadata store")
56 assert(pSvcLocator !=
nullptr);
◆ ~ByteStreamEventStorageInputSvc()
ByteStreamEventStorageInputSvc::~ByteStreamEventStorageInputSvc |
( |
| ) |
|
|
virtual |
◆ buildFragment()
void ByteStreamEventStorageInputSvc::buildFragment |
( |
EventCache * |
cache, |
|
|
uint32_t |
eventSize, |
|
|
bool |
validate |
|
) |
| const |
|
private |
Definition at line 322 of file ByteStreamEventStorageInputSvc.cxx.
330 const DataType headWord = fragment[0];
331 ATH_MSG_DEBUG(
"First word of the fragment " << MSG::hex << headWord << MSG::dec);
333 const DataType formatVersion = eformat::helper::Version(fragment[3]).major_version();
334 ATH_MSG_DEBUG(
"Format version" << MSG::hex << formatVersion << MSG::dec);
336 if((formatVersion != eformat::MAJOR_DEFAULT_VERSION) &&
337 (formatVersion != eformat::MAJOR_V24_VERSION) &&
338 (formatVersion != eformat::MAJOR_V30_VERSION) &&
339 (formatVersion != eformat::MAJOR_V40_VERSION) &&
340 (formatVersion != eformat::MAJOR_V31_VERSION) ) {
342 << MSG::hex << formatVersion << MSG::dec);
345 if(eformat::FULL_EVENT == headWord || 0xcc1234cc == headWord) {
348 if(formatVersion != eformat::MAJOR_DEFAULT_VERSION) {
350 const uint32_t newEventSize = eventSize + 1000;
355 delete [] fragment; fragment =
nullptr;
358 fragment = newFragment;
359 cache->data =
reinterpret_cast< char*
>(fragment);
369 ATH_MSG_FATAL(
"Unknown Header work in input fragment " << MSG::hex << headWord);
376 cache->eventStatus = 0;
377 if(fragment[5] > 0) {
384 cache->rawEvent = std::make_unique<RawEvent>(fragment);
385 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 |
Reimplemented from ByteStreamInputSvc.
Definition at line 391 of file ByteStreamEventStorageInputSvc.cxx.
405 std::string
key =
"ByteStreamDataHeader";
411 std::unique_ptr<DataHeader> dataHeader = std::make_unique<DataHeader>();
415 dataHeader->
insert(*std::move(dataHeaderElement));
423 std::unique_ptr<IOpaqueAddress> iopx = std::make_unique<ByteStreamAddress>(
428 if (ptmpx !=
nullptr) {
430 dataHeader->
insert(element);
437 std::unique_ptr<IOpaqueAddress> iopaux = std::make_unique<ByteStreamAddress>(
444 dataHeader->
insert(element);
450 "ByteStreamDataHeader",
true,
false,
true));
452 return StatusCode::SUCCESS;
◆ getBlockIterator()
std::pair< long, std::string > ByteStreamEventStorageInputSvc::getBlockIterator |
( |
const std::string & |
fileName | ) |
|
|
overridevirtual |
◆ getEvent()
◆ initialize()
StatusCode ByteStreamEventStorageInputSvc::initialize |
( |
| ) |
|
|
overridevirtual |
◆ interfaceID()
const InterfaceID & ByteStreamInputSvc::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
Retrieve interface ID.
Declaration of the interface ID ( interface id, major version, minor version)
Definition at line 49 of file ByteStreamInputSvc.h.
51 static const InterfaceID IID_ByteStreamInputSvc(
"ByteStreamInputSvc", 1, 0);
52 return(IID_ByteStreamInputSvc);
◆ loadMetadata()
StatusCode ByteStreamEventStorageInputSvc::loadMetadata |
( |
| ) |
|
|
private |
◆ makeBSProvenance()
std::unique_ptr< DataHeaderElement > ByteStreamEventStorageInputSvc::makeBSProvenance |
( |
| ) |
const |
|
private |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ nextEvent()
++, new
Implements ByteStreamInputSvc.
Definition at line 197 of file ByteStreamEventStorageInputSvc.cxx.
200 const EventContext& context{ Gaudi::Hive::currentContext() };
204 cache->releaseEvent();
207 unsigned int eventSize;
217 ecode =
m_reader->getData(eventSize, &(cache->data));
225 if (DRWAIT == ecode &&
m_wait > 0) {
234 }
while(
m_reader->getData(eventSize, &(cache->data)) == DRWAIT);
235 }
else if (DROK != ecode) {
242 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
255 if (cache->rawEvent ==
nullptr) {
271 return(cache->rawEvent.get());
◆ positionInBlock()
long ByteStreamEventStorageInputSvc::positionInBlock |
( |
| ) |
|
|
overridevirtual |
◆ previousEvent()
const RawEvent * ByteStreamEventStorageInputSvc::previousEvent |
( |
| ) |
|
|
overridevirtual |
–, old
Implements ByteStreamInputSvc.
Definition at line 130 of file ByteStreamEventStorageInputSvc.cxx.
133 const EventContext& context{Gaudi::Hive::currentContext()};
136 cache->releaseEvent();
139 unsigned int eventSize;
146 if (DRWAIT == ecode &&
m_wait > 0) {
156 }
else if (DROK != ecode) {
163 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
176 if (cache->rawEvent ==
nullptr) {
189 ATH_MSG_DEBUG(
"switched to previous event in slot " << context);
190 return(cache->rawEvent.get());
◆ queryInterface()
StatusCode ByteStreamEventStorageInputSvc::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvInterface |
|
) |
| |
|
overridevirtual |
◆ readerReady()
bool ByteStreamEventStorageInputSvc::readerReady |
( |
| ) |
|
|
private |
◆ ready()
bool ByteStreamEventStorageInputSvc::ready |
( |
| ) |
|
|
overridevirtual |
◆ ROBFragmentCheck()
bool ByteStreamEventStorageInputSvc::ROBFragmentCheck |
( |
const RawEvent * |
re | ) |
const |
|
private |
Definition at line 582 of file ByteStreamEventStorageInputSvc.cxx.
587 std::vector<eformat::FragmentProblem> problems;
589 for (
size_t i = 0;
i<total; ++
i) {
594 lastId =
f.source_id();
597 f.problems(problems);
598 if(!problems.empty()) {
600 for(
const auto& problem : problems) {
602 << eformat::helper::SourceIdentifier(lastId).human() <<
" : "
603 << eformat::helper::FragmentProblemDictionary.
string(problem));
◆ setEvent() [1/2]
void ByteStreamEventStorageInputSvc::setEvent |
( |
const EventContext & |
context, |
|
|
void * |
data, |
|
|
unsigned int |
eventStatus |
|
) |
| |
|
private |
Definition at line 623 of file ByteStreamEventStorageInputSvc.cxx.
628 cache->releaseEvent();
631 cache->rawEvent = std::make_unique<RawEvent>(fragment);
632 cache->eventStatus = eventStatus;
640 if (rec_sg != StatusCode::SUCCESS) {
641 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 287 of file ByteStreamEventStorageInputSvc.cxx.
292 std::vector<eformat::FragmentProblem> problems;
293 rawEvent->problems(problems);
295 if(!problems.empty()) {
300 for(
const auto& problem : problems)
301 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 finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
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