43 typedef std::vector<std::string>
Files;
83 const std::string&
fid()
const {
return m_fid; }
105 if ( !status.
isSuccess() ) {
return error(
"Error initializing base class Service!" ); }
108 if ( !ipers ) {
return error(
"Unable to locate IPersistencySvc interface of " +
m_persName ); }
111 status = ipers->getService( itm.
name(), cnvSvc );
113 status = ipers->getService( itm.
type(), cnvSvc );
115 return error(
"Unable to locate IConversionSvc interface of database type " +
m_cnvSvcName );
127 if ( !eds ) {
return error(
"Unable to localize service EventDataSvc" ); }
156 TBranch* b = pCtxt->
branch();
161 if ( fileit != pCtxt->
files().end() ) {
174 m_dbMgr->disconnect( in ).ignore();
180 long ent = pCtxt->
entry();
181 Long64_t nent = b->GetEntries();
182 if ( nent > ( ent + 1 ) ) {
199 for (
int i = 0; i < jump; ++i ) {
201 if ( !status.
isSuccess() ) {
return status; }
210 return error(
"EventSelector Iterator, operator -- not supported " );
216 for (
int i = 0; i < jump; ++i ) {
218 if ( !status.
isSuccess() ) {
return status; }
230 if ( fileit != pCtxt->
files().end() ) {
231 string input = *fileit;
232 m_dbMgr->disconnect( input ).ignore();
247 long ent = pctxt->
entry();
250 if ( fileit != pctxt->
files().end() ) {
252 const unsigned long ipar[2] = { 0, (
unsigned long)ent };
276 string db, typ, item, sel, stmt, aut, addr;
278 if ( criteria.compare( 0, 5,
"FILE " ) == 0 ) {
281 db = criteria.substr( 5 );
284 for (
auto attrib : Parser( criteria ) ) {
285 string tmp = attrib.tag.substr( 0, 3 );
286 if ( tmp ==
"DAT" ) {
287 db = std::move( attrib.value );
288 }
else if ( tmp ==
"OPT" ) {
289 if ( attrib.value.compare( 0, 3,
"REA" ) != 0 ) {
290 log <<
MSG::ERROR <<
"Option:\"" << attrib.value <<
"\" not valid" <<
endmsg;
293 }
else if ( tmp ==
"TYP" ) {
294 typ = std::move( attrib.value );
295 }
else if ( tmp ==
"ADD" ) {
296 item = std::move( attrib.value );
297 }
else if ( tmp ==
"SEL" ) {
298 sel = std::move( attrib.value );
299 }
else if ( tmp ==
"FUN" ) {
300 stmt = std::move( attrib.value );
301 }
else if ( tmp ==
"AUT" ) {
302 aut = std::move( attrib.value );
303 }
else if ( tmp ==
"COL" ) {
304 addr = std::move( attrib.value );
316 int ipos = rest.find_first_not_of(
" ," );
317 if ( ipos == -1 )
break;
318 rest = rest.substr( ipos, string::npos );
319 int lpos = rest.find_first_of(
" ," );
321 files.push_back( rest.substr( 0, lpos == -1 ? string::npos : lpos ) );
322 if ( lpos == -1 )
break;
323 rest = rest.substr( lpos, string::npos );
329 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...