 |
ATLAS Offline Software
|
This class is the ByteStreamInputSvc for reading events written by EventStorage.
More...
#include <ByteStreamEventStorageInputSvc.h>
|
std::mutex | m_readerMutex |
|
SG::SlotSpecificObj< EventCache > | m_eventsCache |
|
std::unique_ptr< EventStorage::DataReader > | m_reader |
| DataReader from EventStorage. More...
|
|
std::vector< long long int > | m_evtOffsets |
| offset for event i in that file More...
|
|
unsigned int | m_evtInFile |
|
long long int | m_evtFileOffset |
| last read in event offset within a file, can be -1 More...
|
|
std::string | m_fileGUID |
| current file GUID More...
|
|
ServiceHandle< StoreGateSvc > | m_storeGate |
| Pointer to StoreGate. More...
|
|
ServiceHandle< StoreGateSvc > | m_inputMetadata |
| StoreGateSvc. More...
|
|
ServiceHandle< IROBDataProviderSvc > | m_robProvider |
|
Gaudi::Property< bool > | m_sequential {this, "EnableSequential", false, "enable sequential reading"} |
|
Gaudi::Property< bool > | m_dump {this, "DumpFlag", false, "Dump fragments"} |
|
Gaudi::Property< float > | m_wait {this, "WaitSecs", 0.0f, "Seconds to wait if input is in wait state"} |
|
Gaudi::Property< bool > | m_valEvent {this, "ValidateEvent", false, "switch on check_tree when reading events"} |
|
Gaudi::Property< std::string > | m_eventInfoKey {this, "EventInfoKey", "EventInfo", "Key of EventInfo in metadata store"} |
|
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 |
|
) |
| |
◆ ~ByteStreamEventStorageInputSvc()
ByteStreamEventStorageInputSvc::~ByteStreamEventStorageInputSvc |
( |
| ) |
|
|
virtual |
◆ buildFragment()
void ByteStreamEventStorageInputSvc::buildFragment |
( |
EventCache * |
cache, |
|
|
uint32_t |
eventSize, |
|
|
bool |
validate |
|
) |
| const |
|
private |
Definition at line 316 of file ByteStreamEventStorageInputSvc.cxx.
324 const DataType headWord = fragment[0];
325 ATH_MSG_DEBUG(
"First word of the fragment " << MSG::hex << headWord << MSG::dec);
327 const DataType formatVersion = eformat::helper::Version(fragment[3]).major_version();
328 ATH_MSG_DEBUG(
"Format version" << MSG::hex << formatVersion << MSG::dec);
330 if((formatVersion != eformat::MAJOR_DEFAULT_VERSION) &&
331 (formatVersion != eformat::MAJOR_V24_VERSION) &&
332 (formatVersion != eformat::MAJOR_V30_VERSION) &&
333 (formatVersion != eformat::MAJOR_V40_VERSION) &&
334 (formatVersion != eformat::MAJOR_V31_VERSION) ) {
336 << MSG::hex << formatVersion << MSG::dec);
339 if(eformat::FULL_EVENT == headWord || 0xcc1234cc == headWord) {
342 if(formatVersion != eformat::MAJOR_DEFAULT_VERSION) {
344 const uint32_t newEventSize = eventSize + 1000;
349 delete [] fragment; fragment =
nullptr;
352 fragment = newFragment;
353 cache->data =
reinterpret_cast< char*
>(fragment);
363 ATH_MSG_FATAL(
"Unknown Header work in input fragment " << MSG::hex << headWord);
370 cache->eventStatus = 0;
371 if(fragment[5] > 0) {
378 cache->rawEvent = std::make_unique<RawEvent>(fragment);
379 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 385 of file ByteStreamEventStorageInputSvc.cxx.
401 std::string
key =
"ByteStreamDataHeader";
407 std::unique_ptr<DataHeader> dataHeader = std::make_unique<DataHeader>();
413 dataHeader->
insert(*std::move(dataHeaderElement));
419 std::unique_ptr<IOpaqueAddress> iopx = std::make_unique<ByteStreamAddress>(
424 if (ptmpx !=
nullptr) {
426 dataHeader->
insert(element);
433 std::unique_ptr<IOpaqueAddress> iopaux = std::make_unique<ByteStreamAddress>(
440 dataHeader->
insert(element);
446 "ByteStreamDataHeader",
true,
false,
true));
448 return StatusCode::SUCCESS;
◆ getBlockIterator()
std::pair< long, std::string > ByteStreamEventStorageInputSvc::getBlockIterator |
( |
const std::string & |
fileName | ) |
|
|
overridevirtual |
Definition at line 517 of file ByteStreamEventStorageInputSvc.cxx.
522 m_reader = std::unique_ptr<EventStorage::DataReader>(pickDataReader(
fileName));
527 return std::make_pair(-1,
"END");
537 ATH_MSG_DEBUG(
"Recorded ByteStreamMetadata in InputMetaDataStore");
539 ATH_MSG_ERROR(
"Unable to record ByteStreamMetadata in InputMetaDataStore");
540 return std::make_pair(-1,
"FAIL");
548 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 191 of file ByteStreamEventStorageInputSvc.cxx.
194 const EventContext& context{ Gaudi::Hive::currentContext() };
198 cache->releaseEvent();
201 unsigned int eventSize;
211 ecode =
m_reader->getData(eventSize, &(cache->data));
219 if (DRWAIT == ecode &&
m_wait > 0) {
228 }
while(
m_reader->getData(eventSize, &(cache->data)) == DRWAIT);
229 }
else if (DROK != ecode) {
236 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
249 if (cache->rawEvent ==
nullptr) {
265 return(cache->rawEvent.get());
◆ positionInBlock()
long ByteStreamEventStorageInputSvc::positionInBlock |
( |
| ) |
|
|
overridevirtual |
◆ previousEvent()
const RawEvent * ByteStreamEventStorageInputSvc::previousEvent |
( |
| ) |
|
|
overridevirtual |
–, old
Definition at line 124 of file ByteStreamEventStorageInputSvc.cxx.
127 const EventContext& context{Gaudi::Hive::currentContext()};
130 cache->releaseEvent();
133 unsigned int eventSize;
140 if (DRWAIT == ecode &&
m_wait > 0) {
150 }
else if (DROK != ecode) {
157 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
170 if (cache->rawEvent ==
nullptr) {
183 ATH_MSG_DEBUG(
"switched to previous event in slot " << context);
184 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 578 of file ByteStreamEventStorageInputSvc.cxx.
583 std::vector<eformat::FragmentProblem> problems;
585 for (
size_t i = 0;
i<total; ++
i) {
590 lastId =
f.source_id();
593 f.problems(problems);
594 if(!problems.empty()) {
596 for(
const auto& problem : problems) {
598 << eformat::helper::SourceIdentifier(lastId).human() <<
" : "
599 << eformat::helper::FragmentProblemDictionary.
string(problem));
◆ setEvent() [1/2]
void ByteStreamEventStorageInputSvc::setEvent |
( |
const EventContext & |
context, |
|
|
void * |
data, |
|
|
unsigned int |
eventStatus |
|
) |
| |
|
private |
Definition at line 619 of file ByteStreamEventStorageInputSvc.cxx.
624 cache->releaseEvent();
627 cache->rawEvent = std::make_unique<RawEvent>(fragment);
628 cache->eventStatus = eventStatus;
636 if (rec_sg != StatusCode::SUCCESS) {
637 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 281 of file ByteStreamEventStorageInputSvc.cxx.
286 std::vector<eformat::FragmentProblem> problems;
287 rawEvent->problems(problems);
289 if(!problems.empty()) {
294 for(
const auto& problem : problems)
295 ATH_MSG_WARNING(eformat::helper::FragmentProblemDictionary.
string(problem));
◆ m_dump
Gaudi::Property<bool> ByteStreamEventStorageInputSvc::m_dump {this, "DumpFlag", false, "Dump fragments"} |
|
private |
◆ m_eventInfoKey
Gaudi::Property<std::string> ByteStreamEventStorageInputSvc::m_eventInfoKey {this, "EventInfoKey", "EventInfo", "Key of EventInfo in metadata store"} |
|
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 {this, "EnableSequential", false, "enable sequential reading"} |
|
private |
◆ m_storeGate
◆ m_valEvent
Gaudi::Property<bool> ByteStreamEventStorageInputSvc::m_valEvent {this, "ValidateEvent", false, "switch on check_tree when reading events"} |
|
private |
◆ m_wait
Gaudi::Property<float> ByteStreamEventStorageInputSvc::m_wait {this, "WaitSecs", 0.0f, "Seconds to wait if input is in wait state"} |
|
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
This class provides a token that identifies in a unique way objects on the persistent storage.
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