41 return StatusCode::SUCCESS;
49 std::lock_guard<CallMutex> lockGuard(
m_callLock);
53 for (
const auto& tool : m_helperTools) {
54 if (!tool->preNext().isSuccess()) {
62 return StatusCode::FAILURE;
67 return StatusCode::FAILURE;
73 return StatusCode::FAILURE;
76 StatusCode status = StatusCode::SUCCESS;
77 for (
const auto& tool : m_helperTools) {
78 StatusCode toolStatus = tool->postNext();
79 if (toolStatus.isRecoverable()) {
80 ATH_MSG_INFO(
"Request skipping event from: " << tool->name());
81 if (status.isSuccess()) {
82 status = StatusCode::RECOVERABLE;
84 }
else if (toolStatus.isFailure()) {
86 status = StatusCode::FAILURE;
89 if (status.isRecoverable()) {
91 }
else if (status.isFailure()) {
101 return StatusCode::SUCCESS;
110 for (
int i = 0; i < jump; i++) {
111 if (!
next(ctxt).isSuccess()) {
112 return StatusCode::FAILURE;
115 return StatusCode::SUCCESS;
118 return StatusCode::FAILURE;
129 return StatusCode::SUCCESS;
141 ATH_MSG_WARNING(
"Fewer secondary input events than primary input events. Expect trouble!");
150 ATH_MSG_DEBUG(
"DoubleEventSelectorAthenaPool::recordAttributeList");
155 const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
157 std::unique_ptr<AthenaAttributeList> athAttrList{};
162 athAttrList = std::make_unique<AthenaAttributeList>();
171 athAttrList = std::make_unique<AthenaAttributeList>(attrList);
181 athAttrList->extend(
"hasSecondaryInput",
"bool");
182 (*athAttrList)[
"hasSecondaryInput"].data<
bool>() =
true;
185 ATH_CHECK(wh.record(std::move(athAttrList)));
187 return StatusCode::SUCCESS;
201 if (inc.type() == IncidentType::BeginProcessing) {
212 ATH_MSG_WARNING(
"could not read event source ID from incident event context with key EventSelector");
216 ATH_MSG_DEBUG(
"** MN Incident handler " << inc.type() <<
" Event source ID=" << fid1 );
217 if( inc.type() == IncidentType::BeginProcessing ) {
219 m_activeEventsPerSource[fid1]++;
220 }
else if( inc.type() == IncidentType::EndProcessing ) {
221 m_activeEventsPerSource[fid1]--;
225 if( msgLvl(MSG::DEBUG) ) {
226 for(
auto& source: m_activeEventsPerSource )
227 msg(MSG::DEBUG) <<
"SourceID: " << source.first <<
" active events: " << source.second <<
endmsg;
237 if (inc.type() == IncidentType::BeginProcessing) {
248 ATH_MSG_WARNING(
"could not read event source ID from incident event context with key SecondaryEventSelector");
252 ATH_MSG_DEBUG(
"** MN Incident handler " << inc.type() <<
" Event source ID=" << fid2 );
253 if( inc.type() == IncidentType::BeginProcessing ) {
255 m_activeEventsPerSource[fid2]++;
256 }
else if( inc.type() == IncidentType::EndProcessing ) {
257 m_activeEventsPerSource[fid2]--;
261 if( msgLvl(MSG::DEBUG) ) {
262 for(
auto& source: m_activeEventsPerSource )
263 msg(MSG::DEBUG) <<
"SourceID: " << source.first <<
" active events: " << source.second <<
endmsg;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
This file contains the class definition for the DoubleEventSelectorAthenaPool class.
An AttributeList represents a logical row of attributes in a metadata table.
SG::SlotSpecificObj< SG::SourceID > m_sourceID2
virtual StatusCode next(IEvtSelector::Context &ctxt) const override
Gaudi::Property< std::string > m_secondaryAttrListSuffix
bool m_secondaryByteStream
virtual StatusCode seek(Context &ctxt, int evtNum) const override
Seek to a given event number.
virtual ~DoubleEventSelectorAthenaPool()
Destructor.
virtual void handle(const Incident &incident) override
Incident service handle listening for BeginProcessing and EndProcessing.
virtual StatusCode recordAttributeList() const override
Record AttributeList in StoreGate.
SG::SlotSpecificObj< SG::SourceID > m_sourceID1
virtual StatusCode initialize() override
Initialize function.
virtual int size(Context &ctxt) const override
Return the size of the collection.
ServiceHandle< ISecondaryEventSelector > m_secondarySelector
EventSelectorAthenaPool(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
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.
friend class DoubleEventSelectorAthenaPool
make the DoubleEventSelectorAthenaPool a friend so it can access the internal EventSelectorAthenaPool...
StoreGateSvc * eventStore() const
Return pointer to active event SG.
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.
virtual bool disconnectIfFinished(const SG::SourceID &fid) const override
Disconnect DB if all events from the source FID were processed and the Selector moved to another file...
std::atomic_int m_evtCount
virtual int size(Context &ctxt) const override
Return the size of the collection.
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.