62 typedef std::vector<std::string>
Files;
109using namespace Gaudi;
123 if ( !status.
isSuccess() ) {
return error(
"Error initializing base class Service!" ); }
126 if ( !ipers ) {
return error(
"Unable to locate IPersistencySvc interface of " +
m_persName ); }
129 status = ipers->getService( itm.
name(), cnvSvc );
131 status = ipers->getService( itm.
type(), cnvSvc );
133 return error(
"Unable to locate IConversionSvc interface of database type " +
m_cnvSvcName );
145 if ( !eds ) {
return error(
"Unable to localize service EventDataSvc" ); }
174 TBranch* b = pCtxt->
branch();
179 if ( fileit != pCtxt->
files().end() ) {
192 m_dbMgr->disconnect( in ).ignore();
198 long ent = pCtxt->
entry();
199 Long64_t nent = b->GetEntries();
200 if ( nent > ( ent + 1 ) ) {
217 for (
int i = 0; i < jump; ++i ) {
219 if ( !status.
isSuccess() ) {
return status; }
228 return error(
"EventSelector Iterator, operator -- not supported " );
234 for (
int i = 0; i < jump; ++i ) {
236 if ( !status.
isSuccess() ) {
return status; }
248 if ( fileit != pCtxt->
files().end() ) {
249 string input = *fileit;
250 m_dbMgr->disconnect( input ).ignore();
265 long ent = pctxt->
entry();
268 if ( fileit != pctxt->
files().end() ) {
270 const unsigned long ipar[2] = { 0, (
unsigned long)ent };
294 string db, typ, item, sel, stmt, aut, addr;
296 if ( criteria.compare( 0, 5,
"FILE " ) == 0 ) {
299 db = criteria.substr( 5 );
302 for (
auto attrib : Parser( criteria ) ) {
303 string tmp = attrib.tag.substr( 0, 3 );
304 if ( tmp ==
"DAT" ) {
305 db = std::move( attrib.value );
306 }
else if ( tmp ==
"OPT" ) {
307 if ( attrib.value.compare( 0, 3,
"REA" ) != 0 ) {
308 log <<
MSG::ERROR <<
"Option:\"" << attrib.value <<
"\" not valid" <<
endmsg;
311 }
else if ( tmp ==
"TYP" ) {
312 typ = std::move( attrib.value );
313 }
else if ( tmp ==
"ADD" ) {
314 item = std::move( attrib.value );
315 }
else if ( tmp ==
"SEL" ) {
316 sel = std::move( attrib.value );
317 }
else if ( tmp ==
"FUN" ) {
318 stmt = std::move( attrib.value );
319 }
else if ( tmp ==
"AUT" ) {
320 aut = std::move( attrib.value );
321 }
else if ( tmp ==
"COL" ) {
322 addr = std::move( attrib.value );
334 int ipos = rest.find_first_not_of(
" ," );
335 if ( ipos == -1 )
break;
336 rest = rest.substr( ipos, string::npos );
337 int lpos = rest.find_first_of(
" ," );
339 files.push_back( rest.substr( 0, lpos == -1 ? string::npos : lpos ) );
340 if ( lpos == -1 )
break;
341 rest = rest.substr( lpos, string::npos );
347 return error(
"Invalid iteration context." );
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
const std::string & fid() const
Access file id.
Concrete implementation of the IDataConnection interface to access ROOT files.
TBranch * getBranch(std::string_view section, std::string_view branch_name)
Access data branch by name: Get existing branch in read only mode.
ROOT specific event selector context.
TBranch * m_branch
Reference to the top level branch (typically /Event) used to iterate.
Files::const_iterator fileIterator() const
Access to the file iterator.
long entry() const
Access to the current event entry number.
Files m_files
The file container managed by this context.
long m_entry
Current entry of current file.
const Files & files() const
Access to the file container.
void * identifier() const override
Context identifier.
TBranch * branch() const
Access to the top level branch (typically /Event) used to iterate.
const std::string & fid() const
Access connection fid.
void setFiles(const Files &f)
Set the file container.
std::string m_fid
Connection fid.
void setEntry(long e)
Set current event entry number.
Files::const_iterator m_fiter
The iterator to the.
void setFileIterator(Files::const_iterator i)
Set file iterator.
void setFID(const std::string &fid)
Set connection FID.
const RootEvtSelector * m_sel
Reference to the hosting event selector instance.
void setBranch(TBranch *b)
Set the top level branch (typically /Event) used to iterate.
RootEvtSelectorContext(const RootEvtSelector *s)
Standard constructor with initialization.
std::vector< std::string > Files
Definition of the file container.
Concrete event selector implementation to access ROOT files.
StatusCode rewind(Context &refCtxt) const override
Rewind the dataset.
StatusCode resetCriteria(const std::string &cr, Context &c) const override
Will set a new criteria for the selection of the next list of events and will change the state of the...
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
CLID m_rootCLID
Class id of root node to create opaque address.
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.
StatusCode initialize() override
IService implementation: Db event selector override.
StatusCode error(const std::string &msg) const
Helper method to issue error messages.
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&) const override
Create new Opaque address corresponding to the current record.
StatusCode previous(Context &refCtxt) const override
Get previous iteration item from the event loop context.
StatusCode last(Context &refContext) const override
Access last item in the iteration.
StatusCode finalize() override
IService implementation: Service finalization.
Gaudi::Property< std::string > m_persName
std::string m_cnvSvcName
Property; Name of the concversion service used to create opaque addresses.
std::string m_rootName
Property: Name of the ROOT entry name.
RootCnvSvc * m_dbMgr
Reference to the corresponding conversion service.
Parse attribute strings allowing iteration over the various attributes.
Helper class to parse a string of format "type/name".
const std::string & type() const
const std::string & name() const
virtual unsigned long release() const =0
Release Interface instance.
Opaque address interface definition.
Data persistency service interface.
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
Definition of the MsgStream class used to transmit messages.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
StatusCode finalize() override
const std::string & name() const override
Retrieve name of the service.
StatusCode initialize() override
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...