17#include "GaudiKernel/IAlgorithm.h"
18#include "GaudiKernel/SmartIF.h"
19#include "GaudiKernel/Incident.h"
20#include "GaudiKernel/DataObject.h"
21#include "GaudiKernel/IIncidentSvc.h"
22#include "GaudiKernel/IDataManagerSvc.h"
23#include "GaudiKernel/IDataProviderSvc.h"
24#include "GaudiKernel/IConversionSvc.h"
25#include "GaudiKernel/GaudiException.h"
26#include "GaudiKernel/AppReturnCode.h"
27#include "GaudiKernel/MsgStream.h"
28#include "GaudiKernel/EventIDBase.h"
29#include "GaudiKernel/ThreadLocalContext.h"
30#include "GaudiKernel/FileIncident.h"
34#include "EventInfo/EventInfo.h"
40#include "tbb/tick_count.h"
41#include <yampl/ISocket.h>
42#include "yampl/SocketFactory.h"
55 leftString(std::string & s,
char sc){
56 bool truncated{
false};
58 if (n!=std::string::npos){
66 leftString(std::string & s,
int n){
67 bool truncated{
false};
68 if (
static_cast<size_t>(n) <
s.size()){
77 , ISvcLocator* svcLoc)
78 : base_class(nam, svcLoc)
99 "Name of Event Selector to use. If empty string (default) "
100 "take value from ApplicationMgr");
102 "Histogram persistency technology to use: ROOT, HBOOK, NONE. "
103 "By default (empty string) get property value from "
106 "histogram write/update interval");
108 "Controls behaviour of event loop depending on return code of"
109 " Algorithms. 0: all non-SUCCESSes terminate job. "
110 "1: RECOVERABLE skips to next event, FAILURE terminates job "
111 "(DEFAULT). 2: RECOVERABLE and FAILURE skip to next events");
113 "Print event heartbeat printouts every m_eventPrintoutInterval events");
114 declareProperty(
"ClearStorePolicy",
116 "Configure the policy wrt handling of when the "
117 "'clear-the-event-store' event shall happen: at EndEvent "
118 "(default as it is makes things easier for memory management"
119 ") or at BeginEvent (easier e.g. for interactive use)");
120 declareProperty(
"PreSelectTools",
m_tools,
"AlgTools for event pre-selection")->
124 "Name of the scheduler to be used");
127 "Name of the Whiteboard to be used");
132 "ServiceHandle for EvtIdModifierSvc");
134 declareProperty(
"FakeLumiBlockInterval",
m_flmbi = 0,
135 "Event interval at which to increment lumiBlock# when "
136 "creating events without an EventSelector. Zero means "
137 "don't increment it");
139 "timestamp interval between events when creating Events "
140 "without an EventSelector");
142 "Require valid input attribute list to be present");
144 "In case of DoubleEventSelector use event number from secondary input");
146 declareProperty(
"ESTestPilotMessages",
m_testPilotMessages,
"List of messages from fake pilot for test mode");
160 StatusCode
sc = MinimalEventLoopMgr::initialize();
161 if(!
sc.isSuccess()) {
162 ATH_MSG_ERROR (
"Failed to initialize base class MinimalEventLoopMgr" );
173 return StatusCode::FAILURE;
178 ATH_MSG_FATAL (
"Error retrieving SchedulerSvc interface ISchedulerSvc." );
179 return StatusCode::FAILURE;
185 return StatusCode::FAILURE;
188 m_aess = serviceLocator()->service(
"AlgExecStateSvc");
191 return StatusCode::FAILURE;
200 SmartIF<IProperty> prpMgr(serviceLocator());
201 if(!prpMgr.isValid()) {
202 ATH_MSG_FATAL (
"IProperty interface not found in ApplicationMgr." );
203 return StatusCode::FAILURE;
209 if(histPersName.empty()) {
213 if(histPersName !=
"NONE") {
218 SmartIF<IProperty> histSvc{serviceLocator()->service(
"RootHistSvc")};
221 ATH_MSG_ERROR (
"could not locate actual Histogram persistency service" );
224 const Gaudi::Details::PropertyBase &prop = histSvc->getProperty(
"OutputFile");
227 const StringProperty &sprop =
dynamic_cast<const StringProperty&
>(prop);
231 ATH_MSG_VERBOSE (
"could not dcast OutputFile property to a StringProperty."
232 " Need to fix Gaudi." );
233 val = prop.toString();
237 && val !=
"UndefinedROOTOutputFileName") {
250 ATH_MSG_DEBUG (
"EventID modifier Service not set. No run number, ... overrides will be applied." );
252 ATH_MSG_DEBUG (
"Could not find EventID modifier Service. No run number, ... overrides will be applied." );
258 const std::string& selName(
m_evtsel.value());
260 if (selName.empty()) {
266 if( !selName.empty() && selName !=
"NONE") {
267 SmartIF<IEvtSelector> theEvtSel{serviceLocator()->service(selName)};
274 ATH_MSG_FATAL (
"Can not create the event selector Context." );
275 return StatusCode::FAILURE;
277 if (msgLevel(MSG::INFO)) {
278 SmartIF<INamedInterface> named{theEvtSel};
280 ATH_MSG_INFO (
"Setup EventSelector service {}", named->name( ) );
284 else if (
sc.isFailure()) {
285 ATH_MSG_FATAL (
"No valid event selector called {}", selName );
286 return StatusCode::FAILURE;
296 return StatusCode::FAILURE;
329 if ( policyName !=
"BeginEvent" &&
330 policyName !=
"EndEvent" ) {
332 ATH_MSG_FATAL (
"Unknown policy [{}] for the 'ClearStore-policy !\n"
333 "Valid values are: BeginEvent, EndEvent",
336 throw GaudiException(
"Can not setup 'ClearStore'-policy",
338 StatusCode::FAILURE);
360 unsigned int toolCtr = 0;
361 for ( ; firstTool != lastTool; ++firstTool )
381 StatusCode
sc = MinimalEventLoopMgr::finalize();
415 unsigned int toolCtr = 0;
416 ATH_MSG_INFO (
"Summary of AthenaEvtLoopPreSelectTool invocation: (invoked/success/failure)" );
417 ATH_MSG_INFO (
"-----------------------------------------------------" );
419 for ( ; firstTool != lastTool; ++firstTool ) {
422 (*firstTool)->name(),
430 return (
sc.isFailure() || sc2.isFailure() ) ? StatusCode::FAILURE :
440 StatusCode
sc (StatusCode::SUCCESS);
443 std::vector<DataObject*> objects;
445 DataObject* obj = reg->object();
446 if ( !obj || obj->clID() == CLID_StatisticsFile )
return false;
447 objects.push_back( obj );
451 if ( !
sc.isSuccess() ) {
452 ATH_MSG_ERROR (
"Error while traversing Histogram data store" );
456 if ( objects.size() > 0) {
459 if (
m_nevt == 1 || force ||
460 (writeInterval != 0 &&
m_nevt%writeInterval == 0) ) {
463 sc = std::accumulate( begin( objects ), end( objects ),
sc, [&]( StatusCode isc,
auto& i ) {
464 IOpaqueAddress* pAddr =
nullptr;
466 if ( iret.isFailure() )
return iret;
467 i->registry()->setAddress( pAddr );
470 sc = std::accumulate( begin( objects ), end( objects ),
sc, [&]( StatusCode isc,
auto& i ) {
471 IRegistry* reg = i->registry();
472 StatusCode iret =
m_histoPersSvc->fillRepRefs( reg->address(), i );
473 return iret.isFailure() ? iret : isc;
475 if ( !
sc.isSuccess() ) {
480 if (force || (writeInterval != 0 &&
m_nevt%writeInterval == 0) ) {
496 return StatusCode::SUCCESS;
504 return StatusCode::SUCCESS;
516 ATH_MSG_ALWAYS (
"A stopRun was requested by an incidentListener. "
517 "Do not process this event." );
519 return (StatusCode::SUCCESS);
525 Gaudi::Hive::setCurrentContext ( ctx );
528 if (declEvtRootSc == 0 ) {
530 return StatusCode::SUCCESS;
531 }
else if ( declEvtRootSc == -1) {
533 ATH_MSG_ERROR (
"declareEventRootAddress for context " << ctx <<
" failed" );
534 return StatusCode::FAILURE;
537 EventID::event_number_t evtNumber = ctx.eventID().event_number();
538 unsigned int conditionsRun = ctx.eventID().run_number();
543 if (attr->exists(
"ConditionsRun")) {
544 conditionsRun = (*attr)[
"ConditionsRun"].data<
unsigned int>();
549 Gaudi::Hive::setCurrentContext ( ctx );
552 if (
m_eventStore->record(std::make_unique<EventContext> (ctx),
553 "EventContext").isFailure())
556 return (StatusCode::FAILURE);
576 bool toolsPassed=
true;
581 unsigned int toolCtr=0;
583 tool_store::iterator theTool =
m_tools.begin();
584 tool_store::iterator lastTool =
m_tools.end();
585 while(toolsPassed && theTool!=lastTool )
587 toolsPassed = (*theTool)->passEvent(ctx.eventID());
599 ATH_MSG_INFO (
" ===>>> start processing event #{}, run #{} on slot {}, {} events processed so far <<<===",
602 ATH_MSG_INFO (
" ===>>> start processing event #{}, run #{} on slot {}, {} events read and {} events processed so far <<<===",
617 ctx.evt(), ctx.slot());
621 StatusCode addEventStatus =
m_schedulerSvc->pushNewEvent(
new EventContext{ std::move(ctx) } );
624 if (!addEventStatus.isSuccess()){
625 ATH_MSG_FATAL (
"An event processing slot should be now free in the scheduler, but it appears not to be the case." );
635 Gaudi::Hive::setCurrentContext( EventContext() );
637 return StatusCode::SUCCESS;
647 if (
sc.isSuccess()) {
658 SmartIF<IProperty> appmgr(serviceLocator());
659 if(Gaudi::setAppReturnCode(appmgr, Gaudi::ReturnCode::ScheduledStop,
true).isFailure()) {
660 ATH_MSG_ERROR (
"Could not set return code of the application ({})",
661 Gaudi::ReturnCode::ScheduledStop);
664 return StatusCode::SUCCESS;
678 StatusCode
sc = MinimalEventLoopMgr::stop();
685 for (
size_t islot = 0; islot < nslot; islot++) {
689 Gaudi::Hive::setCurrentContext( EventContext() );
696 if(maxevt==0)
return StatusCode::SUCCESS;
700 std::unique_ptr<yampl::ISocket>{yampl::SocketFactory().createClientSocket(
711 StatusCode
sc(StatusCode::SUCCESS);
714 auto start_time = tbb::tick_count::now();
715 auto secsFromStart = [&start_time]()->
double{
716 return (tbb::tick_count::now()-start_time).seconds();
719 std::unique_ptr<RangeStruct> range;
725 bool loop_ended = range->eventRangeID.empty();
729 m_incidentSvc->fireIncident(FileIncident(
name(),
"NextEventRange",range->eventRangeID));
732 bool no_more_events =
false;
747 if ( !ctx.valid() ) {
748 sc = StatusCode::FAILURE;
754 if (
sc.isFailure()) {
755 ATH_MSG_ERROR (
"Terminating event processing loop due to errors" );
767 if(range->eventRangeID.empty()) {
768 no_more_events =
true;
773 m_incidentSvc->fireIncident(FileIncident(
name(),
"NextEventRange",range->eventRangeID));
789 sc = StatusCode::FAILURE;
796 sc = StatusCode::SUCCESS;
805 ATH_MSG_INFO (
"---> Loop Finished (seconds): {}", secsFromStart() );
819 ATH_MSG_ERROR (
"Seek failed; unsupported by event selector" );
820 return StatusCode::FAILURE;
825 ATH_MSG_FATAL (
"Can not create the event selector Context." );
826 return StatusCode::FAILURE;
832 if (
sc.isSuccess()) {
857 ATH_MSG_ERROR (
"Collection size unsupported by event selector" );
863 ATH_MSG_FATAL (
"Can not create the event selector Context." );
877 if(inc.type()!=
"BeforeFork")
881 ATH_MSG_WARNING (
"Skipping BeforeFork handler. Either no event selector is provided or begin run has already passed" );
893 IOpaqueAddress* addr = 0;
895 if(!
sc.isSuccess()) {
900 if (
sc.isFailure()) {
907 if(!
sc.isSuccess()) {
920 if(!
sc.isSuccess()) {
932 if(!
sc.isSuccess()) {
944 if ( !
sc.isSuccess() ) {
949 if( !
sc.isSuccess() ) {
951 if (
sc.isSuccess() ) {
953 if ( !
sc.isSuccess() ) {
970 StatusCode
sc(StatusCode::SUCCESS);
975 std::unique_ptr<const EventInfo> pEvent;
983 IOpaqueAddress* addr = 0;
987 ATH_MSG_ERROR (
"Seek failed; unsupported by event selector" );
999 if ( !
sc.isSuccess() ) {
1015 if( !
sc.isSuccess() ) {
1024 bool consume_modifier_stream =
false;
1027 if ( pAttrList !=
nullptr && pAttrList->size() > 6 ) {
1029 unsigned int runNumber = (*pAttrList)[
"RunNumber"].data<
unsigned int>();
1030 unsigned long long eventNumber = (*pAttrList)[
"EventNumber"].data<
unsigned long long>();
1031 unsigned int eventTime = (*pAttrList)[
"EventTime"].data<
unsigned int>();
1032 unsigned int eventTimeNS = (*pAttrList)[
"EventTimeNanoSec"].data<
unsigned int>();
1033 unsigned int lumiBlock = (*pAttrList)[
"LumiBlockN"].data<
unsigned int>();
1034 unsigned int bunchId = (*pAttrList)[
"BunchId"].data<
unsigned int>();
1036 consume_modifier_stream =
true;
1039 unsigned long long eventNumberSecondary{};
1040 if ( !(pAttrList->exists(
"hasSecondaryInput") && (*pAttrList)[
"hasSecondaryInput"].data<
bool>()) ) {
1041 ATH_MSG_FATAL (
"Secondary EventNumber requested, but secondary input does not exist!" );
1044 if ( pAttrList->exists(
"EventNumber_secondary") ) {
1045 eventNumberSecondary = (*pAttrList)[
"EventNumber_secondary"].data<
unsigned long long>();
1051 if (pEventSecondary) {
1052 eventNumberSecondary = pEventSecondary->
event_ID()->event_number();
1055 ATH_MSG_FATAL (
"Secondary EventNumber requested, but it does not exist!" );
1059 if (eventNumberSecondary != 0) {
1061 ATH_MSG_INFO (
" ===>>> using secondary event #{} instead of #{} <<<===",
1062 eventNumberSecondary, eventNumber);
1064 eventNumber = eventNumberSecondary;
1069 pEvent = std::make_unique<EventInfo>(
1070 std::make_unique<EventID>(runNumber, eventNumber, eventTime,
1071 eventTimeNS, lumiBlock, bunchId),
1076 ATH_MSG_FATAL (
"Valid input attribute list required but not present!" );
1084 const EventInfo* pEventObserver{pEvent.get()};
1085 if (!pEventObserver) {
1089 if( !pEventObserver ) {
1094 if( !
sc.isSuccess() ) {
1098 consume_modifier_stream =
true;
1100 pEvent = std::make_unique<EventInfo>(
1103 pEventObserver = pEvent.get();
1105 if( !
sc.isSuccess() ) {
1110 consume_modifier_stream =
false;
1118 consume_modifier_stream, evtModIdx);
1124 unsigned int runNmb{1}, evtNmb{
m_nevt + 1};
1131 auto eid = std::make_unique<EventID> (runNmb,evtNmb,
m_timeStamp);
1133 eid->set_lumi_block( runNmb );
1137 pEvent = std::make_unique<EventInfo>(std::move(eid),
1138 std::make_unique<EventType>());
1147 ATH_MSG_DEBUG (
"recording EventInfo " << *pEvent->event_ID() <<
" in "
1150 if( !
sc.isSuccess() ) {
1161 bool consume_modifier_stream,
1168 m_evtIdModSvc->modify_evtid(new_eID, evtModIdx, consume_modifier_stream);
1169 if (msgLevel(MSG::DEBUG)) {
1170 unsigned int oldrunnr = eID.run_number();
1171 unsigned int oldLB = eID.lumi_block();
1172 unsigned int oldTS = eID.time_stamp();
1173 unsigned int oldTSno = eID.time_stamp_ns_offset();
1174 ATH_MSG_DEBUG (
"modifyEventContext: use evtIdModSvc runnr={} -> {}",
1175 oldrunnr, new_eID.run_number());
1176 ATH_MSG_DEBUG (
"modifyEventContext: use evtIdModSvc LB={} -> {}",
1177 oldLB, new_eID.lumi_block());
1178 ATH_MSG_DEBUG (
"modifyEventContext: use evtIdModSvc TimeStamp={} -> {}",
1179 oldTS, new_eID.time_stamp());
1180 ATH_MSG_DEBUG (
"modifyEventContext: use evtIdModSvc TimeStamp ns Offset={} -> {}",
1181 oldTSno, new_eID.time_stamp_ns_offset());
1183 ctx.setEventID(new_eID);
1185 ctx.eventID().run_number());
1189 ctx.setEventID(eID);
1198 if (
sc.isFailure()) {
1199 ATH_MSG_FATAL (
"Slot {} could not be selected for the WhiteBoard",
1201 return EventContext{};
1205 ATH_MSG_DEBUG (
"created EventContext, num: {} in slot: {}",
1206 ctx.evt(), ctx.slot());
1214 Gaudi::setAppReturnCode(
m_appMgrProperty, Gaudi::ReturnCode::Success,
true).ignore();
1229 StatusCode
sc(StatusCode::SUCCESS);
1232 std::vector<std::unique_ptr<EventContext>> finishedEvtContexts;
1234 EventContext* finishedEvtContext{
nullptr};
1237 ATH_MSG_DEBUG (
"drainScheduler: [{}] Waiting for a context", finishedEvts);
1241 if (
sc.isSuccess()){
1243 ATH_MSG_DEBUG (
"drainScheduler: scheduler not empty: Context "
1244 << finishedEvtContext );
1245 finishedEvtContexts.emplace_back(finishedEvtContext);
1253 while (
m_schedulerSvc->tryPopFinishedEvent(finishedEvtContext).isSuccess()){
1254 finishedEvtContexts.emplace_back(finishedEvtContext);
1259 for (
auto& thisFinishedEvtContext : finishedEvtContexts){
1260 if (!thisFinishedEvtContext) {
1261 ATH_MSG_FATAL (
"Detected nullptr ctxt while clearing WB!");
1266 if (
m_aess->eventStatus(*thisFinishedEvtContext) != EventStatus::Success) {
1267 ATH_MSG_FATAL (
"Failed event detected on " << thisFinishedEvtContext
1268 <<
" w/ fail mode: "
1269 <<
m_aess->eventStatus(*thisFinishedEvtContext) );
1275 EventID::event_number_t n_evt(0);
1277 if (
m_whiteboard->selectStore(thisFinishedEvtContext->slot()).isSuccess()) {
1278 n_run = thisFinishedEvtContext->eventID().run_number();
1279 n_evt = thisFinishedEvtContext->eventID().event_number();
1282 thisFinishedEvtContext->slot() );
1291 Gaudi::Hive::setCurrentContext( *thisFinishedEvtContext );
1293 m_incidentSvc->fireIncident(Incident(
name(), IncidentType::EndProcessing, *thisFinishedEvtContext ));
1299 std::string outputFileReport = rangeReport->second + std::string(
",ID:")
1300 + rangeReport->first + std::string(
",CPU:N/A,WALL:N/A");
1304 memcpy(message2pilot,outputFileReport.data(),outputFileReport.size());
1305 m_socket->send(message2pilot,outputFileReport.size());
1307 ATH_MSG_INFO(
"Reported the output {}", outputFileReport );
1311 ATH_MSG_DEBUG(
"Clearing slot {} (event {}) of the whiteboard",
1312 thisFinishedEvtContext->slot(),
1313 thisFinishedEvtContext->evt() );
1315 StatusCode
sc =
clearWBSlot(thisFinishedEvtContext->slot());
1316 if (!
sc.isSuccess()) {
1317 ATH_MSG_ERROR (
"Whiteboard slot {} could not be properly cleared",
1318 thisFinishedEvtContext->slot() );
1330 ATH_MSG_INFO (
" ===>>> done processing event #{}, run #{} on slot {}, {} events processed so far <<<===",
1331 n_evt, n_run, thisFinishedEvtContext->slot(),
m_proc);
1333 ATH_MSG_INFO (
" ===>>> done processing event #{}, run #{} on slot {}, {} events read and {} events processed so far <<<===",
1334 n_evt, n_run, thisFinishedEvtContext->slot(),
m_nev,
m_proc);
1335 std::ofstream outfile(
"eventLoopHeartBeat.txt");
1337 ATH_MSG_ERROR (
" unable to open: eventLoopHeartBeat.txt" );
1341 std::println (outfile,
" done processing event #{}, run #{} {} events read so far <<<===",
1342 n_evt, n_run,
m_nev);
1347 ATH_MSG_DEBUG (
"drainScheduler thisFinishedEvtContext: " << thisFinishedEvtContext );
1350 return ( fail ? -1 : 1 );
1358 if( !
sc.isSuccess() ) {
1367 static const std::string strReady(
"Ready for events");
1368 static const std::string strStopProcessing(
"No more events");
1372 static std::atomic<size_t> line_n = 0;
1377 void* ready_message = malloc(strReady.size());
1378 if (!ready_message) std::abort();
1379 memcpy(ready_message,strReady.data(),strReady.size());
1380 socket->send(ready_message,strReady.size());
1381 void* eventRangeMessage;
1382 std::string strPeerId;
1383 ssize_t eventRangeSize = socket->recv(eventRangeMessage,strPeerId);
1384 range = std::string((
const char*)eventRangeMessage,eventRangeSize);
1385 leftString(range,
'\n');
1388 std::unique_ptr<RangeStruct> result = std::make_unique<RangeStruct>();
1389 if(range.compare(strStopProcessing)==0) {
1393 ATH_MSG_INFO(
"Got Event Range from the pilot: {}", range);
1398 if(range.starts_with(
"[{")) range=range.substr(2);
1399 if(range.ends_with(
"}]")){
1400 const int truncate = range.size()-2;
1401 leftString(range, truncate);
1404 std::map<std::string,std::string, std::less<>> eventRangeMap;
1406 size_t endpos = range.find(
',');
1407 while(endpos!=std::string::npos) {
1409 std::string keyValue(range.substr(startpos,endpos-startpos));
1410 size_t colonPos = keyValue.find(
':');
1411 std::string strKey = keyValue.substr(0,colonPos);
1412 std::string strVal = keyValue.substr(colonPos+1);
1415 eventRangeMap[strKey]=std::move(strVal);
1418 startpos = endpos+1;
1419 endpos = range.find(
',',startpos);
1423 std::string keyValue(range.substr(startpos));
1424 size_t colonPos = keyValue.find(
':');
1425 std::string strKey = keyValue.substr(0,colonPos);
1426 std::string strVal = keyValue.substr(colonPos+1);
1429 eventRangeMap[strKey]=std::move(strVal);
1437 std::string errorStr{
""};
1439 if(eventRangeMap.find(
"eventRangeID")==eventRangeMap.end()
1440 || eventRangeMap.find(
"startEvent")==eventRangeMap.end()
1441 || eventRangeMap.find(
"lastEvent")==eventRangeMap.end()
1442 || eventRangeMap.find(
"PFN")==eventRangeMap.end()) {
1444 errorStr =
"ERR_ATHENAMP_PARSE \"" + range +
"\": Wrong format";
1447 if(errorStr.empty()) {
1448 result->startEvent = std::atoi(eventRangeMap[
"startEvent"].c_str());
1449 result->lastEvent = std::atoi(eventRangeMap[
"lastEvent"].c_str());
1451 if(eventRangeMap[
"eventRangeID"].
empty()
1452 || eventRangeMap[
"PFN"].
empty()
1453 || result->lastEvent < result->startEvent) {
1455 errorStr =
"ERR_ATHENAMP_PARSE \"" + range +
"\": Wrong values of range fields";
1459 if(
m_pfn != eventRangeMap[
"PFN"]) {
1460 IProperty* propertyServer =
dynamic_cast<IProperty*
>(
m_evtSelector);
1461 if(!propertyServer) {
1462 errorStr =
"ERR_ATHENAMP_PARSE \"" + range +
"\": Unable to dyn-cast the event selector to IProperty";
1465 std::string strInpuCol(
"InputCollections");
1466 std::vector<std::string> vectInpCol{eventRangeMap[
"PFN"],};
1467 StringArrayProperty inputFileList(std::move(strInpuCol), vectInpCol);
1468 if(propertyServer->setProperty(inputFileList).isFailure()) {
1469 errorStr =
"ERR_ATHENAMP_PARSE \"" + range +
"\": Unable to set input file name property to the Event Selector";
1472 m_pfn = eventRangeMap[
"PFN"];
1479 if(errorStr.empty()) {
1482 for (
const auto& fieldvalue : eventRangeMap) {
1483 ATH_MSG_DEBUG(
"{}:{}", fieldvalue.first, fieldvalue.second);
1486 result->eventRangeID = eventRangeMap[
"eventRangeID"];
1487 result->pfn = eventRangeMap[
"PFN"];
1496 memcpy(errorMessage,errorStr.data(),errorStr.size());
1497 socket->send(errorMessage,errorStr.size());
1509 while(i<
str.size() &&
str[i]==
' ') i++;
1510 if(i)
str =
str.substr(i);
1512 if(
str.empty())
return;
1516 while(
str[i]==
' ') i--;
1517 if(i)
str.resize(i+1);
1524 if(
str.starts_with(
"u\'")) {
1526 if(
str.rfind(
'\'')==
str.size()-1) {
1530 else if(
str.starts_with(
"\"")) {
1532 if(
str.rfind(
'\"')==
str.size()-1) {
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_ALWAYS(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
ClearStorePolicy::Type clearStorePolicy(const std::string &policyName, MsgStream &msg)
returns the enum-version of the policy (by name)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Assign a CLID to EventContext.
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
EventID eventIDFromxAOD(const xAOD::EventInfo *xaod)
Create EventID object from xAOD::EventInfo.
EventType eventTypeFromxAOD(const xAOD::EventInfo *xaod)
Create EventType object from xAOD::EventInfo.
This class provides general information about an event.
Extension to IEvtSelector to allow for seeking.
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
This file contains the class definition for the OutputStreamSequencerSvc class.
An AttributeList represents a logical row of attributes in a metadata table.
static const Attributes_t empty
An AttributeList represents a logical row of attributes in a metadata table.
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
bool m_requireInputAttributeList
require input attribute list
virtual StatusCode finalize() override
implementation of IAppMgrUI::finalize
virtual EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
virtual void resetAppReturnCode() override
Reset the application return code.
virtual StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(void* par)
tool_store::const_iterator tool_iterator
virtual int curEvent() const override
Return the current event count.
StringProperty m_histPersName
ServiceHandle< OutputStreamSequencerSvc > m_outSeqSvc
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
void setClearStorePolicy(Gaudi::Details::PropertyBase &clearStorePolicy)
property update handler:set the clear-store policy value and check its value.
IntegerProperty m_failureMode
unsigned int m_timeStampInt
virtual StatusCode executeAlgorithms()
Run the algorithms for the current event.
std::unique_ptr< yampl::ISocket > m_socket
ServiceHandle< Athena::IConditionsCleanerSvc > m_conditionsCleaner
std::unique_ptr< RangeStruct > getNextRange(yampl::ISocket *socket)
virtual bool terminateLoop() override
tool_stats m_toolReject
tool returns StatusCode::FAILURE counter
UnsignedIntegerProperty m_eventPrintoutInterval
tool_stats m_toolAccept
tool returns StatusCode::SUCCESS counter
virtual StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun(int maxevt)
number_type m_currentRun
current run number
AthenaMtesEventLoopMgr()=delete
tool_store m_tools
internal tool store
virtual const std::string & name() const override
unsigned int m_nev
events processed
virtual StatusCode initialize() override
implementation of IAppMgrUI::initalize
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
IEvtIdModifierSvc_t m_evtIdModSvc
virtual StatusCode writeHistograms(bool force=false)
Dump out histograms as needed.
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard interface.
virtual ~AthenaMtesEventLoopMgr()
Standard Destructor.
StatusCode initializeAlgorithms()
Initialize all algorithms and output streams.
SmartIF< IAlgExecStateSvc > m_aess
Reference to the Algorithm Execution State Svc.
tool_stats m_toolInvoke
tool called counter
virtual int drainScheduler(int &finishedEvents, bool report) override
Drain the scheduler from all actions that may be queued.
bool m_useSecondaryEventNumber
read event number from secondary input
virtual StatusCode nextEvent(int maxevt) override
implementation of IAppMgrUI::nextEvent. maxevt==0 returns immediately
EvtContext * m_evtContext
Gaudi event selector Context (may be used as a cursor by the evt selector).
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
std::string m_whiteboardName
Name of the Whiteboard to be used.
int declareEventRootAddress(EventContext &)
Declare the root address of the event.
bool m_scheduledStop
Scheduled stop of event processing.
virtual StatusCode seek(int evt) override
Seek to a given event.
virtual StatusCode stop() override
implementation of IService::stop
std::string m_schedulerName
Name of the scheduler to be used.
StringArrayProperty m_testPilotMessages
IDataManagerSvc_t m_histoDataMgrSvc
Reference to the Histogram Data Service.
StoreGateSvc_t m_eventStore
Reference to StoreGateSvc;.
virtual int size() override
Return the size of the collection.
Gaudi::Property< std::string > m_eventRangeChannel
StringProperty m_clearStorePolicy
void modifyEventContext(EventContext &ctx, const EventID &eID, bool consume_modifier_stream, long evtModIdx)
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
EventContext m_lastEventContext
virtual void setCurrentEventNum(int num) override
ServiceHandle< IConversionSvc > IConversionSvc_t
IConversionSvc_t m_histoPersSvc
virtual StatusCode stopRun() override
implementation of IEventProcessor::stopRun()
void setupPreSelectTools(Gaudi::Details::PropertyBase &)
property update handler:sets up the Pre-selection tools
IIncidentSvc_t m_incidentSvc
Reference to the incident service.
void trimRangeStrings(std::string &str)
UnsignedIntegerProperty m_writeInterval
virtual void handle(const Incident &inc) override
IIncidentListenet interfaces.
IEvtSelector * m_evtSelector
Reference to the Event Selector.
void resetTimeout(Timeout &instance)
Reset timeout.
static Timeout & instance()
Get reference to Timeout singleton.
void setConditionsRun(EventIDBase::number_type conditionsRun)
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
EventIDBase::number_type number_type
This class provides general information about an event.
EventID * event_ID()
the unique identification of the event.
Abstract interface for seeking for an event selector.
virtual StatusCode seek(IEvtSelector::Context &c, int evtnum) const =0
Seek to a given event number.
virtual int size(IEvtSelector::Context &c) const =0
Return the size of the collection, or -1 if we can't get the size.
std::unique_ptr< RangeReport_t > RangeReport_ptr
int ir
counter of the current depth
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
void * xmalloc(size_t size)
Trapping version of malloc.
event_number_t eventIndex
EventInfo_v1 EventInfo
Definition of the latest event info version.
Trapping version of malloc.