18#include "GaudiKernel/FileIncident.h"
47 return StatusCode::SUCCESS;
55 std::lock_guard<CallMutex> lockGuard(
m_callLock);
59 for (
const auto& tool : m_helperTools) {
60 if (!tool->preNext().isSuccess()) {
68 return StatusCode::FAILURE;
73 return StatusCode::FAILURE;
79 return StatusCode::FAILURE;
82 StatusCode status = StatusCode::SUCCESS;
83 for (
const auto& tool : m_helperTools) {
84 StatusCode toolStatus = tool->postNext();
85 if (toolStatus.isRecoverable()) {
86 ATH_MSG_INFO(
"Request skipping event from: " << tool->name());
87 if (status.isSuccess()) {
88 status = StatusCode::RECOVERABLE;
90 }
else if (toolStatus.isFailure()) {
92 status = StatusCode::FAILURE;
95 if (status.isRecoverable()) {
97 }
else if (status.isFailure()) {
107 return StatusCode::SUCCESS;
116 for (
int i = 0; i < jump; i++) {
117 if (!
next(ctxt).isSuccess()) {
118 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
124 return StatusCode::FAILURE;
135 return StatusCode::SUCCESS;
147 ATH_MSG_WARNING(
"Fewer secondary input events than primary input events. Expect trouble!");
156 ATH_MSG_DEBUG(
"DoubleEventSelectorAthenaPool::recordAttributeList");
161 const coral::AttributeList& attrList = m_headerIterator->currentRow().attributeList();
163 std::unique_ptr<AthenaAttributeList> athAttrList{};
168 athAttrList = std::make_unique<AthenaAttributeList>();
177 athAttrList = std::make_unique<AthenaAttributeList>(attrList);
187 athAttrList->extend(
"hasSecondaryInput",
"bool");
188 (*athAttrList)[
"hasSecondaryInput"].data<
bool>() =
true;
191 ATH_CHECK(wh.record(std::move(athAttrList)));
193 return StatusCode::SUCCESS;
207 if (inc.type() == IncidentType::BeginProcessing) {
218 ATH_MSG_WARNING(
"could not read event source ID from incident event context with key EventSelector");
222 ATH_MSG_DEBUG(
"** MN Incident handler " << inc.type() <<
" Event source ID=" << fid1 );
223 if( inc.type() == IncidentType::BeginProcessing ) {
225 m_activeEventsPerSource[fid1]++;
226 }
else if( inc.type() == IncidentType::EndProcessing ) {
227 m_activeEventsPerSource[fid1]--;
231 if( msgLvl(MSG::DEBUG) ) {
232 for(
auto& source: m_activeEventsPerSource )
233 msg(MSG::DEBUG) <<
"SourceID: " << source.first <<
" active events: " << source.second <<
endmsg;
243 if (inc.type() == IncidentType::BeginProcessing) {
254 ATH_MSG_WARNING(
"could not read event source ID from incident event context with key SecondaryEventSelector");
258 ATH_MSG_DEBUG(
"** MN Incident handler " << inc.type() <<
" Event source ID=" << fid2 );
259 if( inc.type() == IncidentType::BeginProcessing ) {
261 m_activeEventsPerSource[fid2]++;
262 }
else if( inc.type() == IncidentType::EndProcessing ) {
263 m_activeEventsPerSource[fid2]--;
267 if( msgLvl(MSG::DEBUG) ) {
268 for(
auto& source: m_activeEventsPerSource )
269 msg(MSG::DEBUG) <<
"SourceID: " << source.first <<
" active events: " << source.second <<
endmsg;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
This file contains the class definition for the DoubleEventSelectorAthenaPool class.
An AttributeList represents a logical row of attributes in a metadata table.
This file contains the class definition for the PoolCollectionConverter class.
This file contains the class definition for the Token class (migrated from POOL).
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.
Gaudi::Property< std::string > m_attrListKey
AttributeList SG key.
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.
virtual StatusCode seek(Context &ctxt, int evtnum) const override
Seek to a given event number.
virtual bool disconnectIfFinished(const SG::SourceID &fid) const override
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.