9#include "GaudiKernel/IEventProcessor.h"
13#include "TObjString.h"
29IAppMgrUI*
Init(
const char* options ) {
50 m_incSvc(
"IncidentSvc",
"TEvent"+name),
51 m_joSvc(
"JobOptionsSvc",
"TEvent"+name),
52 m_evtLoop(
"AthenaEventLoopMgr/"+name+
"_EventLoopMgr",
"TEvent"+name),
53 m_evtSelect(
"EventSelectorAthenaPool/"+name+
"_EventSelector",
"TEvent"+name),
54 m_evtStore(
"StoreGateSvc/"+name,
"TEvent"+name),
68 AAH::setProperty( ppSvc ,
"ProviderNames",
"['MetaDataSvc', 'AthenaPoolAddressProviderSvc']" ).ignore();
81 if (
m_joSvc->has(
"TEvent.EventSelectorType")) {
92 if(
m_evtSelect.type()==
"Athena::xAODEventSelector") {
109 std::vector<std::string> p;
114 messageSvc->setProperty( StringArrayProperty(
"setWarning" , p ) ).ignore();
130 return isize->size();
136 if(
file==0 ||
file->IsZombie())
return StatusCode::FAILURE;
142 std::cout <<
"Unable to change file after already reading" << std::endl;
143 return StatusCode::FAILURE;
145 std::vector<std::string> myFiles;
148 TString sFileIn(
file);
149 std::unique_ptr<TObjArray> sFiles(sFileIn.Tokenize(
","));
150 std::unique_ptr<TIterator> itr(sFiles->MakeIterator());
152 while( (obj = itr->Next()) ) {
153 TString sFile(
static_cast<TObjString*
>(obj)->String());
154 if(sFile.Contains(
'*')) {
155 std::unique_ptr<TObjArray> theFiles(gSystem->GetFromPipe((
"ls " + std::string(
file)).c_str()).Tokenize(
"\n"));
156 for(
int i=0;i<theFiles->GetEntries();i++) {
158 if (TObjString* objstr =
dynamic_cast<TObjString*
>(theFiles->At(i))) {
159 myFiles.push_back(gSystem->ExpandPathName(objstr->String().Data()));
163 myFiles.push_back( gSystem->ExpandPathName(sFile.Data()) );
174 std::unique_ptr<TIterator> itr(
files->GetListOfFiles()->MakeIterator());
177 while( (obj = itr->Next()) ) {
178 if(hasFile) sfiles +=
",";
179 sfiles += obj->GetTitle();
191 if (
m_evtLoop->seek(entry).isFailure())
return -1;
199 std::cout <<
"m_evtProcessor is still nullptr" << std::endl;
206 std::vector<IIncidentListener*> l;
207 m_incSvc->getListeners (l,
"BeginEvent");
212 m_incSvc->fireIncident(Incident(
"BeginEvent",IncidentType::BeginEvent));
214 return (out.isSuccess()) ? 0 : -1;
Abstract interface for finding the size of an event collection.
static StatusCode setProperty(const GaudiHandleBase &toolHandle, const std::string &property, const int &value, bool override=true)
static IAppMgrUI * initGaudi(const char *options="")
initGaudi method starts the gaudi ApplicationMgr ready for working with all the components
Abstract interface for finding the size of an event collection.
StatusCode readFrom(TFile *file)
TEvent(const std::string &name="StoreGateSvc")
PyObject * contains(PyObject *tp, PyObject *pykey)
ServiceHandle< IEvtSelectorSeek > m_evtSelect
PyObject * record(PyObject *obj, PyObject *pykey, bool allowMods=true, bool resetOnly=true, bool noHist=false)
StatusCode retrieve(const T *&obj)
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_joSvc
ServiceHandle< StoreGateSvc > m_inputMetaStore
ServiceHandle< StoreGateSvc > & evtStore()
PyObject * get_item(PyObject *pykey)
StatusCode retrieveMetaInput(const T *&obj, const std::string &key)
void setActive()
ensure we are the active store, for the purpose of element links etc
ServiceHandle< StoreGateSvc > m_evtStore
ServiceHandle< IEventSeek > m_evtLoop
ServiceHandle< StoreGateSvc > & inputMetaStore()
std::atomic< ListenerState > m_listenerState
IEventProcessor * m_evtProcessor
ServiceHandle< IIncidentSvc > m_incSvc
void setEvtSelProperty(const char *name, const T &val)
std::vector< std::string > files
file names and file pointers
PyObject * retrieveObjectFromStore(PyObject *storeGateSvc, PyObject *tp, PyObject *key)
PyObject * py_sg_getitem(PyObject *storeGateSvc, PyObject *key)
PyObject * py_sg_contains(PyObject *storeGateSvc, PyObject *tp, PyObject *key)
PyObject * recordObjectToStore(StoreGateSvc *, PyObject *, PyObject *, bool, bool, bool)
record object to storegate
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
=============================================================================
IAppMgrUI * Init(const char *options="POOLRootAccess/basic.opts")
Bootstraps (creates and configures) the Gaudi Application with the provided options file.