ATLAS Offline Software
Loading...
Searching...
No Matches
EventSelectorAthenaPool Class Reference

This class is the EventSelector for event data. More...

#include <EventSelectorAthenaPool.h>

Inheritance diagram for EventSelectorAthenaPool:

Public Member Functions

 EventSelectorAthenaPool (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Service Constructor.
virtual ~EventSelectorAthenaPool ()
 Destructor.
virtual StatusCode initialize () override
 Required of all Gaudi Services.
virtual StatusCode start () override
virtual StatusCode stop () override
virtual StatusCode finalize () override
virtual StatusCode createContext (IEvtSelector::Context *&ctxt) const override
 create context
virtual StatusCode next (IEvtSelector::Context &ctxt) const override
virtual StatusCode next (IEvtSelector::Context &ctxt, int jump) const override
virtual StatusCode previous (IEvtSelector::Context &ctxt) const override
virtual StatusCode previous (IEvtSelector::Context &ctxt, int jump) const override
virtual StatusCode last (IEvtSelector::Context &ctxt) const override
virtual StatusCode rewind (IEvtSelector::Context &ctxt) const override
virtual StatusCode createAddress (const IEvtSelector::Context &ctxt, IOpaqueAddress *&iop) const override
virtual StatusCode releaseContext (IEvtSelector::Context *&ctxt) const override
virtual StatusCode resetCriteria (const std::string &criteria, IEvtSelector::Context &ctxt) const override
 Set a selection criteria.
virtual StatusCode seek (Context &ctxt, int evtnum) const override
 Seek to a given event number.
virtual int curEvent (const Context &ctxt) const override
 Return the current event number.
virtual int size (Context &ctxt) const override
 Return the size of the collection.
virtual StatusCode makeServer (int num) override
 Make this a server.
virtual StatusCode makeClient (int num) override
 Make this a client.
virtual StatusCode share (int evtnum) override
 Request to share a given event number.
virtual StatusCode readEvent (int maxevt) override
 Read the next maxevt events.
virtual StatusCode io_reinit () override
 Callback method to reinitialize the internal state of the component for I/O purposes (e.g. upon fork(2)).
virtual StatusCode io_finalize () override
 Callback method to finalize the internal state of the component for I/O purposes (e.g. before fork(2)).
virtual void handle (const Incident &incident) override
 Incident service handle listening for BeginProcessing and EndProcessing.

Protected Member Functions

virtual StatusCode nextHandleFileTransition (IEvtSelector::Context &ctxt) const override
 Handle file transition at the next iteration.
virtual StatusCode nextWithSkip (IEvtSelector::Context &ctxt) const override
 Go to next event and skip if necessary.
virtual StatusCode recordAttributeList () const override
 Record AttributeList in StoreGate.
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.
virtual bool disconnectIfFinished (const SG::SourceID &fid) const override

Private Types

typedef std::mutex CallMutex

Private Member Functions

StoreGateSvceventStore () const
 Return pointer to active event SG.
StatusCode reinit () const
 Reinitialize the service when a fork() occurred/was-issued.
std::unique_ptr< PoolCollectionConvertergetCollectionCnv (bool throwIncidents=false) const
 Return pointer to new PoolCollectionConverter.
int findEvent (int evtNum) const
 Search for event with number evtNum.
void inputCollectionsHandler (Gaudi::Details::PropertyBase &)

Private Attributes

EventContextAthenaPoolm_endIter {}
std::unique_ptr< PoolCollectionConverter > m_poolCollectionConverter ATLAS_THREAD_SAFE {}
pool::ICollectionCursor *m_headerIterator ATLAS_THREAD_SAFE {}
Guid m_guid ATLAS_THREAD_SAFE {}
std::map< SG::SourceID, int > m_activeEventsPerSource ATLAS_THREAD_SAFE
std::optional< InputFileIncidentGuard > m_inputFileGuard ATLAS_THREAD_SAFE
 RAII guard: guarantees a matching EndInputFile for every BeginInputFile.
ServiceHandle< IAthenaPoolCnvSvcm_athenaPoolCnvSvc {this, "ConversionService", "AthenaPoolCnvSvc", ""}
ServiceHandle< IIncidentSvc > m_incidentSvc {this, "IncidentSvc", "IncidentSvc", ""}
Gaudi::Property< bool > m_isSecondary {this, "IsSecondary", false, ""}
 IsSecondary, know if this is an instance of secondary event selector.
Gaudi::Property< bool > m_processMetadata {this, "ProcessMetadata", true, ""}
 ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default = true.
Gaudi::Property< std::string > m_collectionType {this, "CollectionType", "ImplicitCollection", ""}
 CollectionType, type of the collection: default = "ImplicitCollection".
std::string m_attrListKey {"Input"}
 AttributeList SG key.
Gaudi::Property< std::vector< std::string > > m_inputCollectionsProp {this, "InputCollections", {}, ""}
 InputCollections, vector with names of the input collections.
std::vector< std::string >::const_iterator m_inputCollectionsIterator ATLAS_THREAD_SAFE
bool m_inputCollectionsChanged ATLAS_THREAD_SAFE
 flag to notify the EvSel that the inputs were changed and reinit() needs to be called ASAP
Gaudi::Property< bool > m_keepInputFilesOpen {this, "KeepInputFilesOpen", false, ""}
 KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false.
ToolHandleArray< IAthenaSelectorTool > m_helperTools ATLAS_THREAD_SAFE {this, "HelperTools", {}, ""}
 HelperTools, vector of names of AlgTools that are executed by the EventSelector.
ToolHandle< IAthenaSelectorToolm_counterTool {this, "CounterTool", "", ""}
ToolHandle< IAthenaIPCToolm_eventStreamingTool {this, "SharedMemoryTool", "", ""}
Gaudi::Property< int > m_makeStreamingToolClient {this, "MakeStreamingToolClient",0}
 Make this instance a Streaming Client during first iteration automatically.
Gaudi::CheckedProperty< uint32_t > m_runNo {this, "RunNumber", 0, ""}
 The following are included for compatibility with McEventSelector and are not really used.
Gaudi::CheckedProperty< uint32_t > m_oldRunNo {this, "OldRunNumber", 0, ""}
Gaudi::Property< bool > m_overrideRunNumber {this, "OverrideRunNumber", false, ""}
Gaudi::Property< bool > m_overrideRunNumberFromInput {this, "OverrideRunNumberFromInput", false, ""}
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, ""}
std::atomic_long m_curCollection {}
std::vector< int > m_numEvt ATLAS_THREAD_SAFE
std::vector< int > m_firstEvt ATLAS_THREAD_SAFE
Gaudi::Property< int > m_skipEvents {this, "SkipEvents", 0, ""}
 SkipEvents, numbers of events to skip: default = 0.
Gaudi::Property< std::vector< long > > m_skipEventSequenceProp {this, "SkipEventSequence", {}, ""}
Gaudi::Property< std::string > m_skipEventRangesProp {this, "SkipEventRanges", {}, ""}
 Skip Events - comma separated list of event to skip, ranges with '-': <start> - <end>.
std::vector< std::pair< long, long > > m_skipEventRanges ATLAS_THREAD_SAFE
std::atomic_int m_evtCount {}
std::atomic_bool m_firedIncident {}
CallMutex m_callLock
SG::SlotSpecificObj< SG::SourceIDm_sourceID

Friends

class DoubleEventSelectorAthenaPool
 make the DoubleEventSelectorAthenaPool a friend so it can access the internal EventSelectorAthenaPool methods and members

Detailed Description

This class is the EventSelector for event data.

Definition at line 51 of file EventSelectorAthenaPool.h.

Member Typedef Documentation

◆ CallMutex

typedef std::mutex EventSelectorAthenaPool::CallMutex
private

Definition at line 241 of file EventSelectorAthenaPool.h.

Constructor & Destructor Documentation

◆ EventSelectorAthenaPool()

EventSelectorAthenaPool::EventSelectorAthenaPool ( const std::string & name,
ISvcLocator * pSvcLocator )

Standard Service Constructor.

Definition at line 56 of file EventSelectorAthenaPool.cxx.

56 :
57 base_class(name, pSvcLocator)
58{
59 // TODO: validate if those are even used
60 m_runNo.verifier().setLower(0);
61 m_oldRunNo.verifier().setLower(0);
62 m_eventsPerRun.verifier().setLower(0);
63 m_firstEventNo.verifier().setLower(1);
64 m_firstLBNo.verifier().setLower(0);
65 m_eventsPerLB.verifier().setLower(0);
66 m_initTimeStamp.verifier().setLower(0);
67
69 m_inputCollectionsChanged = false;
70}
Gaudi::CheckedProperty< uint64_t > m_firstEventNo
Gaudi::CheckedProperty< uint32_t > m_initTimeStamp
void inputCollectionsHandler(Gaudi::Details::PropertyBase &)
Gaudi::CheckedProperty< uint64_t > m_eventsPerRun
Gaudi::CheckedProperty< uint32_t > m_eventsPerLB
Gaudi::CheckedProperty< uint32_t > m_oldRunNo
Gaudi::Property< std::vector< std::string > > m_inputCollectionsProp
InputCollections, vector with names of the input collections.
Gaudi::CheckedProperty< uint32_t > m_runNo
The following are included for compatibility with McEventSelector and are not really used.
Gaudi::CheckedProperty< uint32_t > m_firstLBNo

◆ ~EventSelectorAthenaPool()

EventSelectorAthenaPool::~EventSelectorAthenaPool ( )
virtual

Destructor.

Definition at line 78 of file EventSelectorAthenaPool.cxx.

78 {
79}

Member Function Documentation

◆ createAddress()

StatusCode EventSelectorAthenaPool::createAddress ( const IEvtSelector::Context & ctxt,
IOpaqueAddress *& iop ) const
overridevirtual
Parameters
ctxt[IN] current event context.
iop[OUT] pointer to IOpaqueAddress reference of selection context.

Definition at line 675 of file EventSelectorAthenaPool.cxx.

676 {
677 std::string tokenStr;
678 SG::ReadHandle<AthenaAttributeList> attrList(m_attrListKey, eventStore()->name());
679 if (attrList.isValid()) {
680 try {
681 tokenStr = (*attrList)["eventRef"].data<std::string>();
682 ATH_MSG_DEBUG("found AthenaAttribute, name = eventRef = " << tokenStr);
683 } catch (std::exception &e) {
684 ATH_MSG_ERROR(e.what());
685 return StatusCode::FAILURE;
686 }
687 } else {
688 ATH_MSG_WARNING("Cannot find AthenaAttribute, key = " << m_attrListKey);
689 tokenStr = m_headerIterator->eventRef().toString();
690 }
691 auto token = std::make_unique<Token>();
692 token->fromString(tokenStr);
693 iop = new TokenAddress(pool::POOL_StorageType.type(), ClassID_traits<DataHeader>::ID(), "", "EventSelector", IPoolSvc::kInputStream, std::move(token));
694 return StatusCode::SUCCESS;
695}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
StoreGateSvc * eventStore() const
Return pointer to active event SG.
std::string m_attrListKey
AttributeList SG key.
@ kInputStream
Definition IPoolSvc.h:40
static const DbType POOL_StorageType
Definition DbType.h:84

◆ createContext()

StatusCode EventSelectorAthenaPool::createContext ( IEvtSelector::Context *& ctxt) const
overridevirtual

create context

Definition at line 373 of file EventSelectorAthenaPool.cxx.

373 {
374 ctxt = new EventContextAthenaPool(this);
375 return StatusCode::SUCCESS;
376}

◆ curEvent()

int EventSelectorAthenaPool::curEvent ( const Context & ctxt) const
overridevirtual

Return the current event number.

Parameters
ctxt[IN/OUT] current event context.

Definition at line 768 of file EventSelectorAthenaPool.cxx.

768 {
769 return(m_evtCount);
770}

◆ disconnectIfFinished()

bool EventSelectorAthenaPool::disconnectIfFinished ( const SG::SourceID & fid) const
overrideprotectedvirtual

Definition at line 1132 of file EventSelectorAthenaPool.cxx.

1133{
1134 if( m_eventStreamingTool.empty() && m_activeEventsPerSource.find(fid) != m_activeEventsPerSource.end()
1135 && m_activeEventsPerSource[fid] <= 0 && m_guid != fid ) {
1136 // Explicitly disconnect file corresponding to old FID to release memory.
1137 // EndInputFile is handled by the InputFileIncidentGuard.
1138 if( !m_keepInputFilesOpen.value() ) {
1139 ATH_MSG_INFO("Disconnecting input sourceID: " << fid );
1140 m_athenaPoolCnvSvc->getPoolSvc()->disconnectDb("FID:" + fid, IPoolSvc::kInputStream).ignore();
1141 m_activeEventsPerSource.erase( fid );
1142 return true;
1143 }
1144 }
1145 return false;
1146}
#define ATH_MSG_INFO(x)
ToolHandle< IAthenaIPCTool > m_eventStreamingTool
ServiceHandle< IAthenaPoolCnvSvc > m_athenaPoolCnvSvc
Gaudi::Property< bool > m_keepInputFilesOpen
KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false...

◆ eventStore()

StoreGateSvc * EventSelectorAthenaPool::eventStore ( ) const
private

Return pointer to active event SG.

Definition at line 81 of file EventSelectorAthenaPool.cxx.

81 {
83}
static StoreGateSvc * currentStoreGate()
get current StoreGate

◆ fillAttributeList()

StatusCode EventSelectorAthenaPool::fillAttributeList ( coral::AttributeList * attrList,
const std::string & suffix,
bool copySource ) const
overrideprotectedvirtual

Fill AttributeList with specific items from the selector and a suffix.

Definition at line 996 of file EventSelectorAthenaPool.cxx.

997{
998 const auto& row = m_headerIterator->currentRow();
999 attrList->extend( row.tokenName() + suffix, "string" );
1000 (*attrList)[ row.tokenName() + suffix ].data<std::string>() = row.token().toString();
1001 ATH_MSG_DEBUG("record AthenaAttribute, name = " << row.tokenName() + suffix << " = " << row.token().toString() << ".");
1002
1003 std::string eventRef = "eventRef";
1004 if (m_isSecondary.value()) {
1005 eventRef.append(suffix);
1006 }
1007 attrList->extend(eventRef, "string");
1008 (*attrList)[eventRef].data<std::string>() = m_headerIterator->eventRef().toString();
1009 ATH_MSG_DEBUG("record AthenaAttribute, name = " + eventRef + " = " << m_headerIterator->eventRef().toString() << ".");
1010
1011 if (copySource) {
1012 const coral::AttributeList& sourceAttrList = m_headerIterator->currentRow().attributeList();
1013 for (const auto &attr : sourceAttrList) {
1014 attrList->extend(attr.specification().name() + suffix, attr.specification().type());
1015 (*attrList)[attr.specification().name() + suffix] = attr;
1016 }
1017 }
1018
1019 return StatusCode::SUCCESS;
1020}
Gaudi::Property< bool > m_isSecondary
IsSecondary, know if this is an instance of secondary event selector.
row
Appending html table to final .html summary file.

◆ finalize()

StatusCode EventSelectorAthenaPool::finalize ( )
overridevirtual

Definition at line 352 of file EventSelectorAthenaPool.cxx.

352 {
353 if (m_eventStreamingTool.empty() || !m_eventStreamingTool->isClient()) {
354 if (!m_counterTool.empty() && !m_counterTool->preFinalize().isSuccess()) {
355 ATH_MSG_WARNING("Failed to preFinalize() CounterTool");
356 }
357 for (auto& tool : m_helperTools) {
358 if (!tool->preFinalize().isSuccess()) {
359 ATH_MSG_WARNING("Failed to preFinalize() " << tool->name());
360 }
361 }
362 }
363 delete m_endIter; m_endIter = nullptr;
364 m_headerIterator = nullptr;
365 if (m_poolCollectionConverter) {
366 m_poolCollectionConverter.reset();
367 }
368 // Finalize the Service base class.
369 return ::AthService::finalize();
370}
ToolHandle< IAthenaSelectorTool > m_counterTool
EventContextAthenaPool * m_endIter

◆ findEvent()

int EventSelectorAthenaPool::findEvent ( int evtNum) const
private

Search for event with number evtNum.

Definition at line 776 of file EventSelectorAthenaPool.cxx.

776 {
777 for (std::size_t i = 0, imax = m_numEvt.size(); i < imax; i++) {
778 if (m_numEvt[i] == -1) {
779 PoolCollectionConverter pcc(m_collectionType.value(),
780 m_inputCollectionsProp.value()[i],
782 m_athenaPoolCnvSvc->getPoolSvc());
783 if (!pcc.initialize().isSuccess()) {
784 break;
785 }
786 int collection_size = 0;
787 if (pcc.isValid()) {
788 pool::ICollectionCursor* hi = &pcc.selectAll();
789 collection_size = hi->size();
790 }
791 if (i > 0) {
792 m_firstEvt[i] = m_firstEvt[i - 1] + m_numEvt[i - 1];
793 } else {
794 m_firstEvt[i] = 0;
795 }
796 m_numEvt[i] = collection_size;
797 }
798 if (evtNum >= m_firstEvt[i] && evtNum < m_firstEvt[i] + m_numEvt[i]) {
799 return(i);
800 }
801 }
802 return(-1);
803}
int imax(int i, int j)
Gaudi::Property< std::string > m_collectionType
CollectionType, type of the collection: default = "ImplicitCollection".
virtual std::size_t size()=0
Returns the size of the collection.

◆ getCollectionCnv()

std::unique_ptr< PoolCollectionConverter > EventSelectorAthenaPool::getCollectionCnv ( bool throwIncidents = false) const
private

Return pointer to new PoolCollectionConverter.

Definition at line 938 of file EventSelectorAthenaPool.cxx.

938 {
939 while (m_inputCollectionsIterator != m_inputCollectionsProp.value().end()) {
940 if (m_curCollection != 0) {
941 m_numEvt[m_curCollection] = m_evtCount - m_firstEvt[m_curCollection];
943 m_firstEvt[m_curCollection] = m_evtCount;
944 }
945 ATH_MSG_DEBUG("Try item: \"" << *m_inputCollectionsIterator << "\" from the collection list.");
946 auto pCollCnv = std::make_unique<PoolCollectionConverter>(m_collectionType.value(),
947 *m_inputCollectionsIterator,
949 m_athenaPoolCnvSvc->getPoolSvc());
950 StatusCode status = pCollCnv->initialize();
951 if (!status.isSuccess()) {
952 // Close previous collection.
953 pCollCnv.reset();
954 if (!status.isRecoverable()) {
955 ATH_MSG_ERROR("Unable to initialize PoolCollectionConverter.");
956 throw GaudiException("Unable to read: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
957 } else {
958 ATH_MSG_ERROR("Unable to open: " << *m_inputCollectionsIterator);
959 throw GaudiException("Unable to open: " + *m_inputCollectionsIterator, name(), StatusCode::FAILURE);
960 }
961 } else {
962 if (!pCollCnv->isValid().isSuccess()) {
963 pCollCnv.reset();
964 ATH_MSG_DEBUG("No events found in: " << *m_inputCollectionsIterator << " skipped!!!");
965 if (throwIncidents && m_processMetadata.value()) {
966 // Scoped guard: fires BeginInputFile now, EndInputFile at scope exit
968 *m_inputCollectionsIterator, {},
969 "eventless " + *m_inputCollectionsIterator);
970 }
971 m_athenaPoolCnvSvc->getPoolSvc()->disconnectDb(*m_inputCollectionsIterator).ignore();
972 ++m_inputCollectionsIterator;
973 } else {
974 return(pCollCnv);
975 }
976 }
977 }
978 return(nullptr);
979}
Gaudi::Property< bool > m_processMetadata
ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default...
ServiceHandle< IIncidentSvc > m_incidentSvc
static InputFileIncidentGuard begin(IIncidentSvc &incSvc, std::string_view source, std::string_view beginFileName, std::string_view guid, std::string_view endFileName={}, std::string_view beginType=IncidentType::BeginInputFile, std::string_view endType=IncidentType::EndInputFile)
Factory: fire the begin incident and return a guard whose destructor fires the matching end incident.
::StatusCode StatusCode
StatusCode definition for legacy code.
status
Definition merge.py:16

◆ handle()

void EventSelectorAthenaPool::handle ( const Incident & incident)
overridevirtual

Incident service handle listening for BeginProcessing and EndProcessing.

Reimplemented in DoubleEventSelectorAthenaPool.

Definition at line 1091 of file EventSelectorAthenaPool.cxx.

1092{
1093 SG::SourceID fid;
1094 if (inc.type() == IncidentType::BeginProcessing) {
1095 if ( Atlas::hasExtendedEventContext(inc.context()) ) {
1096 fid = Atlas::getExtendedEventContext(inc.context()).proxy()->sourceID();
1097 }
1098 *m_sourceID.get(inc.context()) = fid;
1099 }
1100 else {
1101 fid = *m_sourceID.get(inc.context());
1102 }
1103
1104 if( fid.empty() ) {
1105 ATH_MSG_WARNING("could not read event source ID from incident event context");
1106 return;
1107 }
1108 if( m_activeEventsPerSource.find( fid ) == m_activeEventsPerSource.end()) {
1109 ATH_MSG_DEBUG("Incident handler ignoring unknown input FID: " << fid );
1110 return;
1111 }
1112 ATH_MSG_DEBUG("** MN Incident handler " << inc.type() << " Event source ID=" << fid );
1113 if( inc.type() == IncidentType::BeginProcessing ) {
1114 // increment the events-per-file counter for FID
1115 m_activeEventsPerSource[fid]++;
1116 } else if( inc.type() == IncidentType::EndProcessing ) {
1117 m_activeEventsPerSource[fid]--;
1118 disconnectIfFinished( fid );
1119 *m_sourceID.get(inc.context()) = "";
1120 }
1121 if( msgLvl(MSG::DEBUG) ) {
1122 for( auto& source: m_activeEventsPerSource )
1123 msg(MSG::DEBUG) << "SourceID: " << source.first << " active events: " << source.second << endmsg;
1124 }
1125}
#define endmsg
SG::SlotSpecificObj< SG::SourceID > m_sourceID
virtual bool disconnectIfFinished(const SG::SourceID &fid) const override
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.
MsgStream & msg
Definition testRead.cxx:32

◆ initialize()

StatusCode EventSelectorAthenaPool::initialize ( )
overridevirtual

Required of all Gaudi Services.

Reimplemented in DoubleEventSelectorAthenaPool.

Definition at line 85 of file EventSelectorAthenaPool.cxx.

85 {
86
87 m_autoRetrieveTools = false;
88 m_checkToolDeps = false;
89
90 if (m_isSecondary.value()) {
91 ATH_MSG_DEBUG("Initializing secondary event selector " << name());
92 } else {
93 ATH_MSG_DEBUG("Initializing " << name());
94 }
95
96 ATH_CHECK(::AthService::initialize());
97 // Check for input collection
98 if (m_inputCollectionsProp.value().empty()) {
99 ATH_MSG_FATAL("Use the property: EventSelector.InputCollections = "
100 << "[ \"<collectionName>\" ] (list of collections)");
101 return StatusCode::FAILURE;
102 }
103 boost::char_separator<char> sep_coma(","), sep_hyph("-");
104 boost::tokenizer ranges(m_skipEventRangesProp.value(), sep_coma);
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);
109 long to = from;
110 if( ++from_iter != fromto.end() ) {
111 to = std::stol(*from_iter);
112 }
113 m_skipEventRanges.emplace_back(from, to);
114 }
115
116 for( auto v : m_skipEventSequenceProp.value() ) {
117 m_skipEventRanges.emplace_back(v, v);
118 }
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);
126 }
127 if( !skip_ranges_str.empty() )
128 ATH_MSG_DEBUG("Events to skip: " << skip_ranges_str);
129 }
130 // Get IncidentSvc
131 ATH_CHECK(m_incidentSvc.retrieve());
132 // Listen to the Event Processing incidents
133 if (m_eventStreamingTool.empty()) {
134 m_incidentSvc->addListener(this, IncidentType::BeginProcessing, 0);
135 m_incidentSvc->addListener(this, IncidentType::EndProcessing, 0);
136 }
137
138 // Get AthenaPoolCnvSvc
139 ATH_CHECK(m_athenaPoolCnvSvc.retrieve());
140 // Get CounterTool (if configured)
141 if (!m_counterTool.empty()) {
142 ATH_CHECK(m_counterTool.retrieve());
143 }
144 // Get HelperTools
145 ATH_CHECK(m_helperTools.retrieve());
146 // Get SharedMemoryTool (if configured)
147 if (!m_eventStreamingTool.empty() && !m_eventStreamingTool.retrieve().isSuccess()) {
148 ATH_MSG_FATAL("Cannot get " << m_eventStreamingTool.typeAndName() << "");
149 return StatusCode::FAILURE;
150 } else if (m_makeStreamingToolClient.value() == -1) {
151 std::string dummyStr;
152 ATH_CHECK(m_eventStreamingTool->makeClient(m_makeStreamingToolClient.value(), dummyStr));
153 }
154
155 // Ensure the xAODCnvSvc is listed in the EventPersistencySvc
156 ServiceHandle<IProperty> epSvc("EventPersistencySvc", name());
157 std::vector<std::string> propVal;
158 ATH_CHECK(Gaudi::Parsers::parse(propVal , epSvc->getProperty("CnvServices").toString()));
159 bool foundCnvSvc = false;
160 for (const auto& property : propVal) {
161 if (property == m_athenaPoolCnvSvc.type()) { foundCnvSvc = true; }
162 }
163 if (!foundCnvSvc) {
164 propVal.push_back(m_athenaPoolCnvSvc.type());
165 if (!epSvc->setProperty("CnvServices", Gaudi::Utils::toString(propVal)).isSuccess()) {
166 ATH_MSG_FATAL("Cannot set EventPersistencySvc Property for CnvServices");
167 return StatusCode::FAILURE;
168 }
169 }
170
171 // Register this service for 'I/O' events
172 ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
173 ATH_CHECK(iomgr.retrieve());
174 ATH_CHECK(iomgr->io_register(this));
175 // Register input file's names with the I/O manager
176 const std::vector<std::string>& incol = m_inputCollectionsProp.value();
177 bool allGood = true;
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 !");
181 allGood = false;
182 } else {
183 ATH_MSG_VERBOSE("io_register[" << this->name() << "](" << inputCollection << ") [ok]");
184 }
185 }
186 if (!allGood) {
187 return StatusCode::FAILURE;
188 }
189
190 // Connect to PersistencySvc
191 if (!m_athenaPoolCnvSvc->getPoolSvc()->connect(pool::ITransaction::READ, IPoolSvc::kInputStream).isSuccess()) {
192 ATH_MSG_FATAL("Cannot connect to POOL PersistencySvc.");
193 return StatusCode::FAILURE;
194 }
195 // Jump to reinit() to execute common init/reinit actions
196 m_guid = Guid::null();
197 return reinit();
198}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< std::vector< long > > m_skipEventSequenceProp
StatusCode reinit() const
Reinitialize the service when a fork() occurred/was-issued.
Gaudi::Property< int > m_makeStreamingToolClient
Make this instance a Streaming Client during first iteration automatically.
Gaudi::Property< std::string > m_skipEventRangesProp
Skip Events - comma separated list of event to skip, ranges with '-': <start> - <end>.
static const Guid & null() noexcept
NULL-Guid: static class method.
Definition Guid.cxx:14
int r
Definition globals.cxx:22
CONT to(RANGE &&r)
Definition ranges.h:39
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
bool allGood
Loop over the SDOs & Digits.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ inputCollectionsHandler()

void EventSelectorAthenaPool::inputCollectionsHandler ( Gaudi::Details::PropertyBase & )
private

Definition at line 72 of file EventSelectorAthenaPool.cxx.

72 {
73 if (this->FSMState() != Gaudi::StateMachine::OFFLINE) {
74 m_inputCollectionsChanged = true;
75 }
76}

◆ io_finalize()

StatusCode EventSelectorAthenaPool::io_finalize ( )
overridevirtual

Callback method to finalize the internal state of the component for I/O purposes (e.g. before fork(2)).

Definition at line 1074 of file EventSelectorAthenaPool.cxx.

1074 {
1075 ATH_MSG_INFO("I/O finalization...");
1076 // Fire EndInputFile before disconnecting — file data is still accessible here
1077 m_inputFileGuard.reset();
1078 if (m_poolCollectionConverter) {
1079 m_poolCollectionConverter->disconnectDb().ignore();
1080 m_poolCollectionConverter.reset();
1081 }
1082 return StatusCode::SUCCESS;
1083}

◆ io_reinit()

StatusCode EventSelectorAthenaPool::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 1022 of file EventSelectorAthenaPool.cxx.

1022 {
1023 ATH_MSG_INFO("I/O reinitialization...");
1024 if (m_poolCollectionConverter) {
1025 m_poolCollectionConverter->disconnectDb().ignore();
1026 m_poolCollectionConverter.reset();
1027 }
1028 m_headerIterator = nullptr;
1029 ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
1030 if (!iomgr.retrieve().isSuccess()) {
1031 ATH_MSG_FATAL("Could not retrieve IoComponentMgr !");
1032 return StatusCode::FAILURE;
1033 }
1034 if (!iomgr->io_hasitem(this)) {
1035 ATH_MSG_FATAL("IoComponentMgr does not know about myself !");
1036 return StatusCode::FAILURE;
1037 }
1038 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
1039 m_guid = Guid::null();
1040 return(this->reinit());
1041 }
1042 std::vector<std::string> inputCollections = m_inputCollectionsProp.value();
1043 std::set<std::size_t> updatedIndexes;
1044 for (std::size_t i = 0, imax = m_inputCollectionsProp.value().size(); i < imax; i++) {
1045 if (updatedIndexes.find(i) != updatedIndexes.end()) continue;
1046 std::string savedName = inputCollections[i];
1047 std::string &fname = inputCollections[i];
1048 if (!iomgr->io_contains(this, fname)) {
1049 ATH_MSG_ERROR("IoComponentMgr does not know about [" << fname << "] !");
1050 return StatusCode::FAILURE;
1051 }
1052 if (!iomgr->io_retrieve(this, fname).isSuccess()) {
1053 ATH_MSG_FATAL("Could not retrieve new value for [" << fname << "] !");
1054 return StatusCode::FAILURE;
1055 }
1056 if (savedName != fname) {
1057 ATH_MSG_DEBUG("Mapping value for [" << savedName << "] to [" << fname << "]");
1058 m_athenaPoolCnvSvc->getPoolSvc()->renamePfn(savedName, fname);
1059 }
1060 updatedIndexes.insert(i);
1061 for (std::size_t j = i + 1; j < imax; j++) {
1062 if (inputCollections[j] == savedName) {
1064 updatedIndexes.insert(j);
1065 }
1066 }
1067 }
1068 // all good... copy over.
1070 m_guid = Guid::null();
1071 return reinit();
1072}
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ last()

StatusCode EventSelectorAthenaPool::last ( IEvtSelector::Context & ctxt) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is interated to last event.

Definition at line 661 of file EventSelectorAthenaPool.cxx.

661 {
662 if (ctxt.identifier() == m_endIter->identifier()) {
663 ATH_MSG_DEBUG("last(): Last event in InputStream.");
664 return StatusCode::SUCCESS;
665 }
666 return StatusCode::FAILURE;
667}

◆ makeClient()

StatusCode EventSelectorAthenaPool::makeClient ( int num)
overridevirtual

Make this a client.

Definition at line 831 of file EventSelectorAthenaPool.cxx.

831 {
832 IDataShare* ds = dynamic_cast<IDataShare*>(m_athenaPoolCnvSvc.get());
833 if (ds == nullptr) {
834 ATH_MSG_ERROR("Cannot cast AthenaPoolCnvSvc to DataShare");
835 return StatusCode::FAILURE;
836 }
837 if (ds->makeClient(num + 1).isFailure()) {
838 ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to DataStreaming client");
839 return StatusCode::FAILURE;
840 }
841 if (m_eventStreamingTool.empty()) {
842 return StatusCode::SUCCESS;
843 }
844 ATH_MSG_DEBUG("makeClient: " << m_eventStreamingTool << " = " << num);
845 std::string dummyStr;
846 return(m_eventStreamingTool->makeClient(0, dummyStr));
847}

◆ makeServer()

StatusCode EventSelectorAthenaPool::makeServer ( int num)
overridevirtual

Make this a server.

Definition at line 806 of file EventSelectorAthenaPool.cxx.

806 {
807 IDataShare* ds = dynamic_cast<IDataShare*>(m_athenaPoolCnvSvc.get());
808 if (ds == nullptr) {
809 ATH_MSG_ERROR("Cannot cast AthenaPoolCnvSvc to DataShare");
810 return StatusCode::FAILURE;
811 }
812 if (num < 0) {
813 if (ds->makeServer(num - 1).isFailure()) {
814 ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to output DataStreaming server");
815 }
816 return StatusCode::SUCCESS;
817 }
818 if (ds->makeServer(num + 1).isFailure()) {
819 ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to input DataStreaming server");
820 return StatusCode::FAILURE;
821 }
822 if (m_eventStreamingTool.empty()) {
823 return StatusCode::SUCCESS;
824 }
825 m_processMetadata = false;
826 ATH_MSG_DEBUG("makeServer: " << m_eventStreamingTool << " = " << num);
827 return(m_eventStreamingTool->makeServer(1, ""));
828}

◆ next() [1/2]

StatusCode EventSelectorAthenaPool::next ( IEvtSelector::Context & ctxt) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is interated to next event.

Reimplemented in DoubleEventSelectorAthenaPool.

Definition at line 378 of file EventSelectorAthenaPool.cxx.

378 {
379 std::lock_guard<CallMutex> lockGuard(m_callLock);
380 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
381 if (m_makeStreamingToolClient.value() == -1) {
383 while (sc.isRecoverable()) {
384 usleep(1000);
385 sc = m_eventStreamingTool->lockEvent(m_evtCount);
386 }
387 }
388 // Increase event count
389 ++m_evtCount;
390 void* tokenStr = nullptr;
391 unsigned int status = 0;
392 StatusCode sc = m_eventStreamingTool->getLockedEvent(&tokenStr, status);
393 if (sc.isRecoverable()) {
394 delete [] (char*)tokenStr; tokenStr = nullptr;
395 // Return end iterator
396 ctxt = *m_endIter;
397 // This is not a real failure but a Gaudi way of handling "end of job"
398 return StatusCode::FAILURE;
399 }
400 if (sc.isFailure()) {
401 ATH_MSG_FATAL("Cannot get NextEvent from AthenaSharedMemoryTool");
402 delete [] (char*)tokenStr; tokenStr = nullptr;
403 return StatusCode::FAILURE;
404 }
405 if (!eventStore()->clearStore().isSuccess()) {
406 ATH_MSG_WARNING("Cannot clear Store");
407 }
408 std::unique_ptr<AthenaAttributeList> athAttrList(new AthenaAttributeList());
409 athAttrList->extend("eventRef", "string");
410 (*athAttrList)["eventRef"].data<std::string>() = std::string((char*)tokenStr);
411 SG::WriteHandle<AthenaAttributeList> wh(m_attrListKey, eventStore()->name());
412 if (!wh.record(std::move(athAttrList)).isSuccess()) {
413 delete [] (char*)tokenStr; tokenStr = nullptr;
414 ATH_MSG_ERROR("Cannot record AttributeList to StoreGate " << StoreID::storeName(eventStore()->storeID()));
415 return StatusCode::FAILURE;
416 }
417 Token token;
418 token.fromString(std::string((char*)tokenStr));
419 delete [] (char*)tokenStr; tokenStr = nullptr;
420 Guid guid = token.dbID();
421 if (guid != m_guid && m_processMetadata.value()) {
423 "FID:" + guid.toString(), guid.toString(),
424 /*endFileName=*/{});
425 m_guid = guid;
426 }
427 return StatusCode::SUCCESS;
428 }
429 for (const auto& tool : m_helperTools) {
430 if (!tool->preNext().isSuccess()) {
431 ATH_MSG_WARNING("Failed to preNext() " << tool->name());
432 }
433 }
434 for (;;) {
435 // Handle possible file transition
437 if (sc.isRecoverable()) {
438 continue; // handles empty files
439 }
440 if (sc.isFailure()) {
441 return StatusCode::FAILURE;
442 }
443 // Increase event count
444 ++m_evtCount;
445 if (!m_counterTool.empty() && !m_counterTool->preNext().isSuccess()) {
446 ATH_MSG_WARNING("Failed to preNext() CounterTool.");
447 }
449 && (m_skipEventRanges.empty() || m_evtCount < m_skipEventRanges.front().first))
450 {
451 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isServer()) {
452 IDataShare* ds = dynamic_cast<IDataShare*>(m_athenaPoolCnvSvc.get());
453 if (ds == nullptr) {
454 ATH_MSG_ERROR("Cannot cast AthenaPoolCnvSvc to DataShare");
455 return StatusCode::FAILURE;
456 }
457 std::string token = m_headerIterator->eventRef().toString();
459 while ( (sc = putEvent_ST(*m_eventStreamingTool,
460 m_evtCount - 1, token.c_str(),
461 token.length() + 1, 0)).isRecoverable() ) {
462 while (ds->readData().isSuccess()) {
463 ATH_MSG_VERBOSE("Called last readData, while putting next event in next()");
464 }
465 // Nothing to do right now, trigger alternative (e.g. caching) here? Currently just fast loop.
466 }
467 if (!sc.isSuccess()) {
468 ATH_MSG_ERROR("Cannot put Event " << m_evtCount - 1 << " to AthenaSharedMemoryTool");
469 return StatusCode::FAILURE;
470 }
471 } else {
472 if (!m_isSecondary.value()) {
473 if (!eventStore()->clearStore().isSuccess()) {
474 ATH_MSG_WARNING("Cannot clear Store");
475 }
476 if (!recordAttributeList().isSuccess()) {
477 ATH_MSG_ERROR("Failed to record AttributeList.");
478 return StatusCode::FAILURE;
479 }
480 }
481 }
482 StatusCode status = StatusCode::SUCCESS;
483 for (const auto& tool : m_helperTools) {
484 StatusCode toolStatus = tool->postNext();
485 if (toolStatus.isRecoverable()) {
486 ATH_MSG_INFO("Request skipping event from: " << tool->name());
487 if (status.isSuccess()) {
488 status = StatusCode::RECOVERABLE;
489 }
490 } else if (toolStatus.isFailure()) {
491 ATH_MSG_WARNING("Failed to postNext() " << tool->name());
492 status = StatusCode::FAILURE;
493 }
494 }
495 if (status.isRecoverable()) {
496 ATH_MSG_INFO("skipping event " << m_evtCount);
497 } else if (status.isFailure()) {
498 ATH_MSG_WARNING("Failed to postNext() HelperTool.");
499 } else {
500 if (!m_counterTool.empty() && !m_counterTool->postNext().isSuccess()) {
501 ATH_MSG_WARNING("Failed to postNext() CounterTool.");
502 }
503 break;
504 }
505 } else {
506 while( !m_skipEventRanges.empty() && m_evtCount >= m_skipEventRanges.front().second ) {
507 m_skipEventRanges.erase(m_skipEventRanges.begin());
508 }
509 ATH_MSG_INFO("skipping event " << m_evtCount);
510 }
511 }
512 return StatusCode::SUCCESS;
513}
static Double_t sc
Gaudi::Property< int > m_skipEvents
SkipEvents, numbers of events to skip: default = 0.
virtual StatusCode nextHandleFileTransition(IEvtSelector::Context &ctxt) const override
Handle file transition at the next iteration.
virtual StatusCode recordAttributeList() const override
Record AttributeList in StoreGate.
static void transition(std::optional< InputFileIncidentGuard > &guard, IIncidentSvc &incSvc, std::string_view source, std::string_view beginFileName, std::string_view guid, std::string_view endFileName={}, std::string_view beginType=IncidentType::BeginInputFile, std::string_view endType=IncidentType::EndInputFile)
Replace the guard in an optional, with strict End-before-Begin ordering.
static const std::string & storeName(const StoreID::type &s)
Definition StoreID.cxx:77
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition Token.cxx:134
Token & fromString(const std::string_view from)
Build from the string representation of a token.
Definition Token.cxx:147
const Guid & dbID() const
Access database identifier.
Definition Token.h:64
str wh
Definition parseDir.py:45

◆ next() [2/2]

StatusCode EventSelectorAthenaPool::next ( IEvtSelector::Context & ctxt,
int jump ) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is interated to next event.
jump[IN] number of events to jump (currently not supported).

Reimplemented in DoubleEventSelectorAthenaPool.

Definition at line 515 of file EventSelectorAthenaPool.cxx.

515 {
516 if (jump > 0) {
517 for (int i = 0; i < jump; i++) {
518 ATH_CHECK(next(ctxt));
519 }
520 return StatusCode::SUCCESS;
521 }
522 return StatusCode::FAILURE;
523}
virtual StatusCode next(IEvtSelector::Context &ctxt) const override

◆ nextHandleFileTransition()

StatusCode EventSelectorAthenaPool::nextHandleFileTransition ( IEvtSelector::Context & ctxt) const
overrideprotectedvirtual

Handle file transition at the next iteration.

Definition at line 525 of file EventSelectorAthenaPool.cxx.

526{
527 if( m_inputCollectionsChanged ) {
528 StatusCode rc = reinit();
529 if( rc != StatusCode::SUCCESS ) return rc;
530 }
531 else { // advance to the next (not needed after reinit)
532 // Check if we're at the end of file
533 if (m_headerIterator == nullptr || m_headerIterator->next() == 0) {
534 m_headerIterator = nullptr;
535 // Close previous collection.
536 m_poolCollectionConverter.reset();
537
538 // Fire EndInputFile while data is still accessible, then disconnect
539 m_inputFileGuard.reset();
540 const SG::SourceID old_guid = m_guid.toString();
541 m_guid = Guid::null();
542 disconnectIfFinished( old_guid );
543
544 // check if somebody updated Inputs in the EOF incident (like VP1 does)
545 if( m_inputCollectionsChanged ) {
546 StatusCode rc = reinit();
547 if( rc != StatusCode::SUCCESS ) return rc;
548 } else {
549 // Open next file from inputCollections list.
550 ++m_inputCollectionsIterator;
551 // Create PoolCollectionConverter for input file
552 m_poolCollectionConverter = getCollectionCnv(true);
553 if (!m_poolCollectionConverter) {
554 // Return end iterator
555 ctxt = *m_endIter;
556 // This is not a real failure but a Gaudi way of handling "end of job"
557 return StatusCode::FAILURE;
558 }
559 // Get DataHeader iterator
560 m_headerIterator = &m_poolCollectionConverter->selectAll();
561
562 // Return RECOVERABLE to mark we should still continue
563 return StatusCode::RECOVERABLE;
564 }
565 }
566 }
567 const Token& headRef = m_headerIterator->eventRef();
568 const Guid guid = headRef.dbID();
569 const int tech = headRef.technology();
570 ATH_MSG_VERBOSE("next(): DataHeder Token=" << headRef.toString() );
571
572 if (guid != m_guid) {
573 // we are starting reading from a new DB. Check if the old one needs to be retired
574 if (m_guid != Guid::null()) {
575 // zero the current DB ID (m_guid) before trying disconnect() to indicate it is no longer in use
576 const SG::SourceID old_guid = m_guid.toString();
577 m_guid = Guid::null();
578 // EndInputFile is fired by the guard transition() below; just disconnect here
579 disconnectIfFinished( old_guid );
580 }
581 m_guid = guid;
582 m_activeEventsPerSource[guid.toString()] = 0;
583 // Fire BeginInputFile incident if current InputCollection is a payload file;
584 // otherwise, ascertain whether the pointed-to file is reachable before firing any incidents and/or proceeding
585 if (m_collectionType.value() == "ImplicitCollection") {
586 // For now, we can only deal with input metadata from POOL files, but we know we have a POOL file here
587 if (!m_athenaPoolCnvSvc->setInputAttributes(*m_inputCollectionsIterator).isSuccess()) {
588 ATH_MSG_ERROR("Failed to set input attributes.");
589 return StatusCode::FAILURE;
590 }
591 if (m_processMetadata.value()) {
593 *m_inputCollectionsIterator, m_guid.toString(),
594 /*endFileName=*/{});
595 }
596 } else {
597 // Check if File is BS
598 if (tech != 0x00001000 && m_processMetadata.value()) {
600 "FID:" + m_guid.toString(), m_guid.toString(),
601 /*endFileName=*/{});
602 }
603 }
604 } // end if (guid != m_guid)
605 return StatusCode::SUCCESS;
606}
static Double_t rc
std::unique_ptr< PoolCollectionConverter > getCollectionCnv(bool throwIncidents=false) const
Return pointer to new PoolCollectionConverter.
int technology() const
Access technology type.
Definition Token.h:77

◆ nextWithSkip()

StatusCode EventSelectorAthenaPool::nextWithSkip ( IEvtSelector::Context & ctxt) const
overrideprotectedvirtual

Go to next event and skip if necessary.

Definition at line 608 of file EventSelectorAthenaPool.cxx.

608 {
609 ATH_MSG_DEBUG("EventSelectorAthenaPool::nextWithSkip");
610
611 for (;;) {
612 // Check if we're at the end of file
614 if (sc.isRecoverable()) {
615 continue; // handles empty files
616 }
617 if (sc.isFailure()) {
618 return StatusCode::FAILURE;
619 }
620
621 // Increase event count
622 ++m_evtCount;
623
624 if (!m_counterTool.empty() && !m_counterTool->preNext().isSuccess()) {
625 ATH_MSG_WARNING("Failed to preNext() CounterTool.");
626 }
628 && (m_skipEventRanges.empty() || m_evtCount < m_skipEventRanges.front().first))
629 {
630 return StatusCode::SUCCESS;
631 } else {
632 while( !m_skipEventRanges.empty() && m_evtCount >= m_skipEventRanges.front().second ) {
633 m_skipEventRanges.erase(m_skipEventRanges.begin());
634 }
635 if (m_isSecondary.value()) {
636 ATH_MSG_INFO("skipping secondary event " << m_evtCount);
637 } else {
638 ATH_MSG_INFO("skipping event " << m_evtCount);
639 }
640 }
641 }
642
643 return StatusCode::SUCCESS;
644}

◆ previous() [1/2]

StatusCode EventSelectorAthenaPool::previous ( IEvtSelector::Context & ctxt) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is interated to previous event.

Definition at line 646 of file EventSelectorAthenaPool.cxx.

646 {
647 ATH_MSG_ERROR("previous() not implemented");
648 return StatusCode::FAILURE;
649}

◆ previous() [2/2]

StatusCode EventSelectorAthenaPool::previous ( IEvtSelector::Context & ctxt,
int jump ) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is interated to previous event.
jump[IN] number of events to jump (currently not supported).

Definition at line 651 of file EventSelectorAthenaPool.cxx.

651 {
652 if (jump > 0) {
653 for (int i = 0; i < jump; i++) {
654 ATH_CHECK(previous(ctxt));
655 }
656 return StatusCode::SUCCESS;
657 }
658 return StatusCode::FAILURE;
659}
virtual StatusCode previous(IEvtSelector::Context &ctxt) const override

◆ readEvent()

StatusCode EventSelectorAthenaPool::readEvent ( int maxevt)
overridevirtual

Read the next maxevt events.

Parameters
evtnum[IN] The number of events to read.

Definition at line 883 of file EventSelectorAthenaPool.cxx.

883 {
884 IDataShare* ds = dynamic_cast<IDataShare*>(m_athenaPoolCnvSvc.get());
885 if (ds == nullptr) {
886 ATH_MSG_ERROR("Cannot cast AthenaPoolCnvSvc to DataShare");
887 return StatusCode::FAILURE;
888 }
889 if (m_eventStreamingTool.empty()) {
890 ATH_MSG_ERROR("No AthenaSharedMemoryTool configured for readEvent()");
891 return StatusCode::FAILURE;
892 }
893 ATH_MSG_VERBOSE("Called read Event " << maxevt);
894 IEvtSelector::Context* ctxt = new EventContextAthenaPool(this);
895 for (int i = 0; i < maxevt || maxevt == -1; ++i) {
896 if (!next(*ctxt).isSuccess()) {
897 if (m_evtCount == -1) {
898 ATH_MSG_VERBOSE("Called read Event and read last event from input: " << i);
899 break;
900 }
901 ATH_MSG_ERROR("Cannot read Event " << m_evtCount - 1 << " into AthenaSharedMemoryTool");
902 delete ctxt; ctxt = nullptr;
903 return StatusCode::FAILURE;
904 } else {
905 ATH_MSG_VERBOSE("Called next, read Event " << m_evtCount - 1);
906 }
907 }
908 delete ctxt; ctxt = nullptr;
909 // End of file, wait for last event to be taken
911 while ( (sc = putEvent_ST(*m_eventStreamingTool, 0, 0, 0, 0)).isRecoverable() ) {
912 while (ds->readData().isSuccess()) {
913 ATH_MSG_VERBOSE("Called last readData, while marking last event in readEvent()");
914 }
915 usleep(1000);
916 }
917 if (!sc.isSuccess()) {
918 ATH_MSG_ERROR("Cannot put last Event marker to AthenaSharedMemoryTool");
919 return StatusCode::FAILURE;
920 } else {
921 sc = ds->readData();
922 while (sc.isSuccess() || sc.isRecoverable()) {
923 sc = ds->readData();
924 }
925 ATH_MSG_DEBUG("Failed last readData -> Clients are stopped, after marking last event in readEvent()");
926 }
927 return StatusCode::SUCCESS;
928}

◆ recordAttributeList()

StatusCode EventSelectorAthenaPool::recordAttributeList ( ) const
overrideprotectedvirtual

Record AttributeList in StoreGate.

Reimplemented in DoubleEventSelectorAthenaPool.

Definition at line 981 of file EventSelectorAthenaPool.cxx.

981 {
982 // Get access to AttributeList
983 ATH_MSG_DEBUG("Get AttributeList from the collection");
984 // MN: accessing only attribute list, ignoring token list
985 const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
986 ATH_MSG_DEBUG("AttributeList size " << attrList.size());
987 std::unique_ptr<AthenaAttributeList> athAttrList(new AthenaAttributeList(attrList));
988 // Fill the new attribute list
989 ATH_CHECK(fillAttributeList(athAttrList.get(), "", false));
990 // Write the AttributeList
991 SG::WriteHandle<AthenaAttributeList> wh(m_attrListKey, eventStore()->name());
992 ATH_CHECK(wh.record(std::move(athAttrList)));
993 return StatusCode::SUCCESS;
994}
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.

◆ reinit()

StatusCode EventSelectorAthenaPool::reinit ( ) const
private

Reinitialize the service when a fork() occurred/was-issued.

Definition at line 200 of file EventSelectorAthenaPool.cxx.

200 {
201 ATH_MSG_DEBUG("reinitialization...");
202
203 // reset markers
204 m_numEvt.resize(m_inputCollectionsProp.value().size(), -1);
205 m_firstEvt.resize(m_inputCollectionsProp.value().size(), -1);
206
207 // Initialize InputCollectionsIterator
208 m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
209 m_curCollection = 0;
210 if (!m_firstEvt.empty()) {
211 m_firstEvt[0] = 0;
212 }
213 m_inputCollectionsChanged = false;
214 m_evtCount = 0;
215 m_headerIterator = 0;
216 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
217 ATH_MSG_INFO("Done reinitialization for shared reader client");
218 return StatusCode::SUCCESS;
219 }
220 bool retError = false;
221 for (auto& tool : m_helperTools) {
222 if (!tool->postInitialize().isSuccess()) {
223 ATH_MSG_FATAL("Failed to postInitialize() " << tool->name());
224 retError = true;
225 }
226 }
227 if (retError) {
228 ATH_MSG_FATAL("Failed to postInitialize() helperTools");
229 return StatusCode::FAILURE;
230 }
231
232 // Create an m_poolCollectionConverter to read the objects in
233 m_poolCollectionConverter = getCollectionCnv();
234 if (!m_poolCollectionConverter) {
235 ATH_MSG_INFO("No Events found in any Input Collections");
236 if (m_processMetadata.value()) {
237 m_inputCollectionsIterator = m_inputCollectionsProp.value().end();
238 if (!m_inputCollectionsProp.value().empty()) --m_inputCollectionsIterator;
239 //NOTE (wb may 2016): this will make the FirstInputFile incident correspond to last file in the collection ... if want it to be first file then move iterator to begin and then move above two lines below this incident firing
240 if (m_collectionType.value() == "ImplicitCollection" && !m_firedIncident && !m_inputCollectionsProp.value().empty()) {
241 FileIncident firstInputFileIncident(name(), "FirstInputFile", *m_inputCollectionsIterator);
242 m_incidentSvc->fireIncident(firstInputFileIncident);
243 m_firedIncident = true;
244 }
245 }
246 return StatusCode::SUCCESS;
247 }
248 // Get DataHeader iterator
249 try {
250 m_headerIterator = &m_poolCollectionConverter->selectAll();
251 } catch (std::exception &e) {
252 ATH_MSG_FATAL("Cannot open implicit collection - check data/software version.");
253 ATH_MSG_ERROR(e.what());
254 return StatusCode::FAILURE;
255 }
256 while (m_headerIterator == nullptr || m_headerIterator->next() == 0) { // no selected events
257 if (m_poolCollectionConverter) {
258 m_poolCollectionConverter->disconnectDb().ignore();
259 m_poolCollectionConverter.reset();
260 }
261 ++m_inputCollectionsIterator;
262 m_poolCollectionConverter = getCollectionCnv();
263 if (m_poolCollectionConverter) {
264 m_headerIterator = &m_poolCollectionConverter->selectAll();
265 } else {
266 break;
267 }
268 }
269 if (!m_poolCollectionConverter || m_headerIterator == nullptr) { // no event selected in any collection
270 m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
271 m_curCollection = 0;
272 m_poolCollectionConverter = getCollectionCnv();
273 if (!m_poolCollectionConverter) {
274 return StatusCode::SUCCESS;
275 }
276 m_headerIterator = &m_poolCollectionConverter->selectAll();
277 while (m_headerIterator == nullptr || m_headerIterator->next() == 0) { // empty collection
278 if (m_poolCollectionConverter) {
279 m_poolCollectionConverter->disconnectDb().ignore();
280 m_poolCollectionConverter.reset();
281 }
282 ++m_inputCollectionsIterator;
283 m_poolCollectionConverter = getCollectionCnv();
284 if (m_poolCollectionConverter) {
285 m_headerIterator = &m_poolCollectionConverter->selectAll();
286 } else {
287 break;
288 }
289 }
290 }
291 if (!m_poolCollectionConverter || m_headerIterator == nullptr) {
292 return StatusCode::SUCCESS;
293 }
294 const Token& headRef = m_headerIterator->eventRef();
295 const std::string fid = headRef.dbID().toString();
296 const int tech = headRef.technology();
297 ATH_MSG_VERBOSE("reinit(): First DataHeder Token=" << headRef.toString() );
298
299 // Check if File is BS, for which Incident is thrown by SingleEventInputSvc
300 if (tech != 0x00001000 && m_processMetadata.value() && !m_firedIncident) {
301 FileIncident firstInputFileIncident(name(), "FirstInputFile", "FID:" + fid, fid);
302 m_incidentSvc->fireIncident(firstInputFileIncident);
303 m_firedIncident = true;
304 }
305 return StatusCode::SUCCESS;
306}
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.

◆ releaseContext()

StatusCode EventSelectorAthenaPool::releaseContext ( IEvtSelector::Context *& ctxt) const
overridevirtual
Parameters
ctxt[IN] current event context is released.

Definition at line 697 of file EventSelectorAthenaPool.cxx.

697 {
698 return StatusCode::SUCCESS;
699}

◆ resetCriteria()

StatusCode EventSelectorAthenaPool::resetCriteria ( const std::string & criteria,
IEvtSelector::Context & ctxt ) const
overridevirtual

Set a selection criteria.

Parameters
criteriafilter predicate (SQL-style WHERE clause)
ctxt[IN] current event context.

Definition at line 701 of file EventSelectorAthenaPool.cxx.

702 {
703 return StatusCode::SUCCESS;
704}

◆ rewind()

StatusCode EventSelectorAthenaPool::rewind ( IEvtSelector::Context & ctxt) const
overridevirtual
Parameters
ctxt[IN/OUT] current event context is rewound to first event.

Definition at line 669 of file EventSelectorAthenaPool.cxx.

669 {
670 ATH_CHECK(reinit());
671 ctxt = EventContextAthenaPool(this);
672 return StatusCode::SUCCESS;
673}

◆ seek()

StatusCode EventSelectorAthenaPool::seek ( Context & ctxt,
int evtnum ) const
overridevirtual

Seek to a given event number.

Parameters
ctxt[IN/OUT] current event context.
evtnum[IN] The event number to which to seek.

Reimplemented in DoubleEventSelectorAthenaPool.

Definition at line 706 of file EventSelectorAthenaPool.cxx.

706 {
707
708 if( m_inputCollectionsChanged ) {
709 StatusCode rc = reinit();
710 if( rc != StatusCode::SUCCESS ) return rc;
711 }
712
713 long newColl = findEvent(evtNum);
714 if (newColl == -1 && evtNum >= m_firstEvt[m_curCollection] && evtNum < m_evtCount - 1) {
715 newColl = m_curCollection;
716 }
717 if (newColl == -1) {
718 m_headerIterator = nullptr;
719 ATH_MSG_INFO("seek: Reached end of Input.");
720 m_inputFileGuard.reset();
721 return StatusCode::RECOVERABLE;
722 }
723 if (newColl != m_curCollection) {
724 if (!m_keepInputFilesOpen.value() && m_poolCollectionConverter) {
725 m_poolCollectionConverter->disconnectDb().ignore();
726 }
727 m_poolCollectionConverter.reset();
728 m_curCollection = newColl;
729 try {
730 ATH_MSG_DEBUG("Seek to item: \""
732 << "\" from the collection list.");
733 // Reset input collection iterator to the right place
734 m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
735 m_inputCollectionsIterator += m_curCollection;
736 m_poolCollectionConverter = std::make_unique<PoolCollectionConverter>(m_collectionType.value(),
739 m_athenaPoolCnvSvc->getPoolSvc());
740 if (!m_poolCollectionConverter->initialize().isSuccess()) {
741 m_headerIterator = nullptr;
742 ATH_MSG_ERROR("seek: Unable to initialize PoolCollectionConverter.");
743 return StatusCode::FAILURE;
744 }
745 // Create DataHeader iterators
746 m_headerIterator = &m_poolCollectionConverter->selectAll();
747 EventContextAthenaPool* beginIter = new EventContextAthenaPool(this);
748 m_evtCount = m_firstEvt[m_curCollection];
749 next(*beginIter).ignore();
750 ATH_MSG_DEBUG("Token " << m_headerIterator->eventRef().toString());
751 } catch (std::exception &e) {
752 m_headerIterator = nullptr;
753 ATH_MSG_ERROR(e.what());
754 return StatusCode::FAILURE;
755 }
756 }
757
758 if (m_headerIterator->seek(evtNum - m_firstEvt[m_curCollection]) == 0) {
759 m_headerIterator = nullptr;
760 ATH_MSG_ERROR("Did not find event, evtNum = " << evtNum);
761 return StatusCode::FAILURE;
762 } else {
763 m_evtCount = evtNum + 1;
764 }
765 return StatusCode::SUCCESS;
766}
int findEvent(int evtNum) const
Search for event with number evtNum.

◆ share()

StatusCode EventSelectorAthenaPool::share ( int evtnum)
overridevirtual

Request to share a given event number.

Parameters
evtnum[IN] The event number to share.

Definition at line 850 of file EventSelectorAthenaPool.cxx.

850 {
851 IDataShare* ds = dynamic_cast<IDataShare*>(m_athenaPoolCnvSvc.get());
852 if (ds == nullptr) {
853 ATH_MSG_ERROR("Cannot cast AthenaPoolCnvSvc to DataShare");
854 return StatusCode::FAILURE;
855 }
856 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
857 StatusCode sc = m_eventStreamingTool->lockEvent(evtnum);
858 while (sc.isRecoverable()) {
859 usleep(1000);
860 sc = m_eventStreamingTool->lockEvent(evtnum);
861 }
862// Send stop client and wait for restart
863 if (sc.isFailure()) {
864 if (ds->makeClient(0).isFailure()) {
865 return StatusCode::FAILURE;
866 }
867 sc = m_eventStreamingTool->lockEvent(evtnum);
868 while (sc.isRecoverable() || sc.isFailure()) {
869 usleep(1000);
870 sc = m_eventStreamingTool->lockEvent(evtnum);
871 }
872//FIXME
873 if (ds->makeClient(1).isFailure()) {
874 return StatusCode::FAILURE;
875 }
876 }
877 return(sc);
878 }
879 return StatusCode::FAILURE;
880}

◆ size()

int EventSelectorAthenaPool::size ( Context & ctxt) const
overridevirtual

Return the size of the collection.

Parameters
ctxt[IN/OUT] current event context.

Reimplemented in DoubleEventSelectorAthenaPool.

Definition at line 931 of file EventSelectorAthenaPool.cxx.

931 {
932 // Fetch sizes of all collections.
933 findEvent(-1);
934 return std::accumulate(m_numEvt.begin(), m_numEvt.end(), 0);
935}

◆ start()

StatusCode EventSelectorAthenaPool::start ( )
overridevirtual

Definition at line 308 of file EventSelectorAthenaPool.cxx.

308 {
309 if (m_poolCollectionConverter) {
310 // Reset iterators and apply new query
311 m_poolCollectionConverter->disconnectDb().ignore();
312 m_poolCollectionConverter.reset();
313 }
314 m_inputCollectionsIterator = m_inputCollectionsProp.value().begin();
315 m_curCollection = 0;
316 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
317 return StatusCode::SUCCESS;
318 }
319 m_poolCollectionConverter = getCollectionCnv(true);
320 if (!m_poolCollectionConverter) {
321 ATH_MSG_INFO("No Events found in any Input Collections");
322 m_inputCollectionsIterator = m_inputCollectionsProp.value().end();
323 if (!m_inputCollectionsProp.value().empty()) {
324 --m_inputCollectionsIterator; //leave iterator in state of last input file
325 }
326 } else {
327 m_headerIterator = &m_poolCollectionConverter->selectAll();
328 }
329 m_evtCount = 0;
330 delete m_endIter;
331 m_endIter = nullptr;
332 m_endIter = new EventContextAthenaPool(nullptr);
333 return StatusCode::SUCCESS;
334}

◆ stop()

StatusCode EventSelectorAthenaPool::stop ( )
overridevirtual

Definition at line 336 of file EventSelectorAthenaPool.cxx.

336 {
337 if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) {
338 return StatusCode::SUCCESS;
339 }
340 // Fire EndInputFile for any file still open (the event loop may end
341 // before the file is fully read).
342 m_inputFileGuard.reset();
343
344 IEvtSelector::Context* ctxt(nullptr);
345 if (!releaseContext(ctxt).isSuccess()) {
346 ATH_MSG_WARNING("Cannot release context");
347 }
348 return StatusCode::SUCCESS;
349}
virtual StatusCode releaseContext(IEvtSelector::Context *&ctxt) const override

◆ DoubleEventSelectorAthenaPool

friend class DoubleEventSelectorAthenaPool
friend

make the DoubleEventSelectorAthenaPool a friend so it can access the internal EventSelectorAthenaPool methods and members

Definition at line 248 of file EventSelectorAthenaPool.h.

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/11]

std::vector<std::pair<long,long> > m_skipEventRanges EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 236 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [2/11]

std::vector<int> m_firstEvt EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 229 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [3/11]

std::vector<int> m_numEvt EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 228 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [4/11]

ToolHandleArray<IAthenaSelectorTool> m_helperTools EventSelectorAthenaPool::ATLAS_THREAD_SAFE {this, "HelperTools", {}, ""}
mutableprivate

HelperTools, vector of names of AlgTools that are executed by the EventSelector.

Definition at line 205 of file EventSelectorAthenaPool.h.

205{this, "HelperTools", {}, ""};

◆ ATLAS_THREAD_SAFE [5/11]

bool m_inputCollectionsChanged EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivate

flag to notify the EvSel that the inputs were changed and reinit() needs to be called ASAP

Definition at line 198 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [6/11]

std::vector<std::string>::const_iterator m_inputCollectionsIterator EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 195 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [7/11]

std::optional<InputFileIncidentGuard> m_inputFileGuard EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivate

RAII guard: guarantees a matching EndInputFile for every BeginInputFile.

Definition at line 177 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [8/11]

std::map<SG::SourceID, int> m_activeEventsPerSource EventSelectorAthenaPool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 175 of file EventSelectorAthenaPool.h.

◆ ATLAS_THREAD_SAFE [9/11]

Guid m_guid EventSelectorAthenaPool::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 174 of file EventSelectorAthenaPool.h.

174{};

◆ ATLAS_THREAD_SAFE [10/11]

pool::ICollectionCursor* m_headerIterator EventSelectorAthenaPool::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 173 of file EventSelectorAthenaPool.h.

173{};

◆ ATLAS_THREAD_SAFE [11/11]

std::unique_ptr<PoolCollectionConverter> m_poolCollectionConverter EventSelectorAthenaPool::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 172 of file EventSelectorAthenaPool.h.

172{};

◆ m_athenaPoolCnvSvc

ServiceHandle<IAthenaPoolCnvSvc> EventSelectorAthenaPool::m_athenaPoolCnvSvc {this, "ConversionService", "AthenaPoolCnvSvc", ""}
private

Definition at line 179 of file EventSelectorAthenaPool.h.

179{this, "ConversionService", "AthenaPoolCnvSvc", ""};

◆ m_attrListKey

std::string EventSelectorAthenaPool::m_attrListKey {"Input"}
private

AttributeList SG key.

Definition at line 191 of file EventSelectorAthenaPool.h.

191{"Input"};

◆ m_callLock

CallMutex EventSelectorAthenaPool::m_callLock
mutableprivate

Definition at line 242 of file EventSelectorAthenaPool.h.

◆ m_collectionType

Gaudi::Property<std::string> EventSelectorAthenaPool::m_collectionType {this, "CollectionType", "ImplicitCollection", ""}
private

CollectionType, type of the collection: default = "ImplicitCollection".

Definition at line 188 of file EventSelectorAthenaPool.h.

188{this, "CollectionType", "ImplicitCollection", ""};

◆ m_counterTool

ToolHandle<IAthenaSelectorTool> EventSelectorAthenaPool::m_counterTool {this, "CounterTool", "", ""}
private

Definition at line 206 of file EventSelectorAthenaPool.h.

206{this, "CounterTool", "", ""};

◆ m_curCollection

std::atomic_long EventSelectorAthenaPool::m_curCollection {}
mutableprivate

Definition at line 227 of file EventSelectorAthenaPool.h.

227{};

◆ m_endIter

EventContextAthenaPool* EventSelectorAthenaPool::m_endIter {}
private

Definition at line 170 of file EventSelectorAthenaPool.h.

170{};

◆ m_eventsPerLB

Gaudi::CheckedProperty<uint32_t> EventSelectorAthenaPool::m_eventsPerLB {this, "EventsPerLB", 1000, ""}
private

Definition at line 223 of file EventSelectorAthenaPool.h.

223{this, "EventsPerLB", 1000, ""};

◆ m_eventsPerRun

Gaudi::CheckedProperty<uint64_t> EventSelectorAthenaPool::m_eventsPerRun {this, "EventsPerRun", 1000000, ""}
private

Definition at line 221 of file EventSelectorAthenaPool.h.

221{this, "EventsPerRun", 1000000, ""};

◆ m_eventStreamingTool

ToolHandle<IAthenaIPCTool> EventSelectorAthenaPool::m_eventStreamingTool {this, "SharedMemoryTool", "", ""}
private

Definition at line 207 of file EventSelectorAthenaPool.h.

207{this, "SharedMemoryTool", "", ""};

◆ m_evtCount

std::atomic_int EventSelectorAthenaPool::m_evtCount {}
mutableprivate

Definition at line 238 of file EventSelectorAthenaPool.h.

238{}; // internal count of events

◆ m_firedIncident

std::atomic_bool EventSelectorAthenaPool::m_firedIncident {}
mutableprivate

Definition at line 239 of file EventSelectorAthenaPool.h.

239{};

◆ m_firstEventNo

Gaudi::CheckedProperty<uint64_t> EventSelectorAthenaPool::m_firstEventNo {this, "FirstEvent", 1, ""}
private

Definition at line 219 of file EventSelectorAthenaPool.h.

219{this, "FirstEvent", 1, ""};

◆ m_firstLBNo

Gaudi::CheckedProperty<uint32_t> EventSelectorAthenaPool::m_firstLBNo {this, "FirstLB", 0, ""}
private

Definition at line 222 of file EventSelectorAthenaPool.h.

222{this, "FirstLB", 0, ""};

◆ m_incidentSvc

ServiceHandle<IIncidentSvc> EventSelectorAthenaPool::m_incidentSvc {this, "IncidentSvc", "IncidentSvc", ""}
private

Definition at line 180 of file EventSelectorAthenaPool.h.

180{this, "IncidentSvc", "IncidentSvc", ""};

◆ m_initTimeStamp

Gaudi::CheckedProperty<uint32_t> EventSelectorAthenaPool::m_initTimeStamp {this, "InitialTimeStamp", 0, ""}
private

Definition at line 224 of file EventSelectorAthenaPool.h.

224{this, "InitialTimeStamp", 0, ""};

◆ m_inputCollectionsProp

Gaudi::Property<std::vector<std::string> > EventSelectorAthenaPool::m_inputCollectionsProp {this, "InputCollections", {}, ""}
private

InputCollections, vector with names of the input collections.

Definition at line 194 of file EventSelectorAthenaPool.h.

194{this, "InputCollections", {}, ""};

◆ m_isSecondary

Gaudi::Property<bool> EventSelectorAthenaPool::m_isSecondary {this, "IsSecondary", false, ""}
private

IsSecondary, know if this is an instance of secondary event selector.

Definition at line 184 of file EventSelectorAthenaPool.h.

184{this, "IsSecondary", false, ""};

◆ m_keepInputFilesOpen

Gaudi::Property<bool> EventSelectorAthenaPool::m_keepInputFilesOpen {this, "KeepInputFilesOpen", false, ""}
private

KeepInputFilesOpen, boolean flag to keep files open after PoolCollection reaches end: default = false.

Needed for PilUp to run without PoolFileCatalog. Relies on POOL to close files when reaching DB_AGE_LIMIT.

Definition at line 202 of file EventSelectorAthenaPool.h.

202{this, "KeepInputFilesOpen", false, ""};

◆ m_makeStreamingToolClient

Gaudi::Property<int> EventSelectorAthenaPool::m_makeStreamingToolClient {this, "MakeStreamingToolClient",0}
private

Make this instance a Streaming Client during first iteration automatically.

Definition at line 209 of file EventSelectorAthenaPool.h.

209{this, "MakeStreamingToolClient",0};

◆ m_oldRunNo

Gaudi::CheckedProperty<uint32_t> EventSelectorAthenaPool::m_oldRunNo {this, "OldRunNumber", 0, ""}
private

Definition at line 215 of file EventSelectorAthenaPool.h.

215{this, "OldRunNumber", 0, ""};

◆ m_overrideRunNumber

Gaudi::Property<bool> EventSelectorAthenaPool::m_overrideRunNumber {this, "OverrideRunNumber", false, ""}
private

Definition at line 216 of file EventSelectorAthenaPool.h.

216{this, "OverrideRunNumber", false, ""};

◆ m_overrideRunNumberFromInput

Gaudi::Property<bool> EventSelectorAthenaPool::m_overrideRunNumberFromInput {this, "OverrideRunNumberFromInput", false, ""}
private

Definition at line 217 of file EventSelectorAthenaPool.h.

217{this, "OverrideRunNumberFromInput", false, ""};

◆ m_processMetadata

Gaudi::Property<bool> EventSelectorAthenaPool::m_processMetadata {this, "ProcessMetadata", true, ""}
private

ProcessMetadata, switch on firing of FileIncidents which will trigger processing of metadata: default = true.

Definition at line 186 of file EventSelectorAthenaPool.h.

186{this, "ProcessMetadata", true, ""};

◆ m_runNo

Gaudi::CheckedProperty<uint32_t> EventSelectorAthenaPool::m_runNo {this, "RunNumber", 0, ""}
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 214 of file EventSelectorAthenaPool.h.

214{this, "RunNumber", 0, ""};

◆ m_skipEventRangesProp

Gaudi::Property<std::string> EventSelectorAthenaPool::m_skipEventRangesProp {this, "SkipEventRanges", {}, ""}
private

Skip Events - comma separated list of event to skip, ranges with '-': <start> - <end>.

Definition at line 235 of file EventSelectorAthenaPool.h.

235{this, "SkipEventRanges", {}, ""};

◆ m_skipEvents

Gaudi::Property<int> EventSelectorAthenaPool::m_skipEvents {this, "SkipEvents", 0, ""}
private

SkipEvents, numbers of events to skip: default = 0.

Definition at line 232 of file EventSelectorAthenaPool.h.

232{this, "SkipEvents", 0, ""};

◆ m_skipEventSequenceProp

Gaudi::Property<std::vector<long> > EventSelectorAthenaPool::m_skipEventSequenceProp {this, "SkipEventSequence", {}, ""}
private

Definition at line 233 of file EventSelectorAthenaPool.h.

233{this, "SkipEventSequence", {}, ""};

◆ m_sourceID

SG::SlotSpecificObj<SG::SourceID> EventSelectorAthenaPool::m_sourceID
private

Definition at line 244 of file EventSelectorAthenaPool.h.

◆ m_timeStampInterval

Gaudi::Property<uint32_t> EventSelectorAthenaPool::m_timeStampInterval {this, "TimeStampInterval", 0, ""}
private

Definition at line 225 of file EventSelectorAthenaPool.h.

225{this, "TimeStampInterval", 0, ""};

The documentation for this class was generated from the following files: