![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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 {} |
|
ByteStreamInputSvc * | 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 1044 of file EventSelectorByteStream.cxx.
1048 iop =
proxy->address();
1049 return(StatusCode::SUCCESS);
1052 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 949 of file EventSelectorByteStream.cxx.
952 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 819 of file EventSelectorByteStream.cxx.
822 attrList->extend(
"RunNumber" +
suffix,
"unsigned int");
823 attrList->extend(
"EventNumber" +
suffix,
"unsigned long long");
824 attrList->extend(
"LumiBlockN" +
suffix,
"unsigned int");
825 attrList->extend(
"BunchId" +
suffix,
"unsigned int");
826 attrList->extend(
"EventTime" +
suffix,
"unsigned int");
827 attrList->extend(
"EventTimeNanoSec" +
suffix,
"unsigned int");
832 (*attrList)[
"RunNumber" +
suffix].data<
unsigned int>() =
event->run_no();
833 if (
event->version() < 0x03010000) {
834 (*attrList)[
"EventNumber" +
suffix].data<
unsigned long long>() =
event->lvl1_id();
836 (*attrList)[
"EventNumber" +
suffix].data<
unsigned long long>() =
event->global_id();
838 (*attrList)[
"LumiBlockN" +
suffix].data<
unsigned int>() =
event->lumi_block();
839 (*attrList)[
"BunchId" +
suffix].data<
unsigned int>() =
event->bc_id();
841 unsigned int bc_time_sec =
event->bc_time_seconds();
842 unsigned int bc_time_ns =
event->bc_time_nanoseconds();
844 if (bc_time_ns > 1000000000) {
846 ATH_MSG_WARNING(
" bc_time nanosecond number larger than 1e9, it is " << bc_time_ns <<
", reset it to 1 sec");
847 bc_time_ns = 1000000000;
849 (*attrList)[
"EventTime" +
suffix].data<
unsigned int>() = bc_time_sec;
850 (*attrList)[
"EventTimeNanoSec" +
suffix].data<
unsigned int>() = bc_time_ns;
855 attrList->extend(
"TriggerStatus" +
suffix,
"unsigned int");
856 (*attrList)[
"TriggerStatus" +
suffix].data<
unsigned int>() = *
buffer;
858 attrList->extend(
"ExtendedL1ID" +
suffix,
"unsigned int");
859 attrList->extend(
"L1TriggerType" +
suffix,
"unsigned int");
860 (*attrList)[
"ExtendedL1ID" +
suffix].data<
unsigned int>() =
event->lvl1_id();
861 (*attrList)[
"L1TriggerType" +
suffix].data<
unsigned int>() =
event->lvl1_trigger_type();
864 event->lvl1_trigger_info(
buffer);
865 for (
uint32_t iT1 = 0; iT1 <
event->nlvl1_trigger_info(); ++iT1) {
866 std::stringstream
name;
867 name <<
"L1TriggerInfo_" << iT1;
868 attrList->extend(
name.str() +
suffix,
"unsigned int");
874 event->lvl2_trigger_info(
buffer);
875 for (
uint32_t iT1 = 0; iT1 <
event->nlvl2_trigger_info(); ++iT1) {
877 std::stringstream
name;
878 name <<
"L2TriggerInfo_" << iT1;
879 attrList->extend(
name.str() +
suffix,
"unsigned int");
886 event->event_filter_info(
buffer);
887 for (
uint32_t iT1 = 0; iT1 <
event->nevent_filter_info(); ++iT1) {
889 std::stringstream
name;
890 name <<
"EFTriggerInfo_" << iT1;
891 attrList->extend(
name.str() +
suffix,
"unsigned int");
898 event->stream_tag(
buffer);
899 std::vector<eformat::helper::StreamTag> onl_streamTags;
901 for (std::vector<eformat::helper::StreamTag>::const_iterator itS = onl_streamTags.begin(),
902 itSE = onl_streamTags.end(); itS != itSE; ++itS) {
903 attrList->extend(itS->name +
suffix,
"string");
904 (*attrList)[itS->name +
suffix].data<std::string>() = itS->type;
907 return StatusCode::SUCCESS;
◆ finalize()
StatusCode EventSelectorByteStream::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 255 of file EventSelectorByteStream.cxx.
262 if (!
tool->preFinalize().isSuccess()) {
269 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 911 of file EventSelectorByteStream.cxx.
920 if (m_numEvt[
i] == -1) {
923 long nev = nevguid.first;
930 m_firstEvt[
i] = m_firstEvt[
i - 1] + m_numEvt[
i - 1];
938 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 85 of file EventSelectorByteStream.cxx.
87 m_autoRetrieveTools =
false;
88 m_checkToolDeps =
false;
98 return(StatusCode::FAILURE);
104 return(StatusCode::FAILURE);
107 std::sort(m_skipEventSequence.begin(), m_skipEventSequence.end());
113 return(StatusCode::FAILURE);
118 return(StatusCode::FAILURE);
125 return(StatusCode::FAILURE);
132 return(StatusCode::FAILURE);
136 if (!m_eventStreamingTool.empty() && !m_eventStreamingTool.retrieve().isSuccess()) {
138 return(StatusCode::FAILURE);
143 if (!iomgr.retrieve().isSuccess()) {
145 return(StatusCode::FAILURE);
147 if (!iomgr->io_register(
this).isSuccess()) {
148 ATH_MSG_FATAL(
"Cannot register myself with the IoComponentMgr.");
149 return(StatusCode::FAILURE);
164 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 1083 of file EventSelectorByteStream.cxx.
1087 if (!iomgr.retrieve().isSuccess()) {
1089 return(StatusCode::FAILURE);
1091 if (!iomgr->io_hasitem(
this)) {
1092 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
1093 return(StatusCode::FAILURE);
1099 if (!iomgr->io_contains(
this,
fname)) {
1101 return(StatusCode::FAILURE);
1103 if (!iomgr->io_retrieve(
this,
fname).isSuccess()) {
1105 return(StatusCode::FAILURE);
1116 [] (Gaudi::Details::PropertyBase&) {}
1121 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 704 of file EventSelectorByteStream.cxx.
707 return(StatusCode::SUCCESS);
709 return(StatusCode::FAILURE);
◆ makeClient()
StatusCode EventSelectorByteStream::makeClient |
( |
int |
num | ) |
|
|
overridevirtual |
Make this a client.
Definition at line 970 of file EventSelectorByteStream.cxx.
972 if (m_eventStreamingTool.empty()) {
973 return(StatusCode::FAILURE);
975 std::string dummyStr;
976 return(m_eventStreamingTool->makeClient(0, dummyStr));
◆ makeServer()
StatusCode EventSelectorByteStream::makeServer |
( |
int |
num | ) |
|
|
overridevirtual |
Make this a server.
Definition at line 961 of file EventSelectorByteStream.cxx.
963 if (m_eventStreamingTool.empty()) {
964 return(StatusCode::FAILURE);
966 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 492 of file EventSelectorByteStream.cxx.
◆ nextFile()
void EventSelectorByteStream::nextFile |
( |
lock_t & |
lock | ) |
const |
|
private |
Definition at line 287 of file EventSelectorByteStream.cxx.
288 FileIncident endInputFileIncident(
name(),
"EndInputFile",
"BSF:" + *m_inputCollectionsIterator);
290 ++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 528 of file EventSelectorByteStream.cxx.
538 ATH_MSG_DEBUG(
"Event source found no more valid files left in input list");
540 return StatusCode::FAILURE;
548 return StatusCode::FAILURE;
559 if (pre ==
nullptr) {
561 return StatusCode::FAILURE;
567 return badEvent ? StatusCode::RECOVERABLE : StatusCode::SUCCESS;
572 if (rec_sg != StatusCode::SUCCESS) {
573 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
576 return StatusCode::SUCCESS;
◆ nextImpl() [1/2]
StatusCode EventSelectorByteStream::nextImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 498 of file EventSelectorByteStream.cxx.
505 unsigned int cntr = m_NumEvents;
507 while (m_NumEvents+1 <= cntr + jump) {
508 if (!
nextImpl(ctxt, lock).isSuccess()) {
509 return(StatusCode::FAILURE);
514 return(StatusCode::SUCCESS);
519 return(StatusCode::SUCCESS);
◆ nextImpl() [2/2]
StatusCode EventSelectorByteStream::nextImpl |
( |
IEvtSelector::Context & |
it, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 353 of file EventSelectorByteStream.cxx.
356 static std::atomic<int> n_bad_events = 0;
358 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
361 if (!m_eventStreamingTool->getLockedEvent(&source,
status).isSuccess()) {
362 ATH_MSG_FATAL(
"Cannot get NextEvent from AthenaSharedMemoryTool");
363 return(StatusCode::FAILURE);
366 return(StatusCode::SUCCESS);
370 if (!
tool->preNext().isSuccess()) {
383 if (
sc.isRecoverable()) {
385 }
else if (
sc.isFailure()) {
386 return StatusCode::FAILURE;
394 int nbad = ++n_bad_events;
395 ATH_MSG_INFO(
"Bad event encountered, current count at " << nbad);
401 return(StatusCode::FAILURE);
408 (m_skipEventSequence.empty() || m_NumEvents != m_skipEventSequence.front()) ) {
412 if (rec_sg != StatusCode::SUCCESS) {
413 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
422 if (toolStatus.isRecoverable()) {
424 status = StatusCode::RECOVERABLE;
425 }
else if (toolStatus.isFailure()) {
427 status = StatusCode::FAILURE;
430 if (
status.isRecoverable()) {
432 }
else if (
status.isFailure()) {
450 int nbad = ++n_bad_events;
451 ATH_MSG_INFO(
"Bad event encountered, current count at " << nbad);
458 return(StatusCode::FAILURE);
463 if (!m_skipEventSequence.empty() && m_NumEvents == m_skipEventSequence.front()) {
464 m_skipEventSequence.erase(m_skipEventSequence.begin());
466 if ( m_NumEvents % 1
'000 == 0 ) {
467 ATH_MSG_INFO("Skipping event " << m_NumEvents - 1);
469 ATH_MSG_DEBUG("Skipping event " << m_NumEvents - 1);
474 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isServer()) { // For SharedReader Server, put event into SHM
475 const RawEvent* pre = m_eventSource->currentEvent();
477 while ( (sc = putEvent_ST(*m_eventStreamingTool,
478 m_NumEvents - 1, pre->start(),
479 pre->fragment_size_word() * sizeof(uint32_t),
480 m_eventSource->currentEventStatus())).isRecoverable() ) {
483 if (!sc.isSuccess()) {
484 ATH_MSG_ERROR("Cannot put Event " << m_NumEvents - 1 << " to AthenaSharedMemoryTool");
485 return(StatusCode::FAILURE);
488 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 584 of file EventSelectorByteStream.cxx.
591 if (
sc.isRecoverable()) {
594 if (
sc.isFailure()) {
595 return StatusCode::FAILURE;
605 (m_skipEventSequence.empty() || m_NumEvents != m_skipEventSequence.front()) ) {
606 return StatusCode::SUCCESS;
608 if (!m_skipEventSequence.empty() && m_NumEvents == m_skipEventSequence.front()) {
609 m_skipEventSequence.erase(m_skipEventSequence.begin());
612 ATH_MSG_INFO(
"skipping secondary event " << m_NumEvents);
619 return StatusCode::SUCCESS;
◆ openNewRun()
StatusCode EventSelectorByteStream::openNewRun |
( |
lock_t & |
lock | ) |
const |
|
private |
Definition at line 294 of file EventSelectorByteStream.cxx.
297 ATH_MSG_ERROR(
"cannot open new run for non-filebased inputs");
298 return(StatusCode::FAILURE);
303 return(StatusCode::FAILURE);
305 std::string
blockname = *m_inputCollectionsIterator;
309 long nev = nevguid.first;
311 ATH_MSG_FATAL(
"Unable to access file " << *m_inputCollectionsIterator <<
", stopping here");
316 FileIncident beginInputFileIncident(
name(),
"BeginInputFile",
"BSF:" + *m_inputCollectionsIterator,nevguid.second);
329 ATH_MSG_WARNING(
"skipping more events " <<
m_skipEvents.value() - m_NumEvents <<
"(" << nev <<
") than in file " << *m_inputCollectionsIterator <<
", try next");
331 m_numEvt[m_fileCount] = nev;
338 m_firstEvt[m_fileCount] = m_NumEvents;
339 m_numEvt[m_fileCount] = nev;
341 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 683 of file EventSelectorByteStream.cxx.
◆ previousImpl() [1/2]
StatusCode EventSelectorByteStream::previousImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 689 of file EventSelectorByteStream.cxx.
694 for (
int i = 0;
i < jump;
i++) {
696 return(StatusCode::FAILURE);
699 return(StatusCode::SUCCESS);
701 return(StatusCode::FAILURE);
◆ previousImpl() [2/2]
StatusCode EventSelectorByteStream::previousImpl |
( |
IEvtSelector::Context & |
it, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 627 of file EventSelectorByteStream.cxx.
631 bool badEvent(
false);
639 return StatusCode::FAILURE;
653 return(StatusCode::FAILURE);
657 ATH_MSG_FATAL(
"Attempt to read previous data on invalid reader");
658 return(StatusCode::FAILURE);
669 return(StatusCode::FAILURE);
676 if (rec_sg != StatusCode::SUCCESS) {
677 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
680 return StatusCode::SUCCESS;
◆ queryInterface()
StatusCode EventSelectorByteStream::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvInterface |
|
) |
| |
|
overridevirtual |
Definition at line 1063 of file EventSelectorByteStream.cxx.
1064 if (riid == IEvtSelector::interfaceID()) {
1065 *ppvInterface =
dynamic_cast<IEvtSelector*
>(
this);
1066 }
else if (riid == IIoComponent::interfaceID()) {
1067 *ppvInterface =
dynamic_cast<IIoComponent*
>(
this);
1068 }
else if (riid == IProperty::interfaceID()) {
1069 *ppvInterface =
dynamic_cast<IProperty*
>(
this);
1070 }
else if (riid == IEvtSelectorSeek::interfaceID()) {
1074 }
else if (riid == ISecondaryEventSelector::interfaceID()) {
1077 return(Service::queryInterface(riid, ppvInterface));
1080 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 997 of file EventSelectorByteStream.cxx.
999 if (m_eventStreamingTool.empty()) {
1000 ATH_MSG_ERROR(
"No AthenaSharedMemoryTool configured for readEvent()");
1001 return(StatusCode::FAILURE);
1004 for (
int i = 0;
i < maxevt || maxevt == -1; ++
i) {
1009 if (m_NumEvents == -1) {
1010 ATH_MSG_VERBOSE(
"Called read Event and read last event from input: " <<
i);
1013 ATH_MSG_ERROR(
"Unable to retrieve next event for " <<
i <<
"/" << maxevt);
1014 return(StatusCode::FAILURE);
1016 if (m_eventStreamingTool->isServer()) {
1018 while ( (
sc = putEvent_ST(*m_eventStreamingTool,
1021 pre->fragment_size_word() *
sizeof(
uint32_t),
1025 if (!
sc.isSuccess()) {
1026 ATH_MSG_ERROR(
"Cannot put Event " << m_NumEvents - 1 <<
" to AthenaSharedMemoryTool");
1027 return(StatusCode::FAILURE);
1033 while ( (
sc = putEvent_ST(*m_eventStreamingTool, 0, 0, 0, 0)).isRecoverable() ) {
1036 if (!
sc.isSuccess()) {
1037 ATH_MSG_ERROR(
"Cannot put last Event marker to AthenaSharedMemoryTool");
1038 return(StatusCode::FAILURE);
1040 return(StatusCode::SUCCESS);
◆ recordAttributeList()
StatusCode EventSelectorByteStream::recordAttributeList |
( |
| ) |
const |
|
overrideprotectedvirtual |
◆ recordAttributeListImpl()
StatusCode EventSelectorByteStream::recordAttributeListImpl |
( |
lock_t & |
lock | ) |
const |
|
private |
Definition at line 784 of file EventSelectorByteStream.cxx.
786 std::string listName(
"EventInfoAtts");
788 if (
eventStore()->contains<AthenaAttributeList>(listName)) {
791 ATH_MSG_ERROR(
"Cannot retrieve old AttributeList from StoreGate.");
792 return(StatusCode::FAILURE);
794 if (!
eventStore()->removeDataAndProxy(oldAttrList).isSuccess()) {
795 ATH_MSG_ERROR(
"Cannot remove old AttributeList from StoreGate.");
796 return(StatusCode::FAILURE);
801 auto attrList = std::make_unique<AthenaAttributeList>();
807 if (
eventStore()->record(std::move(attrList), listName).isFailure()) {
808 return StatusCode::FAILURE;
811 return StatusCode::SUCCESS;
◆ reinit()
StatusCode EventSelectorByteStream::reinit |
( |
lock_t & |
lock | ) |
|
|
private |
Reinitialize the service when a fork()
occurred/was-issued.
Definition at line 178 of file EventSelectorByteStream.cxx.
187 m_firstEvt.resize(1);
193 bool retError =
false;
196 if (!
tool->postInitialize().isSuccess()) {
204 return(StatusCode::FAILURE);
210 FileIncident firstInputFileIncident(
name(),
"FirstInputFile",
"BSF:" + *m_inputCollectionsIterator);
218 return(StatusCode::FAILURE);
224 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 718 of file EventSelectorByteStream.cxx.
719 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 712 of file EventSelectorByteStream.cxx.
714 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 723 of file EventSelectorByteStream.cxx.
727 ATH_MSG_ERROR(
"Input not seekable, choose different input svc");
728 return StatusCode::FAILURE;
732 if (fileNum == -1 && evtNum >= m_firstEvt[m_fileCount] && evtNum < m_NumEvents) {
733 fileNum = m_fileCount;
738 return(StatusCode::RECOVERABLE);
741 if (fileNum != m_fileCount) {
746 m_fileCount = fileNum;
749 long nev = nevguid.first;
752 return StatusCode::FAILURE;
754 int delta = evtNum - m_firstEvt[m_fileCount];
757 if (
nextImpl(*beginIter,delta, lock).isFailure())
return StatusCode::FAILURE;
763 ATH_MSG_DEBUG(
"Seeking event " << evtNum <<
" in current file with delta " << delta);
767 else if ( delta > 0 ) {
769 if ( this->
nextImpl(*beginIter, delta, lock).isFailure() )
return StatusCode::FAILURE;
771 else if ( delta < 0 ) {
773 if ( this->
previousImpl(*beginIter, -1*delta, lock).isFailure() )
return(StatusCode::FAILURE);
776 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 980 of file EventSelectorByteStream.cxx.
982 if (m_eventStreamingTool.empty()) {
983 return(StatusCode::FAILURE);
985 if (m_eventStreamingTool->isClient()) {
986 StatusCode sc = m_eventStreamingTool->lockEvent(evtNum);
987 while (
sc.isRecoverable()) {
989 sc = m_eventStreamingTool->lockEvent(evtNum);
993 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 209 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)
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
ByteStreamInputSvc * m_eventSource
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
Abstract interface for sharing within an event stream.
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.
static const InterfaceID & interfaceID()
void inputCollectionsHandler(Gaudi::Details::PropertyBase &)
Abstract interface for secondary event selectors.
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...
AthROOTErrorHandlerSvc * svc
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
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
Abstract interface for seeking for an event selector.