The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::RootEvtSelector Class Reference

Concrete event selector implementation to access ROOT files. More...

#include <GAUDIROOT/RootEvtSelector.h>

Inheritance diagram for Gaudi::RootEvtSelector:
Collaboration diagram for Gaudi::RootEvtSelector:

Public Member Functions

StatusCode initialize () override
 IService implementation: Db event selector override.
 
StatusCode finalize () override
 IService implementation: Service finalization.
 
StatusCode createContext (Context *&refpCtxt) const override
 Create a new event loop context.
 
StatusCode last (Context &refContext) const override
 Access last item in the iteration.
 
StatusCode next (Context &refCtxt) const override
 Get next iteration item from the event loop context.
 
StatusCode next (Context &refCtxt, int jump) const override
 Get next iteration item from the event loop context, but skip jump elements.
 
StatusCode previous (Context &refCtxt) const override
 Get previous iteration item from the event loop context.
 
StatusCode previous (Context &refCtxt, int jump) const override
 Get previous iteration item from the event loop context, but skip jump elements.
 
StatusCode rewind (Context &refCtxt) const override
 Rewind the dataset.
 
StatusCode createAddress (const Context &refCtxt, IOpaqueAddress *&) const override
 Create new Opaque address corresponding to the current record.
 
StatusCode releaseContext (Context *&refCtxt) const override
 Release existing event iteration context.
 
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 context in a way to point to the new list.
 
- Public Member Functions inherited from extends< Service, IEvtSelector >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from Service
const std::string & name () const override
 Retrieve name of the service.
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service.
 
StatusCode sysStart () override
 Initialize Service.
 
StatusCode sysStop () override
 Initialize Service.
 
StatusCode sysFinalize () override
 Finalize Service.
 
StatusCode sysReinitialize () override
 Re-initialize the Service.
 
StatusCode sysRestart () override
 Re-initialize the Service.
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator.
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool.
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T>
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation.
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 

Protected Attributes

RootCnvSvcm_dbMgr
 Reference to the corresponding conversion service.
 
CLID m_rootCLID = CLID_NULL
 Class id of root node to create opaque address.
 
Gaudi::Property< std::string > m_persName
 
Gaudi::Property< std::string > m_dummy { this, "DbType", "", "dummy property to fake backwards compatibility" }
 
std::string m_cnvSvcName = "Gaudi::RootCnvSvc/RootCnvSvc"
 Property; Name of the concversion service used to create opaque addresses.
 
std::string m_rootName
 Property: Name of the ROOT entry name.
 
std::string m_criteria
 Property: File criteria to define item iteration.
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools
 
Gaudi::Property< bool > m_auditorInitialize { this, "AuditInitialize", false, "trigger auditor on initialize()" }
 
Gaudi::Property< bool > m_auditorStart { this, "AuditStart", false, "trigger auditor on start()" }
 
Gaudi::Property< bool > m_auditorStop { this, "AuditStop", false, "trigger auditor on stop()" }
 
Gaudi::Property< bool > m_auditorFinalize { this, "AuditFinalize", false, "trigger auditor on finalize()" }
 
Gaudi::Property< bool > m_auditorReinitialize { this, "AuditReinitialize", false, "trigger auditor on reinitialize()" }
 
Gaudi::Property< bool > m_auditorRestart { this, "AuditRestart", false, "trigger auditor on restart()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service.
 

Private Member Functions

StatusCode error (const std::string &msg) const
 Helper method to issue error messages.
 

Additional Inherited Members

- Public Types inherited from extends< Service, IEvtSelector >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory<IService*( const std::string&, ISvcLocator* )>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl
 Typedef used to refer to this class from derived classes, as in.
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 
- Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 
int outputLevel () const
 get the Service's output level
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches.
 
MSG::Level resetMessaging ()
 Reinitialize internal states.
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
 

Detailed Description

Concrete event selector implementation to access ROOT files.

Author
M.Frank
Version
1.0
Date
20/12/2009

Definition at line 48 of file RootEvtSelector.h.

Member Function Documentation

◆ createAddress()

StatusCode RootEvtSelector::createAddress ( const Context & refCtxt,
IOpaqueAddress *& pAddr ) const
override

Create new Opaque address corresponding to the current record.

Parameters
refCtxt[IN/OUT] Reference to the context
Returns
StatusCode indicating success or failure

Definition at line 262 of file RootEvtSelector.cpp.

262 {
263 const RootEvtSelectorContext* pctxt = dynamic_cast<const RootEvtSelectorContext*>( &ctxt );
264 if ( pctxt ) {
265 long ent = pctxt->entry();
266 if ( ent >= 0 ) {
267 auto fileit = pctxt->fileIterator();
268 if ( fileit != pctxt->files().end() ) {
269 const string par[2] = { pctxt->fid(), m_rootName };
270 const unsigned long ipar[2] = { 0, (unsigned long)ent };
271 return m_dbMgr->createAddress( m_dbMgr->repSvcType(), m_rootCLID, &par[0], &ipar[0], pAddr );
272 }
273 }
274 }
275 pAddr = nullptr;
276 return StatusCode::FAILURE;
277}
Files::const_iterator fileIterator() const
Access to the file iterator.
long entry() const
Access to the current event entry number.
const Files & files() const
Access to the file container.
const std::string & fid() const
Access connection fid.
CLID m_rootCLID
Class id of root node to create opaque address.
std::string m_rootName
Property: Name of the ROOT entry name.
RootCnvSvc * m_dbMgr
Reference to the corresponding conversion service.
constexpr static const auto FAILURE
Definition StatusCode.h:100

◆ createContext()

StatusCode RootEvtSelector::createContext ( Context *& refpCtxt) const
override

Create a new event loop context.

Parameters
refpCtxt[IN/OUT] Reference to pointer to store the context
Returns
StatusCode indicating success or failure

Definition at line 162 of file RootEvtSelector.cpp.

162 {
163 refpCtxt = new RootEvtSelectorContext( this );
164 return StatusCode::SUCCESS;
165}
constexpr static const auto SUCCESS
Definition StatusCode.h:99

◆ error()

StatusCode RootEvtSelector::error ( const std::string & msg) const
private

Helper method to issue error messages.

Definition at line 113 of file RootEvtSelector.cpp.

113 {
114 MsgStream log( msgSvc(), name() );
115 log << MSG::ERROR << msg << endmsg;
116 return StatusCode::FAILURE;
117}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
const std::string & name() const override
Retrieve name of the service.
Definition Service.cpp:333
@ ERROR
Definition IMessageSvc.h:22

◆ finalize()

StatusCode RootEvtSelector::finalize ( )
override

IService implementation: Service finalization.

Definition at line 154 of file RootEvtSelector.cpp.

154 {
155 // Initialize base class
156 if ( m_dbMgr ) m_dbMgr->release();
157 m_dbMgr = nullptr; // release
158 return Service::finalize();
159}
StatusCode finalize() override
Definition Service.cpp:223

◆ initialize()

StatusCode RootEvtSelector::initialize ( )
override

IService implementation: Db event selector override.

Definition at line 120 of file RootEvtSelector.cpp.

120 {
121 // Initialize base class
122 StatusCode status = Service::initialize();
123 if ( !status.isSuccess() ) { return error( "Error initializing base class Service!" ); }
124
125 auto ipers = serviceLocator()->service<IPersistencySvc>( m_persName );
126 if ( !ipers ) { return error( "Unable to locate IPersistencySvc interface of " + m_persName ); }
127 IConversionSvc* cnvSvc = nullptr;
128 Gaudi::Utils::TypeNameString itm( m_cnvSvcName );
129 status = ipers->getService( itm.name(), cnvSvc );
130 if ( !status.isSuccess() ) {
131 status = ipers->getService( itm.type(), cnvSvc );
132 if ( !status.isSuccess() ) {
133 return error( "Unable to locate IConversionSvc interface of database type " + m_cnvSvcName );
134 }
135 }
136 m_dbMgr = dynamic_cast<RootCnvSvc*>( cnvSvc );
137 if ( !m_dbMgr ) {
138 cnvSvc->release();
139 return error( "Unable to localize service:" + m_cnvSvcName );
140 }
141 m_dbMgr->addRef();
142
143 // Get DataSvc
144 auto eds = serviceLocator()->service<IDataManagerSvc>( "EventDataSvc" );
145 if ( !eds ) { return error( "Unable to localize service EventDataSvc" ); }
146 m_rootCLID = eds->rootCLID();
147 m_rootName = eds->rootName();
148 MsgStream log( msgSvc(), name() );
149 log << MSG::DEBUG << "Selection root:" << m_rootName << " CLID:" << m_rootCLID << endmsg;
150 return status;
151}
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Gaudi::Property< std::string > m_persName
std::string m_cnvSvcName
Property; Name of the concversion service used to create opaque addresses.
virtual unsigned long release() const =0
Release Interface instance.
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
StatusCode initialize() override
Definition Service.cpp:118
bool isSuccess() const
Definition StatusCode.h:314
@ DEBUG
Definition IMessageSvc.h:22

◆ last()

StatusCode RootEvtSelector::last ( Context & refContext) const
override

Access last item in the iteration.

Parameters
refContext[IN/OUT] Reference to the Context object.

Definition at line 168 of file RootEvtSelector.cpp.

168{ return StatusCode::FAILURE; }

◆ next() [1/2]

StatusCode RootEvtSelector::next ( Context & refCtxt) const
override

Get next iteration item from the event loop context.

Parameters
refCtxt[IN/OUT] Reference to the context
Returns
StatusCode indicating success or failure

Definition at line 171 of file RootEvtSelector.cpp.

171 {
172 RootEvtSelectorContext* pCtxt = dynamic_cast<RootEvtSelectorContext*>( &ctxt );
173 if ( pCtxt ) {
174 TBranch* b = pCtxt->branch();
175 if ( !b ) {
176 auto fileit = pCtxt->fileIterator();
177 pCtxt->setBranch( nullptr );
178 pCtxt->setEntry( -1 );
179 if ( fileit != pCtxt->files().end() ) {
180 RootDataConnection* con = nullptr;
181 string in = *fileit;
182 StatusCode sc = m_dbMgr->connectDatabase( in, IDataConnection::READ, &con );
183 if ( sc.isSuccess() ) {
184 string section = m_rootName[0] == '/' ? m_rootName.substr( 1 ) : m_rootName;
185 b = con->getBranch( section, m_rootName );
186 if ( b ) {
187 pCtxt->setFID( con->fid() );
188 pCtxt->setBranch( b );
189 return next( ctxt );
190 }
191 }
192 m_dbMgr->disconnect( in ).ignore();
193 pCtxt->setFileIterator( ++fileit );
194 return next( ctxt );
195 }
196 return StatusCode::FAILURE;
197 }
198 long ent = pCtxt->entry();
199 Long64_t nent = b->GetEntries();
200 if ( nent > ( ent + 1 ) ) {
201 pCtxt->setEntry( ++ent );
202 return StatusCode::SUCCESS;
203 }
204 auto fit = pCtxt->fileIterator();
205 pCtxt->setFileIterator( ++fit );
206 pCtxt->setEntry( -1 );
207 pCtxt->setBranch( nullptr );
208 pCtxt->setFID( "" );
209 return next( ctxt );
210 }
211 return StatusCode::FAILURE;
212}
const std::string & fid() const
Access file id.
TBranch * getBranch(std::string_view section, std::string_view branch_name)
Access data branch by name: Get existing branch in read only mode.
TBranch * branch() const
Access to the top level branch (typically /Event) used to iterate.
void setEntry(long e)
Set current event entry number.
void setFileIterator(Files::const_iterator i)
Set file iterator.
void setFID(const std::string &fid)
Set connection FID.
void setBranch(TBranch *b)
Set the top level branch (typically /Event) used to iterate.
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.

◆ next() [2/2]

StatusCode RootEvtSelector::next ( Context & refCtxt,
int jump ) const
override

Get next iteration item from the event loop context, but skip jump elements.

Parameters
refCtxt[IN/OUT] Reference to the context
Returns
StatusCode indicating success or failure

Definition at line 215 of file RootEvtSelector.cpp.

215 {
216 if ( jump > 0 ) {
217 for ( int i = 0; i < jump; ++i ) {
218 StatusCode status = next( ctxt );
219 if ( !status.isSuccess() ) { return status; }
220 }
221 return StatusCode::SUCCESS;
222 }
223 return StatusCode::FAILURE;
224}

◆ previous() [1/2]

StatusCode RootEvtSelector::previous ( Context & refCtxt) const
override

Get previous iteration item from the event loop context.

Parameters
refCtxt[IN/OUT] Reference to the context
jump[IN] Number of events to be skipped
Returns
StatusCode indicating success or failure

Definition at line 227 of file RootEvtSelector.cpp.

227 {
228 return error( "EventSelector Iterator, operator -- not supported " );
229}

◆ previous() [2/2]

StatusCode RootEvtSelector::previous ( Context & refCtxt,
int jump ) const
override

Get previous iteration item from the event loop context, but skip jump elements.

Parameters
refCtxt[IN/OUT] Reference to the context
jump[IN] Number of events to be skipped
Returns
StatusCode indicating success or failure

Definition at line 232 of file RootEvtSelector.cpp.

232 {
233 if ( jump > 0 ) {
234 for ( int i = 0; i < jump; ++i ) {
235 StatusCode status = previous( ctxt );
236 if ( !status.isSuccess() ) { return status; }
237 }
238 return StatusCode::SUCCESS;
239 }
240 return StatusCode::FAILURE;
241}
StatusCode previous(Context &refCtxt) const override
Get previous iteration item from the event loop context.

◆ releaseContext()

StatusCode RootEvtSelector::releaseContext ( Context *& refCtxt) const
override

Release existing event iteration context.

Parameters
refCtxt[IN/OUT] Reference to the context
Returns
StatusCode indicating success or failure

Definition at line 280 of file RootEvtSelector.cpp.

280 {
281 RootEvtSelectorContext* pCtxt = dynamic_cast<RootEvtSelectorContext*>( ctxt );
282 if ( pCtxt ) {
283 delete pCtxt;
284 return StatusCode::SUCCESS;
285 }
286 return StatusCode::FAILURE;
287}

◆ resetCriteria()

StatusCode RootEvtSelector::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 context in a way to point to the new list.

Parameters
crThe new criteria string.
cReference pointer to the Context object.

Definition at line 291 of file RootEvtSelector.cpp.

291 {
292 MsgStream log( msgSvc(), name() );
293 RootEvtSelectorContext* ctxt = dynamic_cast<RootEvtSelectorContext*>( &context );
294 string db, typ, item, sel, stmt, aut, addr;
295 if ( ctxt ) {
296 if ( criteria.compare( 0, 5, "FILE " ) == 0 ) {
297 // The format for the criteria is:
298 // FILE filename1, filename2 ...
299 db = criteria.substr( 5 );
300 } else {
301 using Parser = Gaudi::Utils::AttribStringParser;
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;
309 return StatusCode::FAILURE;
310 }
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 );
323 }
324 }
325 }
326 // It's now time to parse the criteria for the event selection
327 // The format for the criteria is:
328 // FILE filename1, filename2 ...
329 // JOBID number1-number2, number3, ...
331 string rest = db;
332 files.clear();
333 while ( true ) {
334 int ipos = rest.find_first_not_of( " ," );
335 if ( ipos == -1 ) break;
336 rest = rest.substr( ipos, string::npos ); // remove blanks before
337 int lpos = rest.find_first_of( " ," ); // locate next blank
338
339 files.push_back( rest.substr( 0, lpos == -1 ? string::npos : lpos ) ); // insert in list
340 if ( lpos == -1 ) break;
341 rest = rest.substr( lpos, string::npos ); // get the rest
342 }
343 ctxt->setFiles( files );
344 ctxt->setFileIterator( ctxt->files().begin() );
345 return StatusCode::SUCCESS;
346 }
347 return error( "Invalid iteration context." );
348}
void setFiles(const Files &f)
Set the file container.
std::vector< std::string > Files
Definition of the file container.

◆ rewind()

StatusCode RootEvtSelector::rewind ( Context & refCtxt) const
override

Rewind the dataset.

Parameters
refCtxt[IN/OUT] Reference to the context
Returns
StatusCode indicating success or failure

Definition at line 244 of file RootEvtSelector.cpp.

244 {
245 RootEvtSelectorContext* pCtxt = dynamic_cast<RootEvtSelectorContext*>( &ctxt );
246 if ( pCtxt ) {
247 auto fileit = pCtxt->fileIterator();
248 if ( fileit != pCtxt->files().end() ) {
249 string input = *fileit;
250 m_dbMgr->disconnect( input ).ignore();
251 }
252 pCtxt->setFID( "" );
253 pCtxt->setEntry( -1 );
254 pCtxt->setBranch( nullptr );
255 pCtxt->setFileIterator( pCtxt->files().begin() );
256 return StatusCode::SUCCESS;
257 }
258 return StatusCode::FAILURE;
259}

Member Data Documentation

◆ m_cnvSvcName

std::string Gaudi::RootEvtSelector::m_cnvSvcName = "Gaudi::RootCnvSvc/RootCnvSvc"
protected

Property; Name of the concversion service used to create opaque addresses.

Definition at line 146 of file RootEvtSelector.h.

◆ m_criteria

std::string Gaudi::RootEvtSelector::m_criteria
protected

Property: File criteria to define item iteration.

Definition at line 150 of file RootEvtSelector.h.

◆ m_dbMgr

RootCnvSvc* Gaudi::RootEvtSelector::m_dbMgr
mutableprotected

Reference to the corresponding conversion service.

Definition at line 137 of file RootEvtSelector.h.

◆ m_dummy

Gaudi::Property<std::string> Gaudi::RootEvtSelector::m_dummy { this, "DbType", "", "dummy property to fake backwards compatibility" }
protected

Definition at line 143 of file RootEvtSelector.h.

143{ this, "DbType", "", "dummy property to fake backwards compatibility" };

◆ m_persName

Gaudi::Property<std::string> Gaudi::RootEvtSelector::m_persName
protected
Initial value:
{ this, "EvtPersistencySvc", "EventPersistencySvc",
"Name of the persistency service to search for conversion service" }

Definition at line 141 of file RootEvtSelector.h.

141 { this, "EvtPersistencySvc", "EventPersistencySvc",
142 "Name of the persistency service to search for conversion service" };

◆ m_rootCLID

CLID Gaudi::RootEvtSelector::m_rootCLID = CLID_NULL
protected

Class id of root node to create opaque address.

Definition at line 139 of file RootEvtSelector.h.

◆ m_rootName

std::string Gaudi::RootEvtSelector::m_rootName
protected

Property: Name of the ROOT entry name.

Definition at line 148 of file RootEvtSelector.h.


The documentation for this class was generated from the following files: