24#include "GaudiKernel/ClassID.h"
25#include "GaudiKernel/FileIncident.h"
26#include "GaudiKernel/IIncidentSvc.h"
27#include "GaudiKernel/IIoComponentMgr.h"
28#include "GaudiKernel/GaudiException.h"
29#include "GaudiKernel/GenericAddress.h"
30#include "GaudiKernel/StatusCode.h"
38#include <boost/tokenizer.hpp>
47 long eventNumber,
const void* source,
48 size_t nbytes,
unsigned int status) {
57 base_class(name, pSvcLocator)
70 m_inputCollectionsChanged =
false;
74 if (this->FSMState() != Gaudi::StateMachine::OFFLINE) {
75 m_inputCollectionsChanged =
true;
88 m_autoRetrieveTools =
false;
89 m_checkToolDeps =
false;
92 ATH_MSG_DEBUG(
"Initializing secondary event selector " << name());
100 ATH_MSG_FATAL(
"Use the property: EventSelector.InputCollections = "
101 <<
"[ \"<collectionName>\" ] (list of collections)");
102 return StatusCode::FAILURE;
104 boost::char_separator<char> sep_coma(
","), sep_hyph(
"-");
106 for(
const std::string&
r: ranges ) {
107 boost::tokenizer fromto(
r, sep_hyph);
108 auto from_iter = fromto.begin();
109 long from = std::stol(*from_iter);
111 if( ++from_iter != fromto.end() ) {
112 to = std::stol(*from_iter);
114 m_skipEventRanges.emplace_back(from, to);
118 m_skipEventRanges.emplace_back(v, v);
120 std::sort(m_skipEventRanges.begin(), m_skipEventRanges.end());
121 if( msgLvl(MSG::DEBUG) ) {
122 std::string skip_ranges_str;
123 for(
const auto& [first, second] : m_skipEventRanges ) {
124 if( !skip_ranges_str.empty() ) skip_ranges_str +=
", ";
125 skip_ranges_str += std::to_string(first);
126 if( first != second) skip_ranges_str += std::format(
"-{}", second);
128 if( !skip_ranges_str.empty() )
135 m_incidentSvc->addListener(
this, IncidentType::BeginProcessing, 0);
136 m_incidentSvc->addListener(
this, IncidentType::EndProcessing, 0);
150 return StatusCode::FAILURE;
152 std::string dummyStr;
158 std::vector<std::string> propVal;
160 bool foundCnvSvc =
false;
161 for (
const auto& property : propVal) {
166 if (!epSvc->setProperty(
"CnvServices", Gaudi::Utils::toString(propVal)).isSuccess()) {
167 ATH_MSG_FATAL(
"Cannot set EventPersistencySvc Property for CnvServices");
168 return StatusCode::FAILURE;
179 std::string fileName;
180 std::string fileType;
181 for (
const auto& inputCollection : incol) {
182 if (inputCollection.starts_with(
"LFN:") || inputCollection.starts_with(
"FID:")) {
185 fileName = inputCollection;
187 if (fileName.starts_with(
"PFN:")) {
188 fileName = fileName.substr(4);
190 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::READ, inputCollection, fileName).isSuccess()) {
191 ATH_MSG_FATAL(
"could not register [" << inputCollection <<
"] for output !");
194 ATH_MSG_VERBOSE(
"io_register[" << this->name() <<
"](" << inputCollection <<
") [ok]");
198 return StatusCode::FAILURE;
204 return StatusCode::FAILURE;
221 if (!m_firstEvt.empty()) {
224 m_inputCollectionsChanged =
false;
226 m_headerIterator = 0;
228 ATH_MSG_INFO(
"Done reinitialization for shared reader client");
229 return StatusCode::SUCCESS;
231 bool retError =
false;
232 for (
auto& tool : m_helperTools) {
233 if (!tool->postInitialize().isSuccess()) {
234 ATH_MSG_FATAL(
"Failed to postInitialize() " << tool->name());
240 return StatusCode::FAILURE;
245 if (!m_poolCollectionConverter) {
246 ATH_MSG_INFO(
"No Events found in any Input Collections");
252 FileIncident firstInputFileIncident(name(),
"FirstInputFile", *m_inputCollectionsIterator);
257 return StatusCode::SUCCESS;
261 m_headerIterator = &m_poolCollectionConverter->selectAll();
262 }
catch (std::exception &e) {
263 ATH_MSG_FATAL(
"Cannot open implicit collection - check data/software version.");
265 return StatusCode::FAILURE;
267 while (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
268 if (m_poolCollectionConverter) {
269 m_poolCollectionConverter->disconnectDb().ignore();
270 m_poolCollectionConverter.reset();
272 ++m_inputCollectionsIterator;
274 if (m_poolCollectionConverter) {
275 m_headerIterator = &m_poolCollectionConverter->selectAll();
280 if (!m_poolCollectionConverter || m_headerIterator ==
nullptr) {
284 if (!m_poolCollectionConverter) {
285 return StatusCode::SUCCESS;
287 m_headerIterator = &m_poolCollectionConverter->selectAll();
288 while (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
289 if (m_poolCollectionConverter) {
290 m_poolCollectionConverter->disconnectDb().ignore();
291 m_poolCollectionConverter.reset();
293 ++m_inputCollectionsIterator;
295 if (m_poolCollectionConverter) {
296 m_headerIterator = &m_poolCollectionConverter->selectAll();
302 if (!m_poolCollectionConverter || m_headerIterator ==
nullptr) {
303 return StatusCode::SUCCESS;
305 const Token& headRef = m_headerIterator->eventRef();
312 FileIncident firstInputFileIncident(name(),
"FirstInputFile",
"FID:" + fid, fid);
316 return StatusCode::SUCCESS;
320 if (m_poolCollectionConverter) {
322 m_poolCollectionConverter->disconnectDb().ignore();
323 m_poolCollectionConverter.reset();
328 return StatusCode::SUCCESS;
331 if (!m_poolCollectionConverter) {
332 ATH_MSG_INFO(
"No Events found in any Input Collections");
335 --m_inputCollectionsIterator;
338 m_headerIterator = &m_poolCollectionConverter->selectAll();
344 return StatusCode::SUCCESS;
349 return StatusCode::SUCCESS;
351 IEvtSelector::Context* ctxt(
nullptr);
355 return StatusCode::SUCCESS;
365 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
381 for (
auto& tool : m_helperTools) {
382 if (!tool->preFinalize().isSuccess()) {
388 m_headerIterator =
nullptr;
389 if (m_poolCollectionConverter) {
390 m_poolCollectionConverter.reset();
393 return ::AthService::finalize();
399 return StatusCode::SUCCESS;
403 std::lock_guard<CallMutex> lockGuard(
m_callLock);
407 while (
sc.isRecoverable()) {
414 void* tokenStr =
nullptr;
415 unsigned int status = 0;
417 if (
sc.isRecoverable()) {
418 delete [] (
char*)tokenStr; tokenStr =
nullptr;
422 return StatusCode::FAILURE;
424 if (
sc.isFailure()) {
425 ATH_MSG_FATAL(
"Cannot get NextEvent from AthenaSharedMemoryTool");
426 delete [] (
char*)tokenStr; tokenStr =
nullptr;
427 return StatusCode::FAILURE;
429 if (!
eventStore()->clearStore().isSuccess()) {
433 athAttrList->extend(
"eventRef",
"string");
434 (*athAttrList)[
"eventRef"].data<std::string>() = std::string((
char*)tokenStr);
436 if (!wh.record(std::move(athAttrList)).isSuccess()) {
437 delete [] (
char*)tokenStr; tokenStr =
nullptr;
439 return StatusCode::FAILURE;
442 token.
fromString(std::string((
char*)tokenStr));
443 delete [] (
char*)tokenStr; tokenStr =
nullptr;
448 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
452 FileIncident beginInputFileIncident(name(),
"BeginInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
455 return StatusCode::SUCCESS;
457 for (
const auto& tool : m_helperTools) {
458 if (!tool->preNext().isSuccess()) {
465 if (
sc.isRecoverable()) {
468 if (
sc.isFailure()) {
469 return StatusCode::FAILURE;
477 && (m_skipEventRanges.empty() ||
m_evtCount < m_skipEventRanges.front().first))
483 return StatusCode::FAILURE;
485 std::string token = m_headerIterator->eventRef().toString();
489 token.length() + 1, 0)).isRecoverable() ) {
490 while (ds->readData().isSuccess()) {
491 ATH_MSG_VERBOSE(
"Called last readData, while putting next event in next()");
495 if (!
sc.isSuccess()) {
497 return StatusCode::FAILURE;
501 if (!
eventStore()->clearStore().isSuccess()) {
506 return StatusCode::FAILURE;
510 StatusCode status = StatusCode::SUCCESS;
511 for (
const auto& tool : m_helperTools) {
512 StatusCode toolStatus = tool->postNext();
513 if (toolStatus.isRecoverable()) {
514 ATH_MSG_INFO(
"Request skipping event from: " << tool->name());
515 if (status.isSuccess()) {
516 status = StatusCode::RECOVERABLE;
518 }
else if (toolStatus.isFailure()) {
520 status = StatusCode::FAILURE;
523 if (status.isRecoverable()) {
525 }
else if (status.isFailure()) {
534 while( !m_skipEventRanges.empty() &&
m_evtCount >= m_skipEventRanges.front().second ) {
535 m_skipEventRanges.erase(m_skipEventRanges.begin());
540 return StatusCode::SUCCESS;
545 for (
int i = 0; i < jump; i++) {
548 return StatusCode::SUCCESS;
550 return StatusCode::FAILURE;
555 if( m_inputCollectionsChanged ) {
557 if(
rc != StatusCode::SUCCESS )
return rc;
561 if (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
562 m_headerIterator =
nullptr;
564 m_poolCollectionConverter.reset();
572 if( m_inputCollectionsChanged ) {
574 if(
rc != StatusCode::SUCCESS )
return rc;
577 ++m_inputCollectionsIterator;
580 if (!m_poolCollectionConverter) {
584 return StatusCode::FAILURE;
587 m_headerIterator = &m_poolCollectionConverter->selectAll();
590 return StatusCode::RECOVERABLE;
594 const Token& headRef = m_headerIterator->eventRef();
599 if (guid != m_guid) {
608 m_activeEventsPerSource[guid.toString()] = 0;
613 if (!
m_athenaPoolCnvSvc->setInputAttributes(*m_inputCollectionsIterator).isSuccess()) {
615 return StatusCode::FAILURE;
618 FileIncident beginInputFileIncident(name(),
"BeginInputFile", *m_inputCollectionsIterator, m_guid.toString());
624 FileIncident beginInputFileIncident(name(),
"BeginInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
629 return StatusCode::SUCCESS;
638 if (
sc.isRecoverable()) {
641 if (
sc.isFailure()) {
642 return StatusCode::FAILURE;
652 && (m_skipEventRanges.empty() ||
m_evtCount < m_skipEventRanges.front().first))
654 return StatusCode::SUCCESS;
656 while( !m_skipEventRanges.empty() &&
m_evtCount >= m_skipEventRanges.front().second ) {
657 m_skipEventRanges.erase(m_skipEventRanges.begin());
667 return StatusCode::SUCCESS;
672 return StatusCode::FAILURE;
677 for (
int i = 0; i < jump; i++) {
680 return StatusCode::SUCCESS;
682 return StatusCode::FAILURE;
686 if (ctxt.identifier() ==
m_endIter->identifier()) {
688 return StatusCode::SUCCESS;
690 return StatusCode::FAILURE;
696 return StatusCode::SUCCESS;
700 IOpaqueAddress*& iop)
const {
701 std::string tokenStr;
705 tokenStr = (*attrList)[
"eventRef"].data<std::string>();
706 ATH_MSG_DEBUG(
"found AthenaAttribute, name = eventRef = " << tokenStr);
707 }
catch (std::exception &e) {
709 return StatusCode::FAILURE;
713 tokenStr = m_headerIterator->eventRef().toString();
715 auto token = std::make_unique<Token>();
716 token->fromString(tokenStr);
718 return StatusCode::SUCCESS;
722 return StatusCode::SUCCESS;
726 IEvtSelector::Context& )
const {
727 return StatusCode::SUCCESS;
732 if( m_inputCollectionsChanged ) {
734 if(
rc != StatusCode::SUCCESS )
return rc;
742 m_headerIterator =
nullptr;
745 return StatusCode::RECOVERABLE;
749 m_poolCollectionConverter->disconnectDb().ignore();
751 m_poolCollectionConverter.reset();
756 <<
"\" from the collection list.");
760 m_poolCollectionConverter = std::make_unique<PoolCollectionConverter>(
m_collectionType.value(),
764 if (!m_poolCollectionConverter->initialize().isSuccess()) {
765 m_headerIterator =
nullptr;
766 ATH_MSG_ERROR(
"seek: Unable to initialize PoolCollectionConverter.");
767 return StatusCode::FAILURE;
770 m_headerIterator = &m_poolCollectionConverter->selectAll();
773 next(*beginIter).ignore();
774 ATH_MSG_DEBUG(
"Token " << m_headerIterator->eventRef().toString());
775 }
catch (std::exception &e) {
776 m_headerIterator =
nullptr;
778 return StatusCode::FAILURE;
782 if (m_headerIterator->seek(evtNum - m_firstEvt[
m_curCollection]) == 0) {
783 m_headerIterator =
nullptr;
785 return StatusCode::FAILURE;
789 return StatusCode::SUCCESS;
801 for (std::size_t i = 0,
imax = m_numEvt.size(); i <
imax; i++) {
802 if (m_numEvt[i] == -1) {
810 int collection_size = 0;
813 collection_size = hi->
size();
816 m_firstEvt[i] = m_firstEvt[i - 1] + m_numEvt[i - 1];
820 m_numEvt[i] = collection_size;
822 if (evtNum >= m_firstEvt[i] && evtNum < m_firstEvt[i] + m_numEvt[i]) {
834 return StatusCode::FAILURE;
837 if (ds->makeServer(num - 1).isFailure()) {
838 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to output DataStreaming server");
840 return StatusCode::SUCCESS;
842 if (ds->makeServer(num + 1).isFailure()) {
843 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to input DataStreaming server");
844 return StatusCode::FAILURE;
847 return StatusCode::SUCCESS;
859 return StatusCode::FAILURE;
861 if (ds->makeClient(num + 1).isFailure()) {
862 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to DataStreaming client");
863 return StatusCode::FAILURE;
866 return StatusCode::SUCCESS;
869 std::string dummyStr;
878 return StatusCode::FAILURE;
882 while (
sc.isRecoverable()) {
887 if (
sc.isFailure()) {
888 if (ds->makeClient(0).isFailure()) {
889 return StatusCode::FAILURE;
892 while (
sc.isRecoverable() ||
sc.isFailure()) {
897 if (ds->makeClient(1).isFailure()) {
898 return StatusCode::FAILURE;
903 return StatusCode::FAILURE;
911 return StatusCode::FAILURE;
914 ATH_MSG_ERROR(
"No AthenaSharedMemoryTool configured for readEvent()");
915 return StatusCode::FAILURE;
919 for (
int i = 0; i < maxevt || maxevt == -1; ++i) {
920 if (!
next(*ctxt).isSuccess()) {
922 ATH_MSG_VERBOSE(
"Called read Event and read last event from input: " << i);
926 delete ctxt; ctxt =
nullptr;
927 return StatusCode::FAILURE;
932 delete ctxt; ctxt =
nullptr;
936 while (ds->readData().isSuccess()) {
937 ATH_MSG_VERBOSE(
"Called last readData, while marking last event in readEvent()");
941 if (!
sc.isSuccess()) {
942 ATH_MSG_ERROR(
"Cannot put last Event marker to AthenaSharedMemoryTool");
943 return StatusCode::FAILURE;
946 while (
sc.isSuccess() ||
sc.isRecoverable()) {
949 ATH_MSG_DEBUG(
"Failed last readData -> Clients are stopped, after marking last event in readEvent()");
951 return StatusCode::SUCCESS;
958 return std::accumulate(m_numEvt.begin(), m_numEvt.end(), 0);
961std::unique_ptr<PoolCollectionConverter>
969 ATH_MSG_DEBUG(
"Try item: \"" << *m_inputCollectionsIterator <<
"\" from the collection list.");
970 auto pCollCnv = std::make_unique<PoolCollectionConverter>(
m_collectionType.value(),
971 *m_inputCollectionsIterator,
974 StatusCode status = pCollCnv->initialize();
975 if (!status.isSuccess()) {
978 if (!status.isRecoverable()) {
979 ATH_MSG_ERROR(
"Unable to initialize PoolCollectionConverter.");
980 throw GaudiException(
"Unable to read: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
982 ATH_MSG_ERROR(
"Unable to open: " << *m_inputCollectionsIterator);
983 throw GaudiException(
"Unable to open: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
986 if (!pCollCnv->isValid().isSuccess()) {
988 ATH_MSG_DEBUG(
"No events found in: " << *m_inputCollectionsIterator <<
" skipped!!!");
990 FileIncident beginInputFileIncident(name(),
"BeginInputFile", *m_inputCollectionsIterator);
992 FileIncident endInputFileIncident(name(),
"EndInputFile",
"eventless " + *m_inputCollectionsIterator);
996 ++m_inputCollectionsIterator;
1009 const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
1016 ATH_CHECK(wh.record(std::move(athAttrList)));
1017 return StatusCode::SUCCESS;
1022 const auto& row = m_headerIterator->currentRow();
1023 attrList->extend( row.tokenName() + suffix,
"string" );
1024 (*attrList)[ row.tokenName() + suffix ].data<std::string>() = row.token().toString();
1025 ATH_MSG_DEBUG(
"record AthenaAttribute, name = " << row.tokenName() + suffix <<
" = " << row.token().toString() <<
".");
1027 std::string eventRef =
"eventRef";
1029 eventRef.append(suffix);
1031 attrList->extend(eventRef,
"string");
1032 (*attrList)[eventRef].data<std::string>() = m_headerIterator->eventRef().toString();
1033 ATH_MSG_DEBUG(
"record AthenaAttribute, name = " + eventRef +
" = " << m_headerIterator->eventRef().toString() <<
".");
1036 const coral::AttributeList& sourceAttrList = m_headerIterator->currentRow().attributeList();
1037 for (
const auto &attr : sourceAttrList) {
1038 attrList->extend(attr.specification().name() + suffix, attr.specification().type());
1039 (*attrList)[attr.specification().name() + suffix] = attr;
1043 return StatusCode::SUCCESS;
1048 if (m_poolCollectionConverter) {
1049 m_poolCollectionConverter->disconnectDb().ignore();
1050 m_poolCollectionConverter.reset();
1052 m_headerIterator =
nullptr;
1054 if (!iomgr.retrieve().isSuccess()) {
1056 return StatusCode::FAILURE;
1058 if (!iomgr->io_hasitem(
this)) {
1059 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
1060 return StatusCode::FAILURE;
1067 std::set<std::size_t> updatedIndexes;
1069 if (updatedIndexes.find(i) != updatedIndexes.end())
continue;
1070 std::string savedName = inputCollections[i];
1071 std::string &fname = inputCollections[i];
1072 if (!iomgr->io_contains(
this, fname)) {
1073 ATH_MSG_ERROR(
"IoComponentMgr does not know about [" << fname <<
"] !");
1074 return StatusCode::FAILURE;
1076 if (!iomgr->io_retrieve(
this, fname).isSuccess()) {
1077 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fname <<
"] !");
1078 return StatusCode::FAILURE;
1080 if (savedName != fname) {
1081 ATH_MSG_DEBUG(
"Mapping value for [" << savedName <<
"] to [" << fname <<
"]");
1084 updatedIndexes.insert(i);
1085 for (std::size_t j = i + 1; j <
imax; j++) {
1086 if (inputCollections[j] == savedName) {
1087 inputCollections[j] = fname;
1088 updatedIndexes.insert(j);
1100 if (m_poolCollectionConverter) {
1101 m_poolCollectionConverter->disconnectDb().ignore();
1102 m_poolCollectionConverter.reset();
1104 return StatusCode::SUCCESS;
1116 if (inc.type() == IncidentType::BeginProcessing) {
1127 ATH_MSG_WARNING(
"could not read event source ID from incident event context");
1130 if( m_activeEventsPerSource.find( fid ) == m_activeEventsPerSource.end()) {
1131 ATH_MSG_DEBUG(
"Incident handler ignoring unknown input FID: " << fid );
1134 ATH_MSG_DEBUG(
"** MN Incident handler " << inc.type() <<
" Event source ID=" << fid );
1135 if( inc.type() == IncidentType::BeginProcessing ) {
1137 m_activeEventsPerSource[fid]++;
1138 }
else if( inc.type() == IncidentType::EndProcessing ) {
1139 m_activeEventsPerSource[fid]--;
1143 if( msgLvl(MSG::DEBUG) ) {
1144 for(
auto& source: m_activeEventsPerSource )
1145 msg(MSG::DEBUG) <<
"SourceID: " << source.first <<
" active events: " << source.second <<
endmsg;
1156 if(
m_eventStreamingTool.empty() && m_activeEventsPerSource.find(fid) != m_activeEventsPerSource.end()
1157 && m_activeEventsPerSource[fid] <= 0 && m_guid != fid ) {
1162 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + fid, fid);
1165 ATH_MSG_INFO(
"Disconnecting input sourceID: " << fid );
1167 m_activeEventsPerSource.erase( fid );
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This file contains the class definition for the EventContextAthenaPool class.
This file contains the class definition for the EventSelectorAthenaPool class.
This file contains the class definition for the IPoolSvc interface class.
This file contains the class definition for the PoolCollectionConverter class.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
This file contains the class definition for the TokenAddress class.
This file contains the class definition for the Token class (migrated from POOL).
#define ATLAS_THREAD_SAFE
An AttributeList represents a logical row of attributes in a metadata table.
This class provides the context to access an event from POOL persistent store.
EventSelectorAthenaPool(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
Gaudi::CheckedProperty< uint64_t > m_firstEventNo
virtual StatusCode start() override
std::unique_ptr< PoolCollectionConverter > getCollectionCnv(bool throwIncidents=false) const
Return pointer to new PoolCollectionConverter.
Gaudi::Property< bool > m_isSecondary
IsSecondary, know if this is an instance of secondary event selector.
virtual StatusCode makeClient(int num) override
Make this a client.
virtual StatusCode nextWithSkip(IEvtSelector::Context &ctxt) const override
Go to next event and skip if necessary.
virtual StatusCode initialize() override
Required of all Gaudi Services.
Gaudi::Property< int > m_skipEvents
SkipEvents, numbers of events to skip: default = 0.
Gaudi::Property< bool > m_processMetadata
ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default...
virtual StatusCode share(int evtnum) override
Request to share a given event number.
virtual int curEvent(const Context &ctxt) const override
Return the current event number.
virtual StatusCode createContext(IEvtSelector::Context *&ctxt) const override
create context
virtual StatusCode io_finalize() override
Callback method to finalize the internal state of the component for I/O purposes (e....
Gaudi::Property< std::vector< long > > m_skipEventSequenceProp
Gaudi::CheckedProperty< uint32_t > m_initTimeStamp
void inputCollectionsHandler(Gaudi::Details::PropertyBase &)
virtual StatusCode io_reinit() override
Callback method to reinitialize the internal state of the component for I/O purposes (e....
virtual StatusCode resetCriteria(const std::string &criteria, IEvtSelector::Context &ctxt) const override
Set a selection criteria.
StatusCode reinit() const
Reinitialize the service when a fork() occurred/was-issued.
StoreGateSvc * eventStore() const
Return pointer to active event SG.
void fireEndFileIncidents(bool isLastFile) const
Fires the EndInputFile incident (if there is an open file) at end of selector.
virtual StatusCode releaseContext(IEvtSelector::Context *&ctxt) const override
virtual StatusCode stop() override
ServiceHandle< IIncidentSvc > m_incidentSvc
virtual StatusCode next(IEvtSelector::Context &ctxt) const override
virtual ~EventSelectorAthenaPool()
Destructor.
ToolHandle< IAthenaSelectorTool > m_counterTool
virtual StatusCode fillAttributeList(coral::AttributeList *attrList, const std::string &suffix, bool copySource) const override
Fill AttributeList with specific items from the selector and a suffix.
std::string m_attrListKey
AttributeList SG key.
virtual StatusCode seek(Context &ctxt, int evtnum) const override
Seek to a given event number.
SG::SlotSpecificObj< SG::SourceID > m_sourceID
ToolHandle< IAthenaIPCTool > m_eventStreamingTool
virtual StatusCode last(IEvtSelector::Context &ctxt) const override
virtual StatusCode makeServer(int num) override
Make this a server.
Gaudi::CheckedProperty< uint64_t > m_eventsPerRun
Gaudi::CheckedProperty< uint32_t > m_eventsPerLB
virtual StatusCode createAddress(const IEvtSelector::Context &ctxt, IOpaqueAddress *&iop) const override
virtual void handle(const Incident &incident) override
Incident service handle listening for BeginProcessing and EndProcessing.
virtual StatusCode previous(IEvtSelector::Context &ctxt) const override
ServiceHandle< IAthenaPoolCnvSvc > m_athenaPoolCnvSvc
virtual StatusCode rewind(IEvtSelector::Context &ctxt) const override
Gaudi::Property< bool > m_keepInputFilesOpen
KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false...
Gaudi::CheckedProperty< uint32_t > m_oldRunNo
Gaudi::Property< std::string > m_collectionType
CollectionType, type of the collection: default = "ImplicitCollection".
virtual StatusCode finalize() override
virtual bool disconnectIfFinished(const SG::SourceID &fid) const override
Gaudi::Property< std::vector< std::string > > m_inputCollectionsProp
InputCollections, vector with names of the input collections.
EventContextAthenaPool * m_endIter
std::atomic_int m_evtCount
std::atomic_bool m_firedIncident
std::atomic_long m_curCollection
Gaudi::Property< int > m_makeStreamingToolClient
Make this instance a Streaming Client during first iteration automatically.
virtual StatusCode readEvent(int maxevt) override
Read the next maxevt events.
virtual StatusCode nextHandleFileTransition(IEvtSelector::Context &ctxt) const override
Handle file transition at the next iteration.
virtual StatusCode recordAttributeList() const override
Record AttributeList in StoreGate.
Gaudi::CheckedProperty< uint32_t > m_runNo
The following are included for compatibility with McEventSelector and are not really used.
virtual int size(Context &ctxt) const override
Return the size of the collection.
int findEvent(int evtNum) const
Search for event with number evtNum.
Gaudi::Property< std::string > m_skipEventRangesProp
Skip Events - comma separated list of event to skip, ranges with '-': <start> - <end>
Gaudi::CheckedProperty< uint32_t > m_firstLBNo
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
static const Guid & null() noexcept
NULL-Guid: static class method.
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
Abstract interface for sharing data.
This class provides an interface to POOL collections.
StatusCode isValid() const
Check whether has valid pool::ICollection*.
pool::ICollectionCursor & selectAll()
StatusCode initialize()
Required by all Gaudi Services.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
The Athena Transient Store API.
static StoreGateSvc * currentStoreGate()
get current StoreGate
static const std::string & storeName(const StoreID::type &s)
This class provides a Generic Transient Address for POOL tokens.
This class provides a token that identifies in a unique way objects on the persistent storage.
virtual const std::string toString() const
Retrieve the string representation of the token.
int technology() const
Access technology type.
Token & fromString(const std::string_view from)
Build from the string representation of a token.
const Guid & dbID() const
Access database identifier.
An interface used to navigate the result of a query on a collection.
virtual std::size_t size()=0
Returns the size of the collection.
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
static const DbType POOL_StorageType
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.