|
ATLAS Offline Software
|
concrete implementation of IEvtSelector for ByteStream
More...
#include <EventSelectorByteStream.h>
|
StatusCode | nextImpl (Context &it, lock_t &lock) const |
|
StatusCode | nextImpl (Context &it, int jump, lock_t &lock) const |
|
StatusCode | previousImpl (Context &it, lock_t &lock) const |
|
StatusCode | previousImpl (Context &it, int jump, lock_t &lock) const |
|
StatusCode | nextHandleFileTransitionImpl (IEvtSelector::Context &ctxt, lock_t &lock) const |
|
StatusCode | nextWithSkipImpl (IEvtSelector::Context &ctxt, lock_t &lock) const |
|
StatusCode | recordAttributeListImpl (lock_t &lock) const |
|
StatusCode | fillAttributeListImpl (coral::AttributeList *attrList, const std::string &suffix, bool copySource, lock_t &lock) const |
|
StatusCode | reinit (lock_t &lock) |
| Reinitialize the service when a fork() occurred/was-issued. More...
|
|
StatusCode | openNewRun (lock_t &lock) const |
|
void | nextFile (lock_t &lock) const |
|
int | findEvent (int evtNum, lock_t &lock) const |
| Search for event with number evtNum. More...
|
|
StoreGateSvc * | eventStore () const |
|
void | inputCollectionsHandler (Gaudi::Details::PropertyBase &) |
|
|
mutex_t | m_mutex |
|
int m_fileCount | ATLAS_THREAD_SAFE = 0 |
| number of files to process. More...
|
|
std::vector< int > m_numEvt | ATLAS_THREAD_SAFE |
|
std::vector< int > m_firstEvt | ATLAS_THREAD_SAFE |
|
std::vector< std::string >::const_iterator m_inputCollectionsIterator | ATLAS_THREAD_SAFE |
|
std::vector< long > m_skipEventSequence | ATLAS_THREAD_SAFE |
|
long m_NumEvents | ATLAS_THREAD_SAFE = 0 |
|
ToolHandle< IAthenaIPCTool > m_eventStreamingTool | ATLAS_THREAD_SAFE {this, "SharedMemoryTool", "", ""} |
|
Gaudi::Property< bool > | m_isSecondary {this, "IsSecondary", false, ""} |
| IsSecondary, know if this is an instance of secondary event selector. More...
|
|
Gaudi::Property< std::string > | m_eventSourceName {this, "ByteStreamInputSvc", "", ""} |
|
Gaudi::Property< bool > | m_procBadEvent {this, "ProcessBadEvent", false, ""} |
| process bad events, which fail check_tree(). More...
|
|
Gaudi::Property< int > | m_maxBadEvts {this, "MaxBadEvents", -1, ""} |
| number of bad events allowed before quitting. More...
|
|
EventContextByteStream * | m_beginIter {} |
|
EventContextByteStream * | m_endIter {} |
|
SmartIF< IByteStreamInputSvc > | m_eventSource |
|
Gaudi::Property< std::vector< std::string > > | m_inputCollectionsProp {this, "Input", {}, ""} |
|
ServiceHandle< IIncidentSvc > | m_incidentSvc {this, "IncidentSvc", "IncidentSvc", ""} |
|
Gaudi::Property< long > | m_skipEvents {this, "SkipEvents", 0, ""} |
|
Gaudi::Property< std::vector< long > > | m_skipEventSequenceProp {this, "SkipEventSequence", {}, ""} |
|
bool | m_firstFileFired {} |
|
bool | m_beginFileFired {} |
|
ToolHandleArray< IAthenaSelectorTool > | m_helperTools {this} |
| HelperTools, vector of names of AlgTools that are executed by the EventSelector. More...
|
|
ToolHandle< IAthenaSelectorTool > | m_counterTool {this, "CounterTool", "", ""} |
|
Gaudi::Property< bool > | m_overrideRunNumber {this, "OverrideRunNumber", false, ""} |
| The following are included for compatibility with McEventSelector and are not really used. More...
|
|
Gaudi::Property< bool > | m_filebased {this, "FileBased", true, ""} |
|
Gaudi::CheckedProperty< int > | m_runNo {this, "RunNumber", 0, ""} |
|
Gaudi::CheckedProperty< int > | m_firstEventNo {this, "FirstEvent", 1, ""} |
|
Gaudi::CheckedProperty< int > | m_eventsPerRun {this, "EventsPerRun", 1000000, ""} |
|
Gaudi::CheckedProperty< int > | m_firstLBNo {this, "FirstLB", 0, ""} |
|
Gaudi::CheckedProperty< int > | m_eventsPerLB {this, "EventsPerLB", 1000, ""} |
|
Gaudi::CheckedProperty< int > | m_initTimeStamp {this, "InitialTimeStamp", 0, ""} |
|
Gaudi::Property< int > | m_timeStampInterval {this, "TimeStampInterval", 0, ""} |
|
concrete implementation of IEvtSelector for ByteStream
An event selector service that steps through Event Filter packed raw events by use of an event source object and an iterator object called EventIteratorByteStream. The type of event source is specified at run time. It
can be a single file, a set of files or the network.
Definition at line 42 of file EventSelectorByteStream.h.
◆ lock_t
◆ mutex_t
◆ EventSelectorByteStream()
EventSelectorByteStream::EventSelectorByteStream |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svcloc |
|
) |
| |
◆ ~EventSelectorByteStream()
EventSelectorByteStream::~EventSelectorByteStream |
( |
| ) |
|
|
virtual |
◆ createAddress()
StatusCode EventSelectorByteStream::createAddress |
( |
const Context & |
it, |
|
|
IOpaqueAddress *& |
iop |
|
) |
| const |
|
overridevirtual |
- Parameters
-
it | [IN] current event context. |
iop | [OUT] pointer to IOpaqueAddress reference of selection context. |
Definition at line 1038 of file EventSelectorByteStream.cxx.
1042 iop =
proxy->address();
1043 return(StatusCode::SUCCESS);
1046 return(StatusCode::FAILURE);
◆ createContext()
StatusCode EventSelectorByteStream::createContext |
( |
IEvtSelector::Context *& |
it | ) |
const |
|
overridevirtual |
◆ curEvent()
int EventSelectorByteStream::curEvent |
( |
const Context & |
it | ) |
const |
|
overridevirtual |
Return the current event number.
- Parameters
-
it | [IN/OUT] current event context. |
Definition at line 943 of file EventSelectorByteStream.cxx.
946 return int(m_NumEvents);
◆ disconnectIfFinished()
◆ eventStore()
StoreGateSvc * EventSelectorByteStream::eventStore |
( |
| ) |
const |
|
private |
◆ fillAttributeList()
StatusCode EventSelectorByteStream::fillAttributeList |
( |
coral::AttributeList * |
attrList, |
|
|
const std::string & |
suffix, |
|
|
bool |
copySource |
|
) |
| const |
|
overrideprotectedvirtual |
◆ fillAttributeListImpl()
StatusCode EventSelectorByteStream::fillAttributeListImpl |
( |
coral::AttributeList * |
attrList, |
|
|
const std::string & |
suffix, |
|
|
bool |
copySource, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 813 of file EventSelectorByteStream.cxx.
816 attrList->extend(
"RunNumber" +
suffix,
"unsigned int");
817 attrList->extend(
"EventNumber" +
suffix,
"unsigned long long");
818 attrList->extend(
"LumiBlockN" +
suffix,
"unsigned int");
819 attrList->extend(
"BunchId" +
suffix,
"unsigned int");
820 attrList->extend(
"EventTime" +
suffix,
"unsigned int");
821 attrList->extend(
"EventTimeNanoSec" +
suffix,
"unsigned int");
826 (*attrList)[
"RunNumber" +
suffix].data<
unsigned int>() =
event->run_no();
827 if (
event->version() < 0x03010000) {
828 (*attrList)[
"EventNumber" +
suffix].data<
unsigned long long>() =
event->lvl1_id();
830 (*attrList)[
"EventNumber" +
suffix].data<
unsigned long long>() =
event->global_id();
832 (*attrList)[
"LumiBlockN" +
suffix].data<
unsigned int>() =
event->lumi_block();
833 (*attrList)[
"BunchId" +
suffix].data<
unsigned int>() =
event->bc_id();
835 unsigned int bc_time_sec =
event->bc_time_seconds();
836 unsigned int bc_time_ns =
event->bc_time_nanoseconds();
838 if (bc_time_ns > 1000000000) {
840 ATH_MSG_WARNING(
" bc_time nanosecond number larger than 1e9, it is " << bc_time_ns <<
", reset it to 1 sec");
841 bc_time_ns = 1000000000;
843 (*attrList)[
"EventTime" +
suffix].data<
unsigned int>() = bc_time_sec;
844 (*attrList)[
"EventTimeNanoSec" +
suffix].data<
unsigned int>() = bc_time_ns;
849 attrList->extend(
"TriggerStatus" +
suffix,
"unsigned int");
850 (*attrList)[
"TriggerStatus" +
suffix].data<
unsigned int>() = *
buffer;
852 attrList->extend(
"ExtendedL1ID" +
suffix,
"unsigned int");
853 attrList->extend(
"L1TriggerType" +
suffix,
"unsigned int");
854 (*attrList)[
"ExtendedL1ID" +
suffix].data<
unsigned int>() =
event->lvl1_id();
855 (*attrList)[
"L1TriggerType" +
suffix].data<
unsigned int>() =
event->lvl1_trigger_type();
858 event->lvl1_trigger_info(
buffer);
859 for (
uint32_t iT1 = 0; iT1 <
event->nlvl1_trigger_info(); ++iT1) {
860 std::stringstream
name;
861 name <<
"L1TriggerInfo_" << iT1;
862 attrList->extend(
name.str() +
suffix,
"unsigned int");
868 event->lvl2_trigger_info(
buffer);
869 for (
uint32_t iT1 = 0; iT1 <
event->nlvl2_trigger_info(); ++iT1) {
871 std::stringstream
name;
872 name <<
"L2TriggerInfo_" << iT1;
873 attrList->extend(
name.str() +
suffix,
"unsigned int");
880 event->event_filter_info(
buffer);
881 for (
uint32_t iT1 = 0; iT1 <
event->nevent_filter_info(); ++iT1) {
883 std::stringstream
name;
884 name <<
"EFTriggerInfo_" << iT1;
885 attrList->extend(
name.str() +
suffix,
"unsigned int");
892 event->stream_tag(
buffer);
893 std::vector<eformat::helper::StreamTag> onl_streamTags;
895 for (std::vector<eformat::helper::StreamTag>::const_iterator itS = onl_streamTags.begin(),
896 itSE = onl_streamTags.end(); itS != itSE; ++itS) {
897 attrList->extend(itS->name +
suffix,
"string");
898 (*attrList)[itS->name +
suffix].data<std::string>() = itS->type;
901 return StatusCode::SUCCESS;
◆ finalize()
StatusCode EventSelectorByteStream::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 249 of file EventSelectorByteStream.cxx.
256 if (!
tool->preFinalize().isSuccess()) {
263 if (!m_eventStreamingTool.empty() && !m_eventStreamingTool.release().isSuccess()) {
◆ findEvent()
int EventSelectorByteStream::findEvent |
( |
int |
evtNum, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Search for event with number evtNum.
Definition at line 905 of file EventSelectorByteStream.cxx.
914 if (m_numEvt[
i] == -1) {
917 long nev = nevguid.first;
924 m_firstEvt[
i] = m_firstEvt[
i - 1] + m_numEvt[
i - 1];
932 if (evtNum >= m_firstEvt[
i] && evtNum < m_firstEvt[
i] + m_numEvt[
i]) {
◆ initialize()
StatusCode EventSelectorByteStream::initialize |
( |
| ) |
|
|
overridevirtual |
Implementation of Service base class methods.
Definition at line 84 of file EventSelectorByteStream.cxx.
86 m_autoRetrieveTools =
false;
87 m_checkToolDeps =
false;
97 return(StatusCode::FAILURE);
103 return(StatusCode::FAILURE);
106 std::sort(m_skipEventSequence.begin(), m_skipEventSequence.end());
112 return(StatusCode::FAILURE);
119 return(StatusCode::FAILURE);
126 return(StatusCode::FAILURE);
130 if (!m_eventStreamingTool.empty() && !m_eventStreamingTool.retrieve().isSuccess()) {
132 return(StatusCode::FAILURE);
137 if (!iomgr.retrieve().isSuccess()) {
139 return(StatusCode::FAILURE);
141 if (!iomgr->io_register(
this).isSuccess()) {
142 ATH_MSG_FATAL(
"Cannot register myself with the IoComponentMgr.");
143 return(StatusCode::FAILURE);
158 return(StatusCode::FAILURE);
◆ inputCollectionsHandler()
void EventSelectorByteStream::inputCollectionsHandler |
( |
Gaudi::Details::PropertyBase & |
| ) |
|
|
private |
◆ io_reinit()
StatusCode EventSelectorByteStream::io_reinit |
( |
| ) |
|
|
overridevirtual |
Callback method to reinitialize the internal state of the component for I/O purposes (e.g. upon fork(2)
)
Definition at line 1057 of file EventSelectorByteStream.cxx.
1061 if (!iomgr.retrieve().isSuccess()) {
1063 return(StatusCode::FAILURE);
1065 if (!iomgr->io_hasitem(
this)) {
1066 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
1067 return(StatusCode::FAILURE);
1073 if (!iomgr->io_contains(
this,
fname)) {
1075 return(StatusCode::FAILURE);
1077 if (!iomgr->io_retrieve(
this,
fname).isSuccess()) {
1079 return(StatusCode::FAILURE);
1090 [] (Gaudi::Details::PropertyBase&) {}
1095 return(this->
reinit(lock));
◆ last()
StatusCode EventSelectorByteStream::last |
( |
IEvtSelector::Context & |
it | ) |
const |
|
overridevirtual |
- Parameters
-
it | [IN/OUT] current event context is interated to last event. |
Definition at line 698 of file EventSelectorByteStream.cxx.
701 return(StatusCode::SUCCESS);
703 return(StatusCode::FAILURE);
◆ makeClient()
StatusCode EventSelectorByteStream::makeClient |
( |
int |
num | ) |
|
|
overridevirtual |
Make this a client.
Definition at line 964 of file EventSelectorByteStream.cxx.
966 if (m_eventStreamingTool.empty()) {
967 return(StatusCode::FAILURE);
969 std::string dummyStr;
970 return(m_eventStreamingTool->makeClient(0, dummyStr));
◆ makeServer()
StatusCode EventSelectorByteStream::makeServer |
( |
int |
num | ) |
|
|
overridevirtual |
Make this a server.
Definition at line 955 of file EventSelectorByteStream.cxx.
957 if (m_eventStreamingTool.empty()) {
958 return(StatusCode::FAILURE);
960 return(m_eventStreamingTool->makeServer(1,
""));
◆ next() [1/2]
StatusCode EventSelectorByteStream::next |
( |
IEvtSelector::Context & |
it | ) |
const |
|
overridevirtual |
◆ next() [2/2]
StatusCode EventSelectorByteStream::next |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump |
|
) |
| const |
|
overridevirtual |
- Parameters
-
it | [IN/OUT] current event context is interated to next event. |
jump | [IN] number of events to jump (currently not supported). |
Definition at line 486 of file EventSelectorByteStream.cxx.
◆ nextFile()
void EventSelectorByteStream::nextFile |
( |
lock_t & |
lock | ) |
const |
|
private |
Definition at line 281 of file EventSelectorByteStream.cxx.
282 FileIncident endInputFileIncident(
name(),
"EndInputFile",
"BSF:" + *m_inputCollectionsIterator);
284 ++m_inputCollectionsIterator;
◆ nextHandleFileTransition()
StatusCode EventSelectorByteStream::nextHandleFileTransition |
( |
IEvtSelector::Context & |
ctxt | ) |
const |
|
overrideprotectedvirtual |
◆ nextHandleFileTransitionImpl()
StatusCode EventSelectorByteStream::nextHandleFileTransitionImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 522 of file EventSelectorByteStream.cxx.
532 ATH_MSG_DEBUG(
"Event source found no more valid files left in input list");
534 return StatusCode::FAILURE;
542 return StatusCode::FAILURE;
553 if (pre ==
nullptr) {
555 return StatusCode::FAILURE;
561 return badEvent ? StatusCode::RECOVERABLE : StatusCode::SUCCESS;
566 if (rec_sg != StatusCode::SUCCESS) {
567 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
570 return StatusCode::SUCCESS;
◆ nextImpl() [1/2]
StatusCode EventSelectorByteStream::nextImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 492 of file EventSelectorByteStream.cxx.
499 unsigned int cntr = m_NumEvents;
501 while (m_NumEvents+1 <= cntr + jump) {
502 if (!
nextImpl(ctxt, lock).isSuccess()) {
503 return(StatusCode::FAILURE);
508 return(StatusCode::SUCCESS);
513 return(StatusCode::SUCCESS);
◆ nextImpl() [2/2]
StatusCode EventSelectorByteStream::nextImpl |
( |
IEvtSelector::Context & |
it, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 347 of file EventSelectorByteStream.cxx.
350 static std::atomic<int> n_bad_events = 0;
352 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
355 if (!m_eventStreamingTool->getLockedEvent(&
source,
status).isSuccess()) {
356 ATH_MSG_FATAL(
"Cannot get NextEvent from AthenaSharedMemoryTool");
357 return(StatusCode::FAILURE);
360 return(StatusCode::SUCCESS);
364 if (!
tool->preNext().isSuccess()) {
377 if (
sc.isRecoverable()) {
379 }
else if (
sc.isFailure()) {
380 return StatusCode::FAILURE;
388 int nbad = ++n_bad_events;
389 ATH_MSG_INFO(
"Bad event encountered, current count at " << nbad);
395 return(StatusCode::FAILURE);
402 (m_skipEventSequence.empty() || m_NumEvents != m_skipEventSequence.front()) ) {
406 if (rec_sg != StatusCode::SUCCESS) {
407 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
416 if (toolStatus.isRecoverable()) {
418 status = StatusCode::RECOVERABLE;
419 }
else if (toolStatus.isFailure()) {
421 status = StatusCode::FAILURE;
424 if (
status.isRecoverable()) {
426 }
else if (
status.isFailure()) {
444 int nbad = ++n_bad_events;
445 ATH_MSG_INFO(
"Bad event encountered, current count at " << nbad);
452 return(StatusCode::FAILURE);
457 if (!m_skipEventSequence.empty() && m_NumEvents == m_skipEventSequence.front()) {
458 m_skipEventSequence.erase(m_skipEventSequence.begin());
460 if ( m_NumEvents % 1
'000 == 0 ) {
461 ATH_MSG_INFO("Skipping event " << m_NumEvents - 1);
463 ATH_MSG_DEBUG("Skipping event " << m_NumEvents - 1);
468 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isServer()) { // For SharedReader Server, put event into SHM
469 const RawEvent* pre = m_eventSource->currentEvent();
471 while ( (sc = putEvent_ST(*m_eventStreamingTool,
472 m_NumEvents - 1, pre->start(),
473 pre->fragment_size_word() * sizeof(uint32_t),
474 m_eventSource->currentEventStatus())).isRecoverable() ) {
477 if (!sc.isSuccess()) {
478 ATH_MSG_ERROR("Cannot put Event " << m_NumEvents - 1 << " to AthenaSharedMemoryTool");
479 return(StatusCode::FAILURE);
482 return(StatusCode::SUCCESS);
◆ nextWithSkip()
StatusCode EventSelectorByteStream::nextWithSkip |
( |
IEvtSelector::Context & |
ctxt | ) |
const |
|
overrideprotectedvirtual |
◆ nextWithSkipImpl()
StatusCode EventSelectorByteStream::nextWithSkipImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 578 of file EventSelectorByteStream.cxx.
585 if (
sc.isRecoverable()) {
588 if (
sc.isFailure()) {
589 return StatusCode::FAILURE;
599 (m_skipEventSequence.empty() || m_NumEvents != m_skipEventSequence.front()) ) {
600 return StatusCode::SUCCESS;
602 if (!m_skipEventSequence.empty() && m_NumEvents == m_skipEventSequence.front()) {
603 m_skipEventSequence.erase(m_skipEventSequence.begin());
606 ATH_MSG_INFO(
"skipping secondary event " << m_NumEvents);
613 return StatusCode::SUCCESS;
◆ openNewRun()
StatusCode EventSelectorByteStream::openNewRun |
( |
lock_t & |
lock | ) |
const |
|
private |
Definition at line 288 of file EventSelectorByteStream.cxx.
291 ATH_MSG_ERROR(
"cannot open new run for non-filebased inputs");
292 return(StatusCode::FAILURE);
297 return(StatusCode::FAILURE);
299 std::string
blockname = *m_inputCollectionsIterator;
303 long nev = nevguid.first;
305 ATH_MSG_FATAL(
"Unable to access file " << *m_inputCollectionsIterator <<
", stopping here");
310 FileIncident beginInputFileIncident(
name(),
"BeginInputFile",
"BSF:" + *m_inputCollectionsIterator,nevguid.second);
323 ATH_MSG_WARNING(
"skipping more events " <<
m_skipEvents.value() - m_NumEvents <<
"(" <<
nev <<
") than in file " << *m_inputCollectionsIterator <<
", try next");
325 m_numEvt[m_fileCount] =
nev;
332 m_firstEvt[m_fileCount] = m_NumEvents;
333 m_numEvt[m_fileCount] =
nev;
335 return(StatusCode::SUCCESS);
◆ previous() [1/2]
StatusCode EventSelectorByteStream::previous |
( |
IEvtSelector::Context & |
ctxt | ) |
const |
|
overridevirtual |
◆ previous() [2/2]
StatusCode EventSelectorByteStream::previous |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump |
|
) |
| const |
|
overridevirtual |
- Parameters
-
it | [IN/OUT] current event context is interated to previous event. |
jump | [IN] number of events to jump (currently not supported). |
Definition at line 677 of file EventSelectorByteStream.cxx.
◆ previousImpl() [1/2]
StatusCode EventSelectorByteStream::previousImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 683 of file EventSelectorByteStream.cxx.
688 for (
int i = 0;
i < jump;
i++) {
690 return(StatusCode::FAILURE);
693 return(StatusCode::SUCCESS);
695 return(StatusCode::FAILURE);
◆ previousImpl() [2/2]
StatusCode EventSelectorByteStream::previousImpl |
( |
IEvtSelector::Context & |
it, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 621 of file EventSelectorByteStream.cxx.
625 bool badEvent(
false);
633 return StatusCode::FAILURE;
647 return(StatusCode::FAILURE);
651 ATH_MSG_FATAL(
"Attempt to read previous data on invalid reader");
652 return(StatusCode::FAILURE);
663 return(StatusCode::FAILURE);
670 if (rec_sg != StatusCode::SUCCESS) {
671 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
674 return StatusCode::SUCCESS;
◆ readEvent()
StatusCode EventSelectorByteStream::readEvent |
( |
int |
maxevt | ) |
|
|
overridevirtual |
Read the next maxevt events.
- Parameters
-
evtnum | [IN] The number of events to read. |
Definition at line 991 of file EventSelectorByteStream.cxx.
993 if (m_eventStreamingTool.empty()) {
994 ATH_MSG_ERROR(
"No AthenaSharedMemoryTool configured for readEvent()");
995 return(StatusCode::FAILURE);
998 for (
int i = 0;
i < maxevt || maxevt == -1; ++
i) {
1003 if (m_NumEvents == -1) {
1004 ATH_MSG_VERBOSE(
"Called read Event and read last event from input: " <<
i);
1007 ATH_MSG_ERROR(
"Unable to retrieve next event for " <<
i <<
"/" << maxevt);
1008 return(StatusCode::FAILURE);
1010 if (m_eventStreamingTool->isServer()) {
1012 while ( (
sc = putEvent_ST(*m_eventStreamingTool,
1015 pre->fragment_size_word() *
sizeof(
uint32_t),
1019 if (!
sc.isSuccess()) {
1020 ATH_MSG_ERROR(
"Cannot put Event " << m_NumEvents - 1 <<
" to AthenaSharedMemoryTool");
1021 return(StatusCode::FAILURE);
1027 while ( (
sc = putEvent_ST(*m_eventStreamingTool, 0, 0, 0, 0)).isRecoverable() ) {
1030 if (!
sc.isSuccess()) {
1031 ATH_MSG_ERROR(
"Cannot put last Event marker to AthenaSharedMemoryTool");
1032 return(StatusCode::FAILURE);
1034 return(StatusCode::SUCCESS);
◆ recordAttributeList()
StatusCode EventSelectorByteStream::recordAttributeList |
( |
| ) |
const |
|
overrideprotectedvirtual |
◆ recordAttributeListImpl()
StatusCode EventSelectorByteStream::recordAttributeListImpl |
( |
lock_t & |
lock | ) |
const |
|
private |
Definition at line 778 of file EventSelectorByteStream.cxx.
780 std::string listName(
"EventInfoAtts");
782 if (
eventStore()->contains<AthenaAttributeList>(listName)) {
785 ATH_MSG_ERROR(
"Cannot retrieve old AttributeList from StoreGate.");
786 return(StatusCode::FAILURE);
788 if (!
eventStore()->removeDataAndProxy(oldAttrList).isSuccess()) {
789 ATH_MSG_ERROR(
"Cannot remove old AttributeList from StoreGate.");
790 return(StatusCode::FAILURE);
795 auto attrList = std::make_unique<AthenaAttributeList>();
801 if (
eventStore()->record(std::move(attrList), listName).isFailure()) {
802 return StatusCode::FAILURE;
805 return StatusCode::SUCCESS;
◆ reinit()
StatusCode EventSelectorByteStream::reinit |
( |
lock_t & |
lock | ) |
|
|
private |
Reinitialize the service when a fork()
occurred/was-issued.
Definition at line 172 of file EventSelectorByteStream.cxx.
181 m_firstEvt.resize(1);
187 bool retError =
false;
190 if (!
tool->postInitialize().isSuccess()) {
198 return(StatusCode::FAILURE);
204 FileIncident firstInputFileIncident(
name(),
"FirstInputFile",
"BSF:" + *m_inputCollectionsIterator);
212 return(StatusCode::FAILURE);
218 return(StatusCode::SUCCESS);
◆ releaseContext()
StatusCode EventSelectorByteStream::releaseContext |
( |
IEvtSelector::Context *& |
it | ) |
const |
|
overridevirtual |
◆ resetCriteria()
StatusCode EventSelectorByteStream::resetCriteria |
( |
const std::string & |
criteria, |
|
|
IEvtSelector::Context & |
context |
|
) |
| const |
|
overridevirtual |
Set a selection criteria.
- Parameters
-
criteria | filter predicate (SQL-style WHERE clause) |
context | [IN] current event context. |
Definition at line 712 of file EventSelectorByteStream.cxx.
713 return(StatusCode::SUCCESS);
◆ rewind()
StatusCode EventSelectorByteStream::rewind |
( |
IEvtSelector::Context & |
it | ) |
const |
|
overridevirtual |
- Parameters
-
it | [IN/OUT] current event context is rewound to first event. |
Definition at line 706 of file EventSelectorByteStream.cxx.
708 return(StatusCode::FAILURE);
◆ seek()
StatusCode EventSelectorByteStream::seek |
( |
Context & |
, |
|
|
int |
evtnum |
|
) |
| const |
|
overridevirtual |
Seek to a given event number.
- Parameters
-
it | [IN/OUT] current event context. |
evtnum | [IN] The event number to which to seek. |
Definition at line 717 of file EventSelectorByteStream.cxx.
721 ATH_MSG_ERROR(
"Input not seekable, choose different input svc");
722 return StatusCode::FAILURE;
726 if (fileNum == -1 && evtNum >= m_firstEvt[m_fileCount] && evtNum < m_NumEvents) {
727 fileNum = m_fileCount;
732 return(StatusCode::RECOVERABLE);
735 if (fileNum != m_fileCount) {
740 m_fileCount = fileNum;
743 long nev = nevguid.first;
746 return StatusCode::FAILURE;
748 int delta = evtNum - m_firstEvt[m_fileCount];
751 if (
nextImpl(*beginIter,delta, lock).isFailure())
return StatusCode::FAILURE;
756 int delta = (evtNum - m_firstEvt[m_fileCount] + 1) -
m_eventSource->positionInBlock();
757 ATH_MSG_DEBUG(
"Seeking event " << evtNum <<
" in current file with delta " << delta);
761 else if ( delta > 0 ) {
763 if ( this->
nextImpl(*beginIter, delta, lock).isFailure() )
return StatusCode::FAILURE;
765 else if ( delta < 0 ) {
767 if ( this->
previousImpl(*beginIter, -1*delta, lock).isFailure() )
return(StatusCode::FAILURE);
770 return StatusCode::SUCCESS;
◆ share()
StatusCode EventSelectorByteStream::share |
( |
int |
evtnum | ) |
|
|
overridevirtual |
Request to share a given event number.
- Parameters
-
evtnum | [IN] The event number to share. |
Definition at line 974 of file EventSelectorByteStream.cxx.
976 if (m_eventStreamingTool.empty()) {
977 return(StatusCode::FAILURE);
979 if (m_eventStreamingTool->isClient()) {
980 StatusCode sc = m_eventStreamingTool->lockEvent(evtNum);
981 while (
sc.isRecoverable()) {
983 sc = m_eventStreamingTool->lockEvent(evtNum);
987 return(StatusCode::FAILURE);
◆ size()
int EventSelectorByteStream::size |
( |
Context & |
it | ) |
const |
|
overridevirtual |
◆ start()
StatusCode EventSelectorByteStream::start |
( |
| ) |
|
|
overridevirtual |
◆ stop()
StatusCode EventSelectorByteStream::stop |
( |
| ) |
|
|
overridevirtual |
◆ ATLAS_THREAD_SAFE [1/7]
int m_fileCount EventSelectorByteStream::ATLAS_THREAD_SAFE = 0 |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [2/7]
std::vector<int> m_numEvt EventSelectorByteStream::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [3/7]
std::vector<int> m_firstEvt EventSelectorByteStream::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [4/7]
std::vector<std::string>::const_iterator m_inputCollectionsIterator EventSelectorByteStream::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [5/7]
std::vector<long> m_skipEventSequence EventSelectorByteStream::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [6/7]
long m_NumEvents EventSelectorByteStream::ATLAS_THREAD_SAFE = 0 |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [7/7]
ToolHandle<IAthenaIPCTool> m_eventStreamingTool EventSelectorByteStream::ATLAS_THREAD_SAFE {this, "SharedMemoryTool", "", ""} |
|
mutableprivate |
◆ m_beginFileFired
bool EventSelectorByteStream::m_beginFileFired {} |
|
private |
◆ m_beginIter
◆ m_counterTool
ToolHandle<IAthenaSelectorTool> EventSelectorByteStream::m_counterTool {this, "CounterTool", "", ""} |
|
private |
◆ m_endIter
◆ m_eventSource
◆ m_eventSourceName
Gaudi::Property<std::string> EventSelectorByteStream::m_eventSourceName {this, "ByteStreamInputSvc", "", ""} |
|
private |
◆ m_eventsPerLB
Gaudi::CheckedProperty<int> EventSelectorByteStream::m_eventsPerLB {this, "EventsPerLB", 1000, ""} |
|
private |
◆ m_eventsPerRun
Gaudi::CheckedProperty<int> EventSelectorByteStream::m_eventsPerRun {this, "EventsPerRun", 1000000, ""} |
|
private |
◆ m_filebased
Gaudi::Property<bool> EventSelectorByteStream::m_filebased {this, "FileBased", true, ""} |
|
private |
◆ m_firstEventNo
Gaudi::CheckedProperty<int> EventSelectorByteStream::m_firstEventNo {this, "FirstEvent", 1, ""} |
|
private |
◆ m_firstFileFired
bool EventSelectorByteStream::m_firstFileFired {} |
|
private |
◆ m_firstLBNo
Gaudi::CheckedProperty<int> EventSelectorByteStream::m_firstLBNo {this, "FirstLB", 0, ""} |
|
private |
◆ m_helperTools
◆ m_incidentSvc
ServiceHandle<IIncidentSvc> EventSelectorByteStream::m_incidentSvc {this, "IncidentSvc", "IncidentSvc", ""} |
|
private |
◆ m_initTimeStamp
Gaudi::CheckedProperty<int> EventSelectorByteStream::m_initTimeStamp {this, "InitialTimeStamp", 0, ""} |
|
private |
◆ m_inputCollectionsProp
Gaudi::Property<std::vector<std::string> > EventSelectorByteStream::m_inputCollectionsProp {this, "Input", {}, ""} |
|
private |
◆ m_isSecondary
Gaudi::Property<bool> EventSelectorByteStream::m_isSecondary {this, "IsSecondary", false, ""} |
|
private |
◆ m_maxBadEvts
Gaudi::Property<int> EventSelectorByteStream::m_maxBadEvts {this, "MaxBadEvents", -1, ""} |
|
private |
◆ m_mutex
mutex_t EventSelectorByteStream::m_mutex |
|
mutableprivate |
◆ m_overrideRunNumber
Gaudi::Property<bool> EventSelectorByteStream::m_overrideRunNumber {this, "OverrideRunNumber", false, ""} |
|
private |
The following are included for compatibility with McEventSelector and are not really used.
However runNo, oldRunNo and overrideRunNumberFromInput are used to reset run number for simulated events, needed to use condition
Definition at line 206 of file EventSelectorByteStream.h.
◆ m_procBadEvent
Gaudi::Property<bool> EventSelectorByteStream::m_procBadEvent {this, "ProcessBadEvent", false, ""} |
|
private |
◆ m_runNo
Gaudi::CheckedProperty<int> EventSelectorByteStream::m_runNo {this, "RunNumber", 0, ""} |
|
private |
◆ m_skipEvents
Gaudi::Property<long> EventSelectorByteStream::m_skipEvents {this, "SkipEvents", 0, ""} |
|
private |
◆ m_skipEventSequenceProp
Gaudi::Property<std::vector<long> > EventSelectorByteStream::m_skipEventSequenceProp {this, "SkipEventSequence", {}, ""} |
|
private |
◆ m_timeStampInterval
Gaudi::Property<int> EventSelectorByteStream::m_timeStampInterval {this, "TimeStampInterval", 0, ""} |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
double decode(number_type binnedWeight)
Convert weight from unsigned to double.
int findEvent(int evtNum, lock_t &lock) const
Search for event with number evtNum.
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Gaudi::Property< bool > m_filebased
Gaudi::Property< long > m_skipEvents
virtual void * identifier() const
Inequality operator.
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
StatusCode nextWithSkipImpl(IEvtSelector::Context &ctxt, lock_t &lock) const
StoreGateSvc * eventStore() const
StatusCode openNewRun(lock_t &lock) const
StatusCode fillAttributeListImpl(coral::AttributeList *attrList, const std::string &suffix, bool copySource, lock_t &lock) const
#define ATH_MSG_VERBOSE(x)
Gaudi::CheckedProperty< int > m_runNo
StatusCode nextHandleFileTransitionImpl(IEvtSelector::Context &ctxt, lock_t &lock) const
Gaudi::CheckedProperty< int > m_firstLBNo
EventContextByteStream * m_beginIter
EventContextByteStream * m_endIter
virtual int size(Context &it) const override
Always returns -1.
ToolHandleArray< IAthenaSelectorTool > m_helperTools
HelperTools, vector of names of AlgTools that are executed by the EventSelector.
Gaudi::CheckedProperty< int > m_initTimeStamp
StatusCode reinit(lock_t &lock)
Reinitialize the service when a fork() occurred/was-issued.
void nextFile(lock_t &lock) const
POOL::TEvent event(POOL::TEvent::kClassAccess)
StatusCode nextImpl(Context &it, lock_t &lock) const
ToolHandle< IAthenaSelectorTool > m_counterTool
Gaudi::CheckedProperty< int > m_eventsPerRun
Gaudi::Property< bool > m_procBadEvent
process bad events, which fail check_tree().
::StatusCode StatusCode
StatusCode definition for legacy code.
void inputCollectionsHandler(Gaudi::Details::PropertyBase &)
static StoreGateSvc * currentStoreGate()
get current StoreGate
Default, invalid implementation of ClassID_traits.
Gaudi::Property< int > m_maxBadEvts
number of bad events allowed before quitting.
int m_fileCount ATLAS_THREAD_SAFE
number of files to process.
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Gaudi::CheckedProperty< int > m_firstEventNo
Gaudi::Property< bool > m_isSecondary
IsSecondary, know if this is an instance of secondary event selector.
bool allGood
Loop over the SDOs & Digits.
ServiceHandle< IIncidentSvc > m_incidentSvc
Gaudi::Property< std::string > m_eventSourceName
Gaudi::Property< std::vector< std::string > > m_inputCollectionsProp
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
StatusCode recordAttributeListImpl(lock_t &lock) const
SmartIF< IByteStreamInputSvc > m_eventSource
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
This class provides the Context for EventSelectorByteStream.
Gaudi::CheckedProperty< int > m_eventsPerLB
Gaudi::Property< std::vector< long > > m_skipEventSequenceProp
std::lock_guard< mutex_t > lock_t
StatusCode previousImpl(Context &it, lock_t &lock) const