 |
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< uint32_t > | m_runNo {this, "RunNumber", 0, ""} |
|
Gaudi::CheckedProperty< uint64_t > | m_firstEventNo {this, "FirstEvent", 1, ""} |
|
Gaudi::CheckedProperty< uint64_t > | m_eventsPerRun {this, "EventsPerRun", 1000000, ""} |
|
Gaudi::CheckedProperty< uint32_t > | m_firstLBNo {this, "FirstLB", 0, ""} |
|
Gaudi::CheckedProperty< uint32_t > | m_eventsPerLB {this, "EventsPerLB", 1000, ""} |
|
Gaudi::CheckedProperty< uint32_t > | m_initTimeStamp {this, "InitialTimeStamp", 0, ""} |
|
Gaudi::Property< uint32_t > | 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 1033 of file EventSelectorByteStream.cxx.
1037 iop =
proxy->address();
1038 return(StatusCode::SUCCESS);
1041 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 938 of file EventSelectorByteStream.cxx.
941 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 808 of file EventSelectorByteStream.cxx.
811 attrList->extend(
"RunNumber" +
suffix,
"unsigned int");
812 attrList->extend(
"EventNumber" +
suffix,
"unsigned long long");
813 attrList->extend(
"LumiBlockN" +
suffix,
"unsigned int");
814 attrList->extend(
"BunchId" +
suffix,
"unsigned int");
815 attrList->extend(
"EventTime" +
suffix,
"unsigned int");
816 attrList->extend(
"EventTimeNanoSec" +
suffix,
"unsigned int");
821 (*attrList)[
"RunNumber" +
suffix].data<
unsigned int>() =
event->run_no();
822 if (
event->version() < 0x03010000) {
823 (*attrList)[
"EventNumber" +
suffix].data<
unsigned long long>() =
event->lvl1_id();
825 (*attrList)[
"EventNumber" +
suffix].data<
unsigned long long>() =
event->global_id();
827 (*attrList)[
"LumiBlockN" +
suffix].data<
unsigned int>() =
event->lumi_block();
828 (*attrList)[
"BunchId" +
suffix].data<
unsigned int>() =
event->bc_id();
830 unsigned int bc_time_sec =
event->bc_time_seconds();
831 unsigned int bc_time_ns =
event->bc_time_nanoseconds();
833 if (bc_time_ns > 1000000000) {
835 ATH_MSG_WARNING(
" bc_time nanosecond number larger than 1e9, it is " << bc_time_ns <<
", reset it to 1 sec");
836 bc_time_ns = 1000000000;
838 (*attrList)[
"EventTime" +
suffix].data<
unsigned int>() = bc_time_sec;
839 (*attrList)[
"EventTimeNanoSec" +
suffix].data<
unsigned int>() = bc_time_ns;
844 attrList->extend(
"TriggerStatus" +
suffix,
"unsigned int");
845 (*attrList)[
"TriggerStatus" +
suffix].data<
unsigned int>() = *
buffer;
847 attrList->extend(
"ExtendedL1ID" +
suffix,
"unsigned int");
848 attrList->extend(
"L1TriggerType" +
suffix,
"unsigned int");
849 (*attrList)[
"ExtendedL1ID" +
suffix].data<
unsigned int>() =
event->lvl1_id();
850 (*attrList)[
"L1TriggerType" +
suffix].data<
unsigned int>() =
event->lvl1_trigger_type();
853 event->lvl1_trigger_info(
buffer);
854 for (
uint32_t iT1 = 0; iT1 <
event->nlvl1_trigger_info(); ++iT1) {
855 std::stringstream
name;
856 name <<
"L1TriggerInfo_" << iT1;
857 attrList->extend(
name.str() +
suffix,
"unsigned int");
863 event->lvl2_trigger_info(
buffer);
864 for (
uint32_t iT1 = 0; iT1 <
event->nlvl2_trigger_info(); ++iT1) {
866 std::stringstream
name;
867 name <<
"L2TriggerInfo_" << iT1;
868 attrList->extend(
name.str() +
suffix,
"unsigned int");
875 event->event_filter_info(
buffer);
876 for (
uint32_t iT1 = 0; iT1 <
event->nevent_filter_info(); ++iT1) {
878 std::stringstream
name;
879 name <<
"EFTriggerInfo_" << iT1;
880 attrList->extend(
name.str() +
suffix,
"unsigned int");
887 event->stream_tag(
buffer);
888 std::vector<eformat::helper::StreamTag> onl_streamTags;
890 for (std::vector<eformat::helper::StreamTag>::const_iterator itS = onl_streamTags.begin(),
891 itSE = onl_streamTags.end(); itS != itSE; ++itS) {
892 attrList->extend(itS->name +
suffix,
"string");
893 (*attrList)[itS->name +
suffix].data<std::string>() = itS->type;
896 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 900 of file EventSelectorByteStream.cxx.
909 if (m_numEvt[
i] == -1) {
912 long nev = nevguid.first;
919 m_firstEvt[
i] = m_firstEvt[
i - 1] + m_numEvt[
i - 1];
927 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 1052 of file EventSelectorByteStream.cxx.
1056 if (!iomgr.retrieve().isSuccess()) {
1058 return(StatusCode::FAILURE);
1060 if (!iomgr->io_hasitem(
this)) {
1061 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
1062 return(StatusCode::FAILURE);
1068 if (!iomgr->io_contains(
this,
fname)) {
1070 return(StatusCode::FAILURE);
1072 if (!iomgr->io_retrieve(
this,
fname).isSuccess()) {
1074 return(StatusCode::FAILURE);
1085 [] (Gaudi::Details::PropertyBase&) {}
◆ last()
StatusCode EventSelectorByteStream::last |
( |
IEvtSelector::Context & |
it | ) |
const |
|
overridevirtual |
- Parameters
-
it | [IN/OUT] current event context is interated to last event. |
Definition at line 693 of file EventSelectorByteStream.cxx.
696 return(StatusCode::SUCCESS);
698 return(StatusCode::FAILURE);
◆ makeClient()
StatusCode EventSelectorByteStream::makeClient |
( |
int |
num | ) |
|
|
overridevirtual |
Make this a client.
Definition at line 959 of file EventSelectorByteStream.cxx.
961 if (m_eventStreamingTool.empty()) {
962 return(StatusCode::FAILURE);
964 std::string dummyStr;
965 return(m_eventStreamingTool->makeClient(0, dummyStr));
◆ makeServer()
StatusCode EventSelectorByteStream::makeServer |
( |
int |
num | ) |
|
|
overridevirtual |
Make this a server.
Definition at line 950 of file EventSelectorByteStream.cxx.
952 if (m_eventStreamingTool.empty()) {
953 return(StatusCode::FAILURE);
955 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 481 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 517 of file EventSelectorByteStream.cxx.
527 ATH_MSG_DEBUG(
"Event source found no more valid files left in input list");
529 return StatusCode::FAILURE;
537 return StatusCode::FAILURE;
548 if (pre ==
nullptr) {
550 return StatusCode::FAILURE;
556 return badEvent ? StatusCode::RECOVERABLE : StatusCode::SUCCESS;
561 if (rec_sg != StatusCode::SUCCESS) {
562 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
565 return StatusCode::SUCCESS;
◆ nextImpl() [1/2]
StatusCode EventSelectorByteStream::nextImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 487 of file EventSelectorByteStream.cxx.
494 unsigned int cntr = m_NumEvents;
496 while (m_NumEvents+1 <= cntr + jump) {
498 return(StatusCode::FAILURE);
503 return(StatusCode::SUCCESS);
508 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;
392 ATH_MSG_ERROR(
"Cannot continue processing: bad event handling disabled or limit exceeded (" << nbad <<
" events)");
394 return StatusCode::FAILURE;
401 (m_skipEventSequence.empty() || m_NumEvents != m_skipEventSequence.front()) ) {
405 if (rec_sg != StatusCode::SUCCESS) {
406 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
415 if (toolStatus.isRecoverable()) {
417 status = StatusCode::RECOVERABLE;
418 }
else if (toolStatus.isFailure()) {
420 status = StatusCode::FAILURE;
423 if (
status.isRecoverable()) {
425 }
else if (
status.isFailure()) {
438 int nbad = ++n_bad_events;
439 ATH_MSG_WARNING(
"Bad fragment data encountered, current count at " << nbad);
443 ATH_MSG_ERROR(
"Cannot continue processing: bad event handling disabled or limit exceeded (" << nbad <<
" events)");
445 return StatusCode::FAILURE;
452 if (!m_skipEventSequence.empty() && m_NumEvents == m_skipEventSequence.front()) {
453 m_skipEventSequence.erase(m_skipEventSequence.begin());
455 if ( m_NumEvents % 1
'000 == 0 ) {
456 ATH_MSG_INFO("Skipping event " << m_NumEvents - 1);
458 ATH_MSG_DEBUG("Skipping event " << m_NumEvents - 1);
463 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isServer()) { // For SharedReader Server, put event into SHM
464 const RawEvent* pre = m_eventSource->currentEvent();
466 while ( (sc = putEvent_ST(*m_eventStreamingTool,
467 m_NumEvents - 1, pre->start(),
468 pre->fragment_size_word() * sizeof(uint32_t),
469 m_eventSource->currentEventStatus())).isRecoverable() ) {
472 if (!sc.isSuccess()) {
473 ATH_MSG_ERROR("Cannot put Event " << m_NumEvents - 1 << " to AthenaSharedMemoryTool");
474 return(StatusCode::FAILURE);
477 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 573 of file EventSelectorByteStream.cxx.
580 if (
sc.isRecoverable()) {
583 if (
sc.isFailure()) {
584 return StatusCode::FAILURE;
594 (m_skipEventSequence.empty() || m_NumEvents != m_skipEventSequence.front()) ) {
595 return StatusCode::SUCCESS;
597 if (!m_skipEventSequence.empty() && m_NumEvents == m_skipEventSequence.front()) {
598 m_skipEventSequence.erase(m_skipEventSequence.begin());
601 ATH_MSG_INFO(
"skipping secondary event " << m_NumEvents);
608 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 672 of file EventSelectorByteStream.cxx.
◆ previousImpl() [1/2]
StatusCode EventSelectorByteStream::previousImpl |
( |
IEvtSelector::Context & |
ctxt, |
|
|
int |
jump, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 678 of file EventSelectorByteStream.cxx.
683 for (
int i = 0;
i < jump;
i++) {
685 return(StatusCode::FAILURE);
688 return(StatusCode::SUCCESS);
690 return(StatusCode::FAILURE);
◆ previousImpl() [2/2]
StatusCode EventSelectorByteStream::previousImpl |
( |
IEvtSelector::Context & |
it, |
|
|
lock_t & |
lock |
|
) |
| const |
|
private |
Definition at line 616 of file EventSelectorByteStream.cxx.
620 bool badEvent(
false);
628 return StatusCode::FAILURE;
642 return(StatusCode::FAILURE);
646 ATH_MSG_FATAL(
"Attempt to read previous data on invalid reader");
647 return(StatusCode::FAILURE);
658 return(StatusCode::FAILURE);
665 if (rec_sg != StatusCode::SUCCESS) {
666 ATH_MSG_ERROR(
"Fail to record BS DataHeader in StoreGate. Skipping events?! " << rec_sg);
669 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 986 of file EventSelectorByteStream.cxx.
988 if (m_eventStreamingTool.empty()) {
989 ATH_MSG_ERROR(
"No AthenaSharedMemoryTool configured for readEvent()");
990 return(StatusCode::FAILURE);
993 for (
int i = 0;
i < maxevt || maxevt == -1; ++
i) {
998 if (m_NumEvents == -1) {
1002 ATH_MSG_ERROR(
"Unable to retrieve next event for " <<
i <<
"/" << maxevt);
1003 return(StatusCode::FAILURE);
1005 if (m_eventStreamingTool->isServer()) {
1007 while ( (
sc = putEvent_ST(*m_eventStreamingTool,
1010 pre->fragment_size_word() *
sizeof(
uint32_t),
1014 if (!
sc.isSuccess()) {
1015 ATH_MSG_ERROR(
"Cannot put Event " << m_NumEvents - 1 <<
" to AthenaSharedMemoryTool");
1016 return(StatusCode::FAILURE);
1022 while ( (
sc = putEvent_ST(*m_eventStreamingTool, 0, 0, 0, 0)).isRecoverable() ) {
1025 if (!
sc.isSuccess()) {
1026 ATH_MSG_ERROR(
"Cannot put last Event marker to AthenaSharedMemoryTool");
1027 return(StatusCode::FAILURE);
1029 return(StatusCode::SUCCESS);
◆ recordAttributeList()
StatusCode EventSelectorByteStream::recordAttributeList |
( |
| ) |
const |
|
overrideprotectedvirtual |
◆ recordAttributeListImpl()
StatusCode EventSelectorByteStream::recordAttributeListImpl |
( |
lock_t & |
lock | ) |
const |
|
private |
Definition at line 773 of file EventSelectorByteStream.cxx.
775 std::string listName(
"EventInfoAtts");
777 if (
eventStore()->contains<AthenaAttributeList>(listName)) {
780 ATH_MSG_ERROR(
"Cannot retrieve old AttributeList from StoreGate.");
781 return(StatusCode::FAILURE);
783 if (!
eventStore()->removeDataAndProxy(oldAttrList).isSuccess()) {
784 ATH_MSG_ERROR(
"Cannot remove old AttributeList from StoreGate.");
785 return(StatusCode::FAILURE);
790 auto attrList = std::make_unique<AthenaAttributeList>();
796 if (
eventStore()->record(std::move(attrList), listName).isFailure()) {
797 return StatusCode::FAILURE;
800 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 707 of file EventSelectorByteStream.cxx.
708 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 701 of file EventSelectorByteStream.cxx.
703 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 712 of file EventSelectorByteStream.cxx.
716 ATH_MSG_ERROR(
"Input not seekable, choose different input svc");
717 return StatusCode::FAILURE;
721 if (fileNum == -1 && evtNum >= m_firstEvt[m_fileCount] && evtNum < m_NumEvents) {
722 fileNum = m_fileCount;
727 return(StatusCode::RECOVERABLE);
730 if (fileNum != m_fileCount) {
735 m_fileCount = fileNum;
738 long nev = nevguid.first;
741 return StatusCode::FAILURE;
743 int delta = evtNum - m_firstEvt[m_fileCount];
746 if (
nextImpl(*beginIter,delta,
lock).isFailure())
return StatusCode::FAILURE;
751 int delta = (evtNum - m_firstEvt[m_fileCount] + 1) -
m_eventSource->positionInBlock();
752 ATH_MSG_DEBUG(
"Seeking event " << evtNum <<
" in current file with delta " << delta);
756 else if ( delta > 0 ) {
758 if ( this->
nextImpl(*beginIter, delta,
lock).isFailure() )
return StatusCode::FAILURE;
760 else if ( delta < 0 ) {
762 if ( this->
previousImpl(*beginIter, -1*delta,
lock).isFailure() )
return(StatusCode::FAILURE);
765 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 969 of file EventSelectorByteStream.cxx.
971 if (m_eventStreamingTool.empty()) {
972 return(StatusCode::FAILURE);
974 if (m_eventStreamingTool->isClient()) {
975 StatusCode sc = m_eventStreamingTool->lockEvent(evtNum);
976 while (
sc.isRecoverable()) {
978 sc = m_eventStreamingTool->lockEvent(evtNum);
982 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<uint32_t> EventSelectorByteStream::m_eventsPerLB {this, "EventsPerLB", 1000, ""} |
|
private |
◆ m_eventsPerRun
Gaudi::CheckedProperty<uint64_t> EventSelectorByteStream::m_eventsPerRun {this, "EventsPerRun", 1000000, ""} |
|
private |
◆ m_filebased
Gaudi::Property<bool> EventSelectorByteStream::m_filebased {this, "FileBased", true, ""} |
|
private |
◆ m_firstEventNo
Gaudi::CheckedProperty<uint64_t> EventSelectorByteStream::m_firstEventNo {this, "FirstEvent", 1, ""} |
|
private |
◆ m_firstFileFired
bool EventSelectorByteStream::m_firstFileFired {} |
|
private |
◆ m_firstLBNo
Gaudi::CheckedProperty<uint32_t> EventSelectorByteStream::m_firstLBNo {this, "FirstLB", 0, ""} |
|
private |
◆ m_helperTools
◆ m_incidentSvc
ServiceHandle<IIncidentSvc> EventSelectorByteStream::m_incidentSvc {this, "IncidentSvc", "IncidentSvc", ""} |
|
private |
◆ m_initTimeStamp
Gaudi::CheckedProperty<uint32_t> 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<uint32_t> 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<uint32_t> 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
Gaudi::CheckedProperty< uint32_t > m_firstLBNo
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)
StatusCode nextHandleFileTransitionImpl(IEvtSelector::Context &ctxt, lock_t &lock) const
EventContextByteStream * m_beginIter
Gaudi::CheckedProperty< uint64_t > m_firstEventNo
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.
StatusCode reinit(lock_t &lock)
Reinitialize the service when a fork() occurred/was-issued.
void nextFile(lock_t &lock) const
Gaudi::CheckedProperty< uint32_t > m_runNo
POOL::TEvent event(POOL::TEvent::kClassAccess)
StatusCode nextImpl(Context &it, lock_t &lock) const
ToolHandle< IAthenaSelectorTool > m_counterTool
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::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::Property< std::vector< long > > m_skipEventSequenceProp
Gaudi::CheckedProperty< uint64_t > m_eventsPerRun
Gaudi::CheckedProperty< uint32_t > m_initTimeStamp
Gaudi::CheckedProperty< uint32_t > m_eventsPerLB
std::lock_guard< mutex_t > lock_t
StatusCode previousImpl(Context &it, lock_t &lock) const