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"
39#include <boost/tokenizer.hpp>
48 long eventNumber,
const void* source,
49 size_t nbytes,
unsigned int status) {
58 base_class(name, pSvcLocator)
71 m_inputCollectionsChanged =
false;
75 if (this->FSMState() != Gaudi::StateMachine::OFFLINE) {
76 m_inputCollectionsChanged =
true;
89 m_autoRetrieveTools =
false;
90 m_checkToolDeps =
false;
93 ATH_MSG_DEBUG(
"Initializing secondary event selector " << name());
101 ATH_MSG_FATAL(
"Use the property: EventSelector.InputCollections = "
102 <<
"[ \"<collectionName>\" ] (list of collections)");
103 return StatusCode::FAILURE;
105 boost::char_separator<char> sep_coma(
","), sep_hyph(
"-");
107 for(
const std::string&
r: ranges ) {
108 boost::tokenizer fromto(
r, sep_hyph);
109 auto from_iter = fromto.begin();
110 long from = std::stol(*from_iter);
112 if( ++from_iter != fromto.end() ) {
113 to = std::stol(*from_iter);
115 m_skipEventRanges.emplace_back(from, to);
119 m_skipEventRanges.emplace_back(v, v);
121 std::sort(m_skipEventRanges.begin(), m_skipEventRanges.end());
122 if( msgLvl(MSG::DEBUG) ) {
123 std::string skip_ranges_str;
124 for(
const auto& [first, second] : m_skipEventRanges ) {
125 if( !skip_ranges_str.empty() ) skip_ranges_str +=
", ";
126 skip_ranges_str += std::to_string(first);
127 if( first != second) skip_ranges_str += std::format(
"-{}", second);
129 if( !skip_ranges_str.empty() )
136 m_incidentSvc->addListener(
this, IncidentType::BeginProcessing, 0);
137 m_incidentSvc->addListener(
this, IncidentType::EndProcessing, 0);
151 return StatusCode::FAILURE;
153 std::string dummyStr;
159 std::vector<std::string> propVal;
161 bool foundCnvSvc =
false;
162 for (
const auto& property : propVal) {
167 if (!epSvc->setProperty(
"CnvServices", Gaudi::Utils::toString(propVal)).isSuccess()) {
168 ATH_MSG_FATAL(
"Cannot set EventPersistencySvc Property for CnvServices");
169 return StatusCode::FAILURE;
180 std::string fileName;
181 std::string fileType;
182 for (
const auto& inputCollection : incol) {
183 if (inputCollection.starts_with(
"LFN:") || inputCollection.starts_with(
"FID:")) {
186 fileName = inputCollection;
188 if (fileName.starts_with(
"PFN:")) {
189 fileName = fileName.substr(4);
191 if (!iomgr->io_register(
this, IIoComponentMgr::IoMode::READ, inputCollection, fileName).isSuccess()) {
192 ATH_MSG_FATAL(
"could not register [" << inputCollection <<
"] for output !");
195 ATH_MSG_VERBOSE(
"io_register[" << this->name() <<
"](" << inputCollection <<
") [ok]");
199 return StatusCode::FAILURE;
205 return StatusCode::FAILURE;
222 if (!m_firstEvt.empty()) {
225 m_inputCollectionsChanged =
false;
227 m_headerIterator = 0;
229 ATH_MSG_INFO(
"Done reinitialization for shared reader client");
230 return StatusCode::SUCCESS;
232 bool retError =
false;
233 for (
auto& tool : m_helperTools) {
234 if (!tool->postInitialize().isSuccess()) {
235 ATH_MSG_FATAL(
"Failed to postInitialize() " << tool->name());
241 return StatusCode::FAILURE;
246 if (!m_poolCollectionConverter) {
247 ATH_MSG_INFO(
"No Events found in any Input Collections");
253 FileIncident firstInputFileIncident(name(),
"FirstInputFile", *m_inputCollectionsIterator);
258 return StatusCode::SUCCESS;
262 m_headerIterator = &m_poolCollectionConverter->selectAll();
263 }
catch (std::exception &e) {
264 ATH_MSG_FATAL(
"Cannot open implicit collection - check data/software version.");
266 return StatusCode::FAILURE;
268 while (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
269 if (m_poolCollectionConverter) {
270 m_poolCollectionConverter->disconnectDb().ignore();
271 m_poolCollectionConverter.reset();
273 ++m_inputCollectionsIterator;
275 if (m_poolCollectionConverter) {
276 m_headerIterator = &m_poolCollectionConverter->selectAll();
281 if (!m_poolCollectionConverter || m_headerIterator ==
nullptr) {
285 if (!m_poolCollectionConverter) {
286 return StatusCode::SUCCESS;
288 m_headerIterator = &m_poolCollectionConverter->selectAll();
289 while (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
290 if (m_poolCollectionConverter) {
291 m_poolCollectionConverter->disconnectDb().ignore();
292 m_poolCollectionConverter.reset();
294 ++m_inputCollectionsIterator;
296 if (m_poolCollectionConverter) {
297 m_headerIterator = &m_poolCollectionConverter->selectAll();
303 if (!m_poolCollectionConverter || m_headerIterator ==
nullptr) {
304 return StatusCode::SUCCESS;
306 const Token& headRef = m_headerIterator->eventRef();
313 FileIncident firstInputFileIncident(name(),
"FirstInputFile",
"FID:" + fid, fid);
317 return StatusCode::SUCCESS;
321 if (m_poolCollectionConverter) {
323 m_poolCollectionConverter->disconnectDb().ignore();
324 m_poolCollectionConverter.reset();
329 return StatusCode::SUCCESS;
332 if (!m_poolCollectionConverter) {
333 ATH_MSG_INFO(
"No Events found in any Input Collections");
336 --m_inputCollectionsIterator;
339 m_headerIterator = &m_poolCollectionConverter->selectAll();
345 return StatusCode::SUCCESS;
350 return StatusCode::SUCCESS;
352 IEvtSelector::Context* ctxt(
nullptr);
356 return StatusCode::SUCCESS;
366 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
382 for (
auto& tool : m_helperTools) {
383 if (!tool->preFinalize().isSuccess()) {
389 m_headerIterator =
nullptr;
390 if (m_poolCollectionConverter) {
391 m_poolCollectionConverter.reset();
394 return ::AthService::finalize();
400 return StatusCode::SUCCESS;
404 std::lock_guard<CallMutex> lockGuard(
m_callLock);
408 while (
sc.isRecoverable()) {
415 void* tokenStr =
nullptr;
416 unsigned int status = 0;
418 if (
sc.isRecoverable()) {
419 delete [] (
char*)tokenStr; tokenStr =
nullptr;
423 return StatusCode::FAILURE;
425 if (
sc.isFailure()) {
426 ATH_MSG_FATAL(
"Cannot get NextEvent from AthenaSharedMemoryTool");
427 delete [] (
char*)tokenStr; tokenStr =
nullptr;
428 return StatusCode::FAILURE;
430 if (!
eventStore()->clearStore().isSuccess()) {
434 athAttrList->extend(
"eventRef",
"string");
435 (*athAttrList)[
"eventRef"].data<std::string>() = std::string((
char*)tokenStr);
437 if (!wh.record(std::move(athAttrList)).isSuccess()) {
438 delete [] (
char*)tokenStr; tokenStr =
nullptr;
440 return StatusCode::FAILURE;
443 token.
fromString(std::string((
char*)tokenStr));
444 delete [] (
char*)tokenStr; tokenStr =
nullptr;
449 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
453 FileIncident beginInputFileIncident(name(),
"BeginInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
456 return StatusCode::SUCCESS;
458 for (
const auto& tool : m_helperTools) {
459 if (!tool->preNext().isSuccess()) {
466 if (
sc.isRecoverable()) {
469 if (
sc.isFailure()) {
470 return StatusCode::FAILURE;
478 && (m_skipEventRanges.empty() ||
m_evtCount < m_skipEventRanges.front().first))
484 return StatusCode::FAILURE;
486 std::string token = m_headerIterator->eventRef().toString();
490 token.length() + 1, 0)).isRecoverable() ) {
491 while (ds->readData().isSuccess()) {
492 ATH_MSG_VERBOSE(
"Called last readData, while putting next event in next()");
496 if (!
sc.isSuccess()) {
498 return StatusCode::FAILURE;
502 if (!
eventStore()->clearStore().isSuccess()) {
507 return StatusCode::FAILURE;
511 StatusCode status = StatusCode::SUCCESS;
512 for (
const auto& tool : m_helperTools) {
513 StatusCode toolStatus = tool->postNext();
514 if (toolStatus.isRecoverable()) {
515 ATH_MSG_INFO(
"Request skipping event from: " << tool->name());
516 if (status.isSuccess()) {
517 status = StatusCode::RECOVERABLE;
519 }
else if (toolStatus.isFailure()) {
521 status = StatusCode::FAILURE;
524 if (status.isRecoverable()) {
526 }
else if (status.isFailure()) {
535 while( !m_skipEventRanges.empty() &&
m_evtCount >= m_skipEventRanges.front().second ) {
536 m_skipEventRanges.erase(m_skipEventRanges.begin());
541 return StatusCode::SUCCESS;
546 for (
int i = 0; i < jump; i++) {
549 return StatusCode::SUCCESS;
551 return StatusCode::FAILURE;
556 if( m_inputCollectionsChanged ) {
558 if(
rc != StatusCode::SUCCESS )
return rc;
562 if (m_headerIterator ==
nullptr || m_headerIterator->next() == 0) {
563 m_headerIterator =
nullptr;
565 m_poolCollectionConverter.reset();
573 if( m_inputCollectionsChanged ) {
575 if(
rc != StatusCode::SUCCESS )
return rc;
578 ++m_inputCollectionsIterator;
581 if (!m_poolCollectionConverter) {
585 return StatusCode::FAILURE;
588 m_headerIterator = &m_poolCollectionConverter->selectAll();
591 return StatusCode::RECOVERABLE;
595 const Token& headRef = m_headerIterator->eventRef();
600 if (guid != m_guid) {
609 m_activeEventsPerSource[guid.toString()] = 0;
614 if (!
m_athenaPoolCnvSvc->setInputAttributes(*m_inputCollectionsIterator).isSuccess()) {
616 return StatusCode::FAILURE;
619 FileIncident beginInputFileIncident(name(),
"BeginInputFile", *m_inputCollectionsIterator, m_guid.toString());
625 FileIncident beginInputFileIncident(name(),
"BeginInputFile",
"FID:" + m_guid.toString(), m_guid.toString());
630 return StatusCode::SUCCESS;
639 if (
sc.isRecoverable()) {
642 if (
sc.isFailure()) {
643 return StatusCode::FAILURE;
653 && (m_skipEventRanges.empty() ||
m_evtCount < m_skipEventRanges.front().first))
655 return StatusCode::SUCCESS;
657 while( !m_skipEventRanges.empty() &&
m_evtCount >= m_skipEventRanges.front().second ) {
658 m_skipEventRanges.erase(m_skipEventRanges.begin());
668 return StatusCode::SUCCESS;
673 return StatusCode::FAILURE;
678 for (
int i = 0; i < jump; i++) {
681 return StatusCode::SUCCESS;
683 return StatusCode::FAILURE;
687 if (ctxt.identifier() ==
m_endIter->identifier()) {
689 return StatusCode::SUCCESS;
691 return StatusCode::FAILURE;
697 return StatusCode::SUCCESS;
701 IOpaqueAddress*& iop)
const {
702 std::string tokenStr;
706 tokenStr = (*attrList)[
"eventRef"].data<std::string>();
707 ATH_MSG_DEBUG(
"found AthenaAttribute, name = eventRef = " << tokenStr);
708 }
catch (std::exception &e) {
710 return StatusCode::FAILURE;
714 tokenStr = m_headerIterator->eventRef().toString();
716 auto token = std::make_unique<Token>();
717 token->fromString(tokenStr);
719 return StatusCode::SUCCESS;
723 return StatusCode::SUCCESS;
727 IEvtSelector::Context& )
const {
728 return StatusCode::SUCCESS;
733 if( m_inputCollectionsChanged ) {
735 if(
rc != StatusCode::SUCCESS )
return rc;
743 m_headerIterator =
nullptr;
746 return StatusCode::RECOVERABLE;
750 m_poolCollectionConverter->disconnectDb().ignore();
752 m_poolCollectionConverter.reset();
757 <<
"\" from the collection list.");
761 m_poolCollectionConverter = std::make_unique<PoolCollectionConverter>(
m_collectionType.value(),
765 if (!m_poolCollectionConverter->initialize().isSuccess()) {
766 m_headerIterator =
nullptr;
767 ATH_MSG_ERROR(
"seek: Unable to initialize PoolCollectionConverter.");
768 return StatusCode::FAILURE;
771 m_headerIterator = &m_poolCollectionConverter->selectAll();
774 next(*beginIter).ignore();
775 ATH_MSG_DEBUG(
"Token " << m_headerIterator->eventRef().toString());
776 }
catch (std::exception &e) {
777 m_headerIterator =
nullptr;
779 return StatusCode::FAILURE;
783 if (m_headerIterator->seek(evtNum - m_firstEvt[
m_curCollection]) == 0) {
784 m_headerIterator =
nullptr;
786 return StatusCode::FAILURE;
790 return StatusCode::SUCCESS;
802 for (std::size_t i = 0,
imax = m_numEvt.size(); i <
imax; i++) {
803 if (m_numEvt[i] == -1) {
811 int collection_size = 0;
814 collection_size = hi->
size();
817 m_firstEvt[i] = m_firstEvt[i - 1] + m_numEvt[i - 1];
821 m_numEvt[i] = collection_size;
823 if (evtNum >= m_firstEvt[i] && evtNum < m_firstEvt[i] + m_numEvt[i]) {
835 return StatusCode::FAILURE;
838 if (ds->makeServer(num - 1).isFailure()) {
839 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to output DataStreaming server");
841 return StatusCode::SUCCESS;
843 if (ds->makeServer(num + 1).isFailure()) {
844 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to input DataStreaming server");
845 return StatusCode::FAILURE;
848 return StatusCode::SUCCESS;
860 return StatusCode::FAILURE;
862 if (ds->makeClient(num + 1).isFailure()) {
863 ATH_MSG_ERROR(
"Failed to switch AthenaPoolCnvSvc to DataStreaming client");
864 return StatusCode::FAILURE;
867 return StatusCode::SUCCESS;
870 std::string dummyStr;
879 return StatusCode::FAILURE;
883 while (
sc.isRecoverable()) {
888 if (
sc.isFailure()) {
889 if (ds->makeClient(0).isFailure()) {
890 return StatusCode::FAILURE;
893 while (
sc.isRecoverable() ||
sc.isFailure()) {
898 if (ds->makeClient(1).isFailure()) {
899 return StatusCode::FAILURE;
904 return StatusCode::FAILURE;
912 return StatusCode::FAILURE;
915 ATH_MSG_ERROR(
"No AthenaSharedMemoryTool configured for readEvent()");
916 return StatusCode::FAILURE;
920 for (
int i = 0; i < maxevt || maxevt == -1; ++i) {
921 if (!
next(*ctxt).isSuccess()) {
923 ATH_MSG_VERBOSE(
"Called read Event and read last event from input: " << i);
927 delete ctxt; ctxt =
nullptr;
928 return StatusCode::FAILURE;
933 delete ctxt; ctxt =
nullptr;
937 while (ds->readData().isSuccess()) {
938 ATH_MSG_VERBOSE(
"Called last readData, while marking last event in readEvent()");
942 if (!
sc.isSuccess()) {
943 ATH_MSG_ERROR(
"Cannot put last Event marker to AthenaSharedMemoryTool");
944 return StatusCode::FAILURE;
947 while (
sc.isSuccess() ||
sc.isRecoverable()) {
950 ATH_MSG_DEBUG(
"Failed last readData -> Clients are stopped, after marking last event in readEvent()");
952 return StatusCode::SUCCESS;
959 return std::accumulate(m_numEvt.begin(), m_numEvt.end(), 0);
962std::unique_ptr<PoolCollectionConverter>
970 ATH_MSG_DEBUG(
"Try item: \"" << *m_inputCollectionsIterator <<
"\" from the collection list.");
971 auto pCollCnv = std::make_unique<PoolCollectionConverter>(
m_collectionType.value(),
972 *m_inputCollectionsIterator,
975 StatusCode status = pCollCnv->initialize();
976 if (!status.isSuccess()) {
979 if (!status.isRecoverable()) {
980 ATH_MSG_ERROR(
"Unable to initialize PoolCollectionConverter.");
981 throw GaudiException(
"Unable to read: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
983 ATH_MSG_ERROR(
"Unable to open: " << *m_inputCollectionsIterator);
984 throw GaudiException(
"Unable to open: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
987 if (!pCollCnv->isValid().isSuccess()) {
989 ATH_MSG_DEBUG(
"No events found in: " << *m_inputCollectionsIterator <<
" skipped!!!");
991 FileIncident beginInputFileIncident(name(),
"BeginInputFile", *m_inputCollectionsIterator);
993 FileIncident endInputFileIncident(name(),
"EndInputFile",
"eventless " + *m_inputCollectionsIterator);
997 ++m_inputCollectionsIterator;
1010 const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
1017 ATH_CHECK(wh.record(std::move(athAttrList)));
1018 return StatusCode::SUCCESS;
1023 const pool::TokenList& tokenList = m_headerIterator->currentRow().tokenList();
1025 attrList->extend(iter.tokenName() + suffix,
"string");
1026 (*attrList)[iter.tokenName() + suffix].data<std::string>() = iter->toString();
1027 ATH_MSG_DEBUG(
"record AthenaAttribute, name = " << iter.tokenName() + suffix <<
" = " << iter->toString() <<
".");
1030 std::string eventRef =
"eventRef";
1032 eventRef.append(suffix);
1034 attrList->extend(eventRef,
"string");
1035 (*attrList)[eventRef].data<std::string>() = m_headerIterator->eventRef().toString();
1036 ATH_MSG_DEBUG(
"record AthenaAttribute, name = " + eventRef +
" = " << m_headerIterator->eventRef().toString() <<
".");
1039 const coral::AttributeList& sourceAttrList = m_headerIterator->currentRow().attributeList();
1040 for (
const auto &attr : sourceAttrList) {
1041 attrList->extend(attr.specification().name() + suffix, attr.specification().type());
1042 (*attrList)[attr.specification().name() + suffix] = attr;
1046 return StatusCode::SUCCESS;
1051 if (m_poolCollectionConverter) {
1052 m_poolCollectionConverter->disconnectDb().ignore();
1053 m_poolCollectionConverter.reset();
1055 m_headerIterator =
nullptr;
1057 if (!iomgr.retrieve().isSuccess()) {
1059 return StatusCode::FAILURE;
1061 if (!iomgr->io_hasitem(
this)) {
1062 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
1063 return StatusCode::FAILURE;
1070 std::set<std::size_t> updatedIndexes;
1072 if (updatedIndexes.find(i) != updatedIndexes.end())
continue;
1073 std::string savedName = inputCollections[i];
1074 std::string &fname = inputCollections[i];
1075 if (!iomgr->io_contains(
this, fname)) {
1076 ATH_MSG_ERROR(
"IoComponentMgr does not know about [" << fname <<
"] !");
1077 return StatusCode::FAILURE;
1079 if (!iomgr->io_retrieve(
this, fname).isSuccess()) {
1080 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fname <<
"] !");
1081 return StatusCode::FAILURE;
1083 if (savedName != fname) {
1084 ATH_MSG_DEBUG(
"Mapping value for [" << savedName <<
"] to [" << fname <<
"]");
1087 updatedIndexes.insert(i);
1088 for (std::size_t j = i + 1; j <
imax; j++) {
1089 if (inputCollections[j] == savedName) {
1090 inputCollections[j] = fname;
1091 updatedIndexes.insert(j);
1103 if (m_poolCollectionConverter) {
1104 m_poolCollectionConverter->disconnectDb().ignore();
1105 m_poolCollectionConverter.reset();
1107 return StatusCode::SUCCESS;
1119 if (inc.type() == IncidentType::BeginProcessing) {
1130 ATH_MSG_WARNING(
"could not read event source ID from incident event context");
1133 if( m_activeEventsPerSource.find( fid ) == m_activeEventsPerSource.end()) {
1134 ATH_MSG_DEBUG(
"Incident handler ignoring unknown input FID: " << fid );
1137 ATH_MSG_DEBUG(
"** MN Incident handler " << inc.type() <<
" Event source ID=" << fid );
1138 if( inc.type() == IncidentType::BeginProcessing ) {
1140 m_activeEventsPerSource[fid]++;
1141 }
else if( inc.type() == IncidentType::EndProcessing ) {
1142 m_activeEventsPerSource[fid]--;
1146 if( msgLvl(MSG::DEBUG) ) {
1147 for(
auto& source: m_activeEventsPerSource )
1148 msg(MSG::DEBUG) <<
"SourceID: " << source.first <<
" active events: " << source.second <<
endmsg;
1159 if(
m_eventStreamingTool.empty() && m_activeEventsPerSource.find(fid) != m_activeEventsPerSource.end()
1160 && m_activeEventsPerSource[fid] <= 0 && m_guid != fid ) {
1165 FileIncident endInputFileIncident(name(),
"EndInputFile",
"FID:" + fid, fid);
1168 ATH_MSG_INFO(
"Disconnecting input sourceID: " << fid );
1170 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.
Constant forward iterator class for navigation of TokenList objects.
A container class to facilitate the use of Token objects.
iterator begin()
Returns a forward iterator pointing to first element in Token list.
iterator end()
Returns a forward iterator pointing to last element in Token list.
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.