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)
69 m_inputCollectionsChanged =
false;
73 if (this->FSMState() != Gaudi::StateMachine::OFFLINE) {
74 m_inputCollectionsChanged =
true;
87 m_autoRetrieveTools =
false;
88 m_checkToolDeps =
false;
91 ATH_MSG_DEBUG(
"Initializing secondary event selector " << name());
99 ATH_MSG_FATAL(
"Use the property: EventSelector.InputCollections = "
100 <<
"[ \"<collectionName>\" ] (list of collections)");
101 return StatusCode::FAILURE;
103 boost::char_separator<char> sep_coma(
","), sep_hyph(
"-");
105 for(
const std::string&
r: ranges ) {
106 boost::tokenizer fromto(
r, sep_hyph);
107 auto from_iter = fromto.begin();
108 long from = std::stol(*from_iter);
110 if( ++from_iter != fromto.end() ) {
111 to = std::stol(*from_iter);
113 m_skipEventRanges.emplace_back(from, to);
117 m_skipEventRanges.emplace_back(v, v);
119 std::sort(m_skipEventRanges.begin(), m_skipEventRanges.end());
120 if( msgLvl(MSG::DEBUG) ) {
121 std::string skip_ranges_str;
122 for(
const auto& [first, second] : m_skipEventRanges ) {
123 if( !skip_ranges_str.empty() ) skip_ranges_str +=
", ";
124 skip_ranges_str += std::to_string(first);
125 if( first != second) skip_ranges_str += std::format(
"-{}", second);
127 if( !skip_ranges_str.empty() )
134 m_incidentSvc->addListener(
this, IncidentType::BeginProcessing, 0);
135 m_incidentSvc->addListener(
this, IncidentType::EndProcessing, 0);
149 return StatusCode::FAILURE;
151 std::string dummyStr;
157 std::vector<std::string> propVal;
159 bool foundCnvSvc =
false;
160 for (
const auto& property : propVal) {
165 if (!epSvc->setProperty(
"CnvServices", Gaudi::Utils::toString(propVal)).isSuccess()) {
166 ATH_MSG_FATAL(
"Cannot set EventPersistencySvc Property for CnvServices");
167 return StatusCode::FAILURE;
178 for (
const auto& inputCollection : incol) {
179 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::READ, inputCollection, inputCollection).isSuccess()) {
180 ATH_MSG_FATAL(
"could not register [" << inputCollection <<
"] for output !");
183 ATH_MSG_VERBOSE(
"io_register[" << this->name() <<
"](" << inputCollection <<
") [ok]");
187 return StatusCode::FAILURE;
193 return StatusCode::FAILURE;
210 if (!m_firstEvt.empty()) {
213 m_inputCollectionsChanged =
false;
215 m_headerIterator = 0;
217 ATH_MSG_INFO(
"Done reinitialization for shared reader client");
218 return StatusCode::SUCCESS;
220 bool retError =
false;
221 for (
auto& tool : m_helperTools) {
222 if (!tool->postInitialize().isSuccess()) {
223 ATH_MSG_FATAL(
"Failed to postInitialize() " << tool->name());
229 return StatusCode::FAILURE;
234 if (!m_poolCollectionConverter) {
235 ATH_MSG_INFO(
"No Events found in any Input Collections");
241 FileIncident firstInputFileIncident(name(),
"FirstInputFile", *m_inputCollectionsIterator);
246 return StatusCode::SUCCESS;
250 m_headerIterator = &m_poolCollectionConverter->selectAll();
251 }
catch (std::exception &e) {
252 ATH_MSG_FATAL(
"Cannot open implicit collection - check data/software version.");
254 return StatusCode::FAILURE;
256 while (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
257 if (m_poolCollectionConverter) {
258 m_poolCollectionConverter->disconnectDb().ignore();
259 m_poolCollectionConverter.reset();
261 ++m_inputCollectionsIterator;
263 if (m_poolCollectionConverter) {
264 m_headerIterator = &m_poolCollectionConverter->selectAll();
269 if (!m_poolCollectionConverter || m_headerIterator ==
nullptr) {
273 if (!m_poolCollectionConverter) {
274 return StatusCode::SUCCESS;
276 m_headerIterator = &m_poolCollectionConverter->selectAll();
277 while (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
278 if (m_poolCollectionConverter) {
279 m_poolCollectionConverter->disconnectDb().ignore();
280 m_poolCollectionConverter.reset();
282 ++m_inputCollectionsIterator;
284 if (m_poolCollectionConverter) {
285 m_headerIterator = &m_poolCollectionConverter->selectAll();
291 if (!m_poolCollectionConverter || m_headerIterator ==
nullptr) {
292 return StatusCode::SUCCESS;
294 const Token& headRef = m_headerIterator->eventRef();
301 FileIncident firstInputFileIncident(name(),
"FirstInputFile",
"FID:" + fid, fid);
305 return StatusCode::SUCCESS;
309 if (m_poolCollectionConverter) {
311 m_poolCollectionConverter->disconnectDb().ignore();
312 m_poolCollectionConverter.reset();
317 return StatusCode::SUCCESS;
320 if (!m_poolCollectionConverter) {
321 ATH_MSG_INFO(
"No Events found in any Input Collections");
324 --m_inputCollectionsIterator;
327 m_headerIterator = &m_poolCollectionConverter->selectAll();
333 return StatusCode::SUCCESS;
338 return StatusCode::SUCCESS;
340 IEvtSelector::Context* ctxt(
nullptr);
344 return StatusCode::SUCCESS;
354 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
370 for (
auto& tool : m_helperTools) {
371 if (!tool->preFinalize().isSuccess()) {
377 m_headerIterator =
nullptr;
378 if (m_poolCollectionConverter) {
379 m_poolCollectionConverter.reset();
382 return ::AthService::finalize();
388 return StatusCode::SUCCESS;
392 std::lock_guard<CallMutex> lockGuard(
m_callLock);
396 while (
sc.isRecoverable()) {
403 void* tokenStr =
nullptr;
404 unsigned int status = 0;
406 if (
sc.isRecoverable()) {
407 delete [] (
char*)tokenStr; tokenStr =
nullptr;
411 return StatusCode::FAILURE;
413 if (
sc.isFailure()) {
414 ATH_MSG_FATAL(
"Cannot get NextEvent from AthenaSharedMemoryTool");
415 delete [] (
char*)tokenStr; tokenStr =
nullptr;
416 return StatusCode::FAILURE;
418 if (!
eventStore()->clearStore().isSuccess()) {
422 athAttrList->extend(
"eventRef",
"string");
423 (*athAttrList)[
"eventRef"].data<std::string>() = std::string((
char*)tokenStr);
425 if (!wh.record(std::move(athAttrList)).isSuccess()) {
426 delete [] (
char*)tokenStr; tokenStr =
nullptr;
428 return StatusCode::FAILURE;
431 token.
fromString(std::string((
char*)tokenStr));
432 delete [] (
char*)tokenStr; tokenStr =
nullptr;
437 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
441 FileIncident beginInputFileIncident(name(),
"BeginInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
444 return StatusCode::SUCCESS;
446 for (
const auto& tool : m_helperTools) {
447 if (!tool->preNext().isSuccess()) {
454 if (
sc.isRecoverable()) {
457 if (
sc.isFailure()) {
458 return StatusCode::FAILURE;
466 && (m_skipEventRanges.empty() ||
m_evtCount < m_skipEventRanges.front().first))
472 return StatusCode::FAILURE;
474 std::string token = m_headerIterator->eventRef().toString();
478 token.length() + 1, 0)).isRecoverable() ) {
479 while (ds->readData().isSuccess()) {
480 ATH_MSG_VERBOSE(
"Called last readData, while putting next event in next()");
484 if (!
sc.isSuccess()) {
486 return StatusCode::FAILURE;
490 if (!
eventStore()->clearStore().isSuccess()) {
495 return StatusCode::FAILURE;
499 StatusCode status = StatusCode::SUCCESS;
500 for (
const auto& tool : m_helperTools) {
501 StatusCode toolStatus = tool->postNext();
502 if (toolStatus.isRecoverable()) {
503 ATH_MSG_INFO(
"Request skipping event from: " << tool->name());
504 if (status.isSuccess()) {
505 status = StatusCode::RECOVERABLE;
507 }
else if (toolStatus.isFailure()) {
509 status = StatusCode::FAILURE;
512 if (status.isRecoverable()) {
514 }
else if (status.isFailure()) {
523 while( !m_skipEventRanges.empty() &&
m_evtCount >= m_skipEventRanges.front().second ) {
524 m_skipEventRanges.erase(m_skipEventRanges.begin());
529 return StatusCode::SUCCESS;
534 for (
int i = 0; i < jump; i++) {
537 return StatusCode::SUCCESS;
539 return StatusCode::FAILURE;
544 if( m_inputCollectionsChanged ) {
546 if(
rc != StatusCode::SUCCESS )
return rc;
550 if (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
551 m_headerIterator =
nullptr;
553 m_poolCollectionConverter.reset();
561 if( m_inputCollectionsChanged ) {
563 if(
rc != StatusCode::SUCCESS )
return rc;
566 ++m_inputCollectionsIterator;
569 if (!m_poolCollectionConverter) {
573 return StatusCode::FAILURE;
576 m_headerIterator = &m_poolCollectionConverter->selectAll();
579 return StatusCode::RECOVERABLE;
583 const Token& headRef = m_headerIterator->eventRef();
588 if (guid != m_guid) {
597 m_activeEventsPerSource[guid.toString()] = 0;
602 if (!
m_athenaPoolCnvSvc->setInputAttributes(*m_inputCollectionsIterator).isSuccess()) {
604 return StatusCode::FAILURE;
607 FileIncident beginInputFileIncident(name(),
"BeginInputFile", *m_inputCollectionsIterator, m_guid.toString());
613 FileIncident beginInputFileIncident(name(),
"BeginInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
618 return StatusCode::SUCCESS;
627 if (
sc.isRecoverable()) {
630 if (
sc.isFailure()) {
631 return StatusCode::FAILURE;
641 && (m_skipEventRanges.empty() ||
m_evtCount < m_skipEventRanges.front().first))
643 return StatusCode::SUCCESS;
645 while( !m_skipEventRanges.empty() &&
m_evtCount >= m_skipEventRanges.front().second ) {
646 m_skipEventRanges.erase(m_skipEventRanges.begin());
656 return StatusCode::SUCCESS;
661 return StatusCode::FAILURE;
666 for (
int i = 0; i < jump; i++) {
669 return StatusCode::SUCCESS;
671 return StatusCode::FAILURE;
675 if (ctxt.identifier() ==
m_endIter->identifier()) {
677 return StatusCode::SUCCESS;
679 return StatusCode::FAILURE;
685 return StatusCode::SUCCESS;
689 IOpaqueAddress*& iop)
const {
690 std::string tokenStr;
694 tokenStr = (*attrList)[
"eventRef"].data<std::string>();
695 ATH_MSG_DEBUG(
"found AthenaAttribute, name = eventRef = " << tokenStr);
696 }
catch (std::exception &e) {
698 return StatusCode::FAILURE;
702 tokenStr = m_headerIterator->eventRef().toString();
704 auto token = std::make_unique<Token>();
705 token->fromString(tokenStr);
707 return StatusCode::SUCCESS;
711 return StatusCode::SUCCESS;
715 IEvtSelector::Context& )
const {
716 return StatusCode::SUCCESS;
721 if( m_inputCollectionsChanged ) {
723 if(
rc != StatusCode::SUCCESS )
return rc;
731 m_headerIterator =
nullptr;
734 return StatusCode::RECOVERABLE;
738 m_poolCollectionConverter->disconnectDb().ignore();
740 m_poolCollectionConverter.reset();
745 <<
"\" from the collection list.");
749 m_poolCollectionConverter = std::make_unique<PoolCollectionConverter>(
m_collectionType.value(),
753 if (!m_poolCollectionConverter->initialize().isSuccess()) {
754 m_headerIterator =
nullptr;
755 ATH_MSG_ERROR(
"seek: Unable to initialize PoolCollectionConverter.");
756 return StatusCode::FAILURE;
759 m_headerIterator = &m_poolCollectionConverter->selectAll();
762 next(*beginIter).ignore();
763 ATH_MSG_DEBUG(
"Token " << m_headerIterator->eventRef().toString());
764 }
catch (std::exception &e) {
765 m_headerIterator =
nullptr;
767 return StatusCode::FAILURE;
771 if (m_headerIterator->seek(evtNum - m_firstEvt[
m_curCollection]) == 0) {
772 m_headerIterator =
nullptr;
774 return StatusCode::FAILURE;
778 return StatusCode::SUCCESS;
790 for (std::size_t i = 0,
imax = m_numEvt.size(); i <
imax; i++) {
791 if (m_numEvt[i] == -1) {
799 int collection_size = 0;
802 collection_size = hi->
size();
805 m_firstEvt[i] = m_firstEvt[i - 1] + m_numEvt[i - 1];
809 m_numEvt[i] = collection_size;
811 if (evtNum >= m_firstEvt[i] && evtNum < m_firstEvt[i] + m_numEvt[i]) {
823 return StatusCode::FAILURE;
826 if (ds->makeServer(num - 1).isFailure()) {
827 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to output DataStreaming server");
829 return StatusCode::SUCCESS;
831 if (ds->makeServer(num + 1).isFailure()) {
832 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to input DataStreaming server");
833 return StatusCode::FAILURE;
836 return StatusCode::SUCCESS;
848 return StatusCode::FAILURE;
850 if (ds->makeClient(num + 1).isFailure()) {
851 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to DataStreaming client");
852 return StatusCode::FAILURE;
855 return StatusCode::SUCCESS;
858 std::string dummyStr;
867 return StatusCode::FAILURE;
871 while (
sc.isRecoverable()) {
876 if (
sc.isFailure()) {
877 if (ds->makeClient(0).isFailure()) {
878 return StatusCode::FAILURE;
881 while (
sc.isRecoverable() ||
sc.isFailure()) {
886 if (ds->makeClient(1).isFailure()) {
887 return StatusCode::FAILURE;
892 return StatusCode::FAILURE;
900 return StatusCode::FAILURE;
903 ATH_MSG_ERROR(
"No AthenaSharedMemoryTool configured for readEvent()");
904 return StatusCode::FAILURE;
908 for (
int i = 0; i < maxevt || maxevt == -1; ++i) {
909 if (!
next(*ctxt).isSuccess()) {
911 ATH_MSG_VERBOSE(
"Called read Event and read last event from input: " << i);
915 delete ctxt; ctxt =
nullptr;
916 return StatusCode::FAILURE;
921 delete ctxt; ctxt =
nullptr;
925 while (ds->readData().isSuccess()) {
926 ATH_MSG_VERBOSE(
"Called last readData, while marking last event in readEvent()");
930 if (!
sc.isSuccess()) {
931 ATH_MSG_ERROR(
"Cannot put last Event marker to AthenaSharedMemoryTool");
932 return StatusCode::FAILURE;
935 while (
sc.isSuccess() ||
sc.isRecoverable()) {
938 ATH_MSG_DEBUG(
"Failed last readData -> Clients are stopped, after marking last event in readEvent()");
940 return StatusCode::SUCCESS;
947 return std::accumulate(m_numEvt.begin(), m_numEvt.end(), 0);
950std::unique_ptr<PoolCollectionConverter>
958 ATH_MSG_DEBUG(
"Try item: \"" << *m_inputCollectionsIterator <<
"\" from the collection list.");
959 auto pCollCnv = std::make_unique<PoolCollectionConverter>(
m_collectionType.value(),
960 *m_inputCollectionsIterator,
963 StatusCode status = pCollCnv->initialize();
964 if (!status.isSuccess()) {
967 if (!status.isRecoverable()) {
968 ATH_MSG_ERROR(
"Unable to initialize PoolCollectionConverter.");
969 throw GaudiException(
"Unable to read: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
971 ATH_MSG_ERROR(
"Unable to open: " << *m_inputCollectionsIterator);
972 throw GaudiException(
"Unable to open: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
975 if (!pCollCnv->isValid().isSuccess()) {
977 ATH_MSG_DEBUG(
"No events found in: " << *m_inputCollectionsIterator <<
" skipped!!!");
979 FileIncident beginInputFileIncident(name(),
"BeginInputFile", *m_inputCollectionsIterator);
981 FileIncident endInputFileIncident(name(),
"EndInputFile",
"eventless " + *m_inputCollectionsIterator);
985 ++m_inputCollectionsIterator;
998 const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
1005 ATH_CHECK(wh.record(std::move(athAttrList)));
1006 return StatusCode::SUCCESS;
1011 const auto& row = m_headerIterator->currentRow();
1012 attrList->extend( row.tokenName() + suffix,
"string" );
1013 (*attrList)[ row.tokenName() + suffix ].data<std::string>() = row.token().toString();
1014 ATH_MSG_DEBUG(
"record AthenaAttribute, name = " << row.tokenName() + suffix <<
" = " << row.token().toString() <<
".");
1016 std::string eventRef =
"eventRef";
1018 eventRef.append(suffix);
1020 attrList->extend(eventRef,
"string");
1021 (*attrList)[eventRef].data<std::string>() = m_headerIterator->eventRef().toString();
1022 ATH_MSG_DEBUG(
"record AthenaAttribute, name = " + eventRef +
" = " << m_headerIterator->eventRef().toString() <<
".");
1025 const coral::AttributeList& sourceAttrList = m_headerIterator->currentRow().attributeList();
1026 for (
const auto &attr : sourceAttrList) {
1027 attrList->extend(attr.specification().name() + suffix, attr.specification().type());
1028 (*attrList)[attr.specification().name() + suffix] = attr;
1032 return StatusCode::SUCCESS;
1037 if (m_poolCollectionConverter) {
1038 m_poolCollectionConverter->disconnectDb().ignore();
1039 m_poolCollectionConverter.reset();
1041 m_headerIterator =
nullptr;
1043 if (!iomgr.retrieve().isSuccess()) {
1045 return StatusCode::FAILURE;
1047 if (!iomgr->io_hasitem(
this)) {
1048 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
1049 return StatusCode::FAILURE;
1056 std::set<std::size_t> updatedIndexes;
1058 if (updatedIndexes.find(i) != updatedIndexes.end())
continue;
1059 std::string savedName = inputCollections[i];
1060 std::string &fname = inputCollections[i];
1061 if (!iomgr->io_contains(
this, fname)) {
1062 ATH_MSG_ERROR(
"IoComponentMgr does not know about [" << fname <<
"] !");
1063 return StatusCode::FAILURE;
1065 if (!iomgr->io_retrieve(
this, fname).isSuccess()) {
1066 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fname <<
"] !");
1067 return StatusCode::FAILURE;
1069 if (savedName != fname) {
1070 ATH_MSG_DEBUG(
"Mapping value for [" << savedName <<
"] to [" << fname <<
"]");
1073 updatedIndexes.insert(i);
1074 for (std::size_t j = i + 1; j <
imax; j++) {
1075 if (inputCollections[j] == savedName) {
1076 inputCollections[j] = fname;
1077 updatedIndexes.insert(j);
1089 if (m_poolCollectionConverter) {
1090 m_poolCollectionConverter->disconnectDb().ignore();
1091 m_poolCollectionConverter.reset();
1093 return StatusCode::SUCCESS;
1105 if (inc.type() == IncidentType::BeginProcessing) {
1116 ATH_MSG_WARNING(
"could not read event source ID from incident event context");
1119 if( m_activeEventsPerSource.find( fid ) == m_activeEventsPerSource.end()) {
1120 ATH_MSG_DEBUG(
"Incident handler ignoring unknown input FID: " << fid );
1123 ATH_MSG_DEBUG(
"** MN Incident handler " << inc.type() <<
" Event source ID=" << fid );
1124 if( inc.type() == IncidentType::BeginProcessing ) {
1126 m_activeEventsPerSource[fid]++;
1127 }
else if( inc.type() == IncidentType::EndProcessing ) {
1128 m_activeEventsPerSource[fid]--;
1132 if( msgLvl(MSG::DEBUG) ) {
1133 for(
auto& source: m_activeEventsPerSource )
1134 msg(MSG::DEBUG) <<
"SourceID: " << source.first <<
" active events: " << source.second <<
endmsg;
1145 if(
m_eventStreamingTool.empty() && m_activeEventsPerSource.find(fid) != m_activeEventsPerSource.end()
1146 && m_activeEventsPerSource[fid] <= 0 && m_guid != fid ) {
1151 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + fid, fid);
1154 ATH_MSG_INFO(
"Disconnecting input sourceID: " << fid );
1156 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.