 |
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 {this, "EventStore", "StoreGateSvc"} |
| | Pointer to StoreGate. More...
|
| |
| ServiceHandle< StoreGateSvc > | m_inputMetadata {this, "MetaDataStore", "StoreGateSvc/InputMetaDataStore"} |
| |
| 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 |
( |
| ) |
|
|
virtualdefault |
◆ buildFragment()
| void ByteStreamEventStorageInputSvc::buildFragment |
( |
EventCache * |
cache, |
|
|
uint32_t |
eventSize, |
|
|
bool |
validate |
|
) |
| const |
|
private |
Definition at line 304 of file ByteStreamEventStorageInputSvc.cxx.
312 const DataType headWord = fragment[0];
313 ATH_MSG_DEBUG(
"First word of the fragment " << MSG::hex << headWord << MSG::dec);
315 const DataType formatVersion = eformat::helper::Version(fragment[3]).major_version();
316 ATH_MSG_DEBUG(
"Format version" << MSG::hex << formatVersion << MSG::dec);
318 if((formatVersion != eformat::MAJOR_DEFAULT_VERSION) &&
319 (formatVersion != eformat::MAJOR_V24_VERSION) &&
320 (formatVersion != eformat::MAJOR_V30_VERSION) &&
321 (formatVersion != eformat::MAJOR_V40_VERSION) &&
322 (formatVersion != eformat::MAJOR_V31_VERSION) ) {
324 << MSG::hex << formatVersion << MSG::dec);
327 if(eformat::FULL_EVENT == headWord || 0xcc1234cc == headWord) {
330 if(formatVersion != eformat::MAJOR_DEFAULT_VERSION) {
332 const uint32_t newEventSize = eventSize + 1000;
337 delete [] fragment; fragment =
nullptr;
340 fragment = newFragment;
341 cache->data =
reinterpret_cast< char*
>(fragment);
351 ATH_MSG_FATAL(
"Unknown Header work in input fragment " << MSG::hex << headWord);
358 cache->eventStatus = 0;
359 if(fragment[5] > 0) {
366 cache->rawEvent = std::make_unique<RawEvent>(fragment);
367 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 373 of file ByteStreamEventStorageInputSvc.cxx.
389 std::string
key =
"ByteStreamDataHeader";
395 std::unique_ptr<DataHeader> dataHeader = std::make_unique<DataHeader>();
401 dataHeader->
insert(*std::move(dataHeaderElement));
407 std::unique_ptr<IOpaqueAddress> iopx = std::make_unique<ByteStreamAddress>(
412 if (ptmpx !=
nullptr) {
414 dataHeader->
insert(element);
421 std::unique_ptr<IOpaqueAddress> iopaux = std::make_unique<ByteStreamAddress>(
428 dataHeader->
insert(element);
434 "ByteStreamDataHeader",
true,
false,
true));
436 return StatusCode::SUCCESS;
◆ getBlockIterator()
| std::pair< long, std::string > ByteStreamEventStorageInputSvc::getBlockIterator |
( |
const std::string & |
fileName | ) |
|
|
overridevirtual |
Definition at line 505 of file ByteStreamEventStorageInputSvc.cxx.
510 m_reader = std::unique_ptr<EventStorage::DataReader>(pickDataReader(
fileName));
515 return std::make_pair(-1,
"END");
525 ATH_MSG_DEBUG(
"Recorded ByteStreamMetadata in InputMetaDataStore");
527 ATH_MSG_ERROR(
"Unable to record ByteStreamMetadata in InputMetaDataStore");
528 return std::make_pair(-1,
"FAIL");
536 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 179 of file ByteStreamEventStorageInputSvc.cxx.
182 const EventContext& context{ Gaudi::Hive::currentContext() };
186 cache->releaseEvent();
189 unsigned int eventSize;
199 ecode =
m_reader->getData(eventSize, &(cache->data));
207 if (DRWAIT == ecode &&
m_wait > 0) {
216 }
while(
m_reader->getData(eventSize, &(cache->data)) == DRWAIT);
217 }
else if (DROK != ecode) {
224 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
237 if (cache->rawEvent ==
nullptr) {
253 return cache->rawEvent.get();
◆ positionInBlock()
| long ByteStreamEventStorageInputSvc::positionInBlock |
( |
| ) |
|
|
overridevirtual |
◆ previousEvent()
| const RawEvent * ByteStreamEventStorageInputSvc::previousEvent |
( |
| ) |
|
|
overridevirtual |
–, old
Definition at line 112 of file ByteStreamEventStorageInputSvc.cxx.
115 const EventContext& context{Gaudi::Hive::currentContext()};
118 cache->releaseEvent();
121 unsigned int eventSize;
128 if (DRWAIT == ecode &&
m_wait > 0) {
138 }
else if (DROK != ecode) {
145 ATH_MSG_ERROR(
"DataReader not ready. Need to getBlockIterator first");
158 if (cache->rawEvent ==
nullptr) {
171 ATH_MSG_DEBUG(
"switched to previous event in slot " << context);
172 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 566 of file ByteStreamEventStorageInputSvc.cxx.
571 std::vector<eformat::FragmentProblem> problems;
573 for (
size_t i = 0;
i<total; ++
i) {
578 lastId =
f.source_id();
581 f.problems(problems);
582 if(!problems.empty()) {
584 for(
const auto& problem : problems) {
586 << eformat::helper::SourceIdentifier(lastId).human() <<
" : "
587 << eformat::helper::FragmentProblemDictionary.
string(problem));
◆ setEvent() [1/2]
| void ByteStreamEventStorageInputSvc::setEvent |
( |
const EventContext & |
context, |
|
|
void * |
data, |
|
|
unsigned int |
eventStatus |
|
) |
| |
|
private |
Definition at line 607 of file ByteStreamEventStorageInputSvc.cxx.
612 cache->releaseEvent();
615 cache->rawEvent = std::make_unique<RawEvent>(fragment);
616 cache->eventStatus = eventStatus;
624 if (rec_sg != StatusCode::SUCCESS) {
625 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 269 of file ByteStreamEventStorageInputSvc.cxx.
274 std::vector<eformat::FragmentProblem> problems;
275 rawEvent->problems(problems);
277 if(!problems.empty()) {
282 for(
const auto& problem : problems)
283 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]
const DataType * PointerType
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.
::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