The Gaudi Framework  master (e68eea06)
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 263 of file RootEvtSelector.cpp.

263 {
264 const RootEvtSelectorContext* pctxt = dynamic_cast<const RootEvtSelectorContext*>( &ctxt );
265 if ( pctxt ) {
266 long ent = pctxt->entry();
267 if ( ent >= 0 ) {
268 auto fileit = pctxt->fileIterator();
269 if ( fileit != pctxt->files().end() ) {
270 const string par[2] = { pctxt->fid(), m_rootName };
271 const unsigned long ipar[2] = { 0, (unsigned long)ent };
272 return m_dbMgr->createAddress( m_dbMgr->repSvcType(), m_rootCLID, &par[0], &ipar[0], pAddr );
273 }
274 }
275 }
276 pAddr = nullptr;
277 return StatusCode::FAILURE;
278}
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 163 of file RootEvtSelector.cpp.

163 {
164 refpCtxt = new RootEvtSelectorContext( this );
165 return StatusCode::SUCCESS;
166}
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 114 of file RootEvtSelector.cpp.

114 {
115 MsgStream log( msgSvc(), name() );
116 log << MSG::ERROR << msg << endmsg;
117 return StatusCode::FAILURE;
118}
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 155 of file RootEvtSelector.cpp.

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

◆ initialize()

StatusCode RootEvtSelector::initialize ( )
override

IService implementation: Db event selector override.

Definition at line 121 of file RootEvtSelector.cpp.

121 {
122 // Initialize base class
123 StatusCode status = Service::initialize();
124 if ( !status.isSuccess() ) { return error( "Error initializing base class Service!" ); }
125
126 auto ipers = serviceLocator()->service<IPersistencySvc>( m_persName );
127 if ( !ipers ) { return error( "Unable to locate IPersistencySvc interface of " + m_persName ); }
128 IConversionSvc* cnvSvc = nullptr;
129 Gaudi::Utils::TypeNameString itm( m_cnvSvcName );
130 status = ipers->getService( itm.name(), cnvSvc );
131 if ( !status.isSuccess() ) {
132 status = ipers->getService( itm.type(), cnvSvc );
133 if ( !status.isSuccess() ) {
134 return error( "Unable to locate IConversionSvc interface of database type " + m_cnvSvcName );
135 }
136 }
137 m_dbMgr = dynamic_cast<RootCnvSvc*>( cnvSvc );
138 if ( !m_dbMgr ) {
139 cnvSvc->release();
140 return error( "Unable to localize service:" + m_cnvSvcName );
141 }
142 m_dbMgr->addRef();
143
144 // Get DataSvc
145 auto eds = serviceLocator()->service<IDataManagerSvc>( "EventDataSvc" );
146 if ( !eds ) { return error( "Unable to localize service EventDataSvc" ); }
147 m_rootCLID = eds->rootCLID();
148 m_rootName = eds->rootName();
149 MsgStream log( msgSvc(), name() );
150 log << MSG::DEBUG << "Selection root:" << m_rootName << " CLID:" << m_rootCLID << endmsg;
151 return status;
152}
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 169 of file RootEvtSelector.cpp.

169{ 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 172 of file RootEvtSelector.cpp.

172 {
173 RootEvtSelectorContext* pCtxt = dynamic_cast<RootEvtSelectorContext*>( &ctxt );
174 if ( pCtxt ) {
175 TBranch* b = pCtxt->branch();
176 if ( !b ) {
177 auto fileit = pCtxt->fileIterator();
178 pCtxt->setBranch( nullptr );
179 pCtxt->setEntry( -1 );
180 if ( fileit != pCtxt->files().end() ) {
181 RootDataConnection* con = nullptr;
182 string in = *fileit;
183 StatusCode sc = m_dbMgr->connectDatabase( in, IDataConnection::READ, &con );
184 if ( sc.isSuccess() ) {
185 string section = m_rootName[0] == '/' ? m_rootName.substr( 1 ) : m_rootName;
186 b = con->getBranch( section, m_rootName );
187 if ( b ) {
188 pCtxt->setFID( con->fid() );
189 pCtxt->setBranch( b );
190 return next( ctxt );
191 }
192 }
193 m_dbMgr->disconnect( in ).ignore();
194 pCtxt->setFileIterator( ++fileit );
195 return next( ctxt );
196 }
197 return StatusCode::FAILURE;
198 }
199 long ent = pCtxt->entry();
200 Long64_t nent = b->GetEntries();
201 if ( nent > ( ent + 1 ) ) {
202 pCtxt->setEntry( ++ent );
203 return StatusCode::SUCCESS;
204 }
205 auto fit = pCtxt->fileIterator();
206 pCtxt->setFileIterator( ++fit );
207 pCtxt->setEntry( -1 );
208 pCtxt->setBranch( nullptr );
209 pCtxt->setFID( "" );
210 return next( ctxt );
211 }
212 return StatusCode::FAILURE;
213}
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 216 of file RootEvtSelector.cpp.

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

◆ 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 228 of file RootEvtSelector.cpp.

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

◆ 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 233 of file RootEvtSelector.cpp.

233 {
234 if ( jump > 0 ) {
235 for ( int i = 0; i < jump; ++i ) {
236 StatusCode status = previous( ctxt );
237 if ( !status.isSuccess() ) { return status; }
238 }
239 return StatusCode::SUCCESS;
240 }
241 return StatusCode::FAILURE;
242}
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 281 of file RootEvtSelector.cpp.

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

◆ 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 292 of file RootEvtSelector.cpp.

292 {
293 MsgStream log( msgSvc(), name() );
294 RootEvtSelectorContext* ctxt = dynamic_cast<RootEvtSelectorContext*>( &context );
295 string db, typ, item, sel, stmt, aut, addr;
296 if ( ctxt ) {
297 if ( criteria.compare( 0, 5, "FILE " ) == 0 ) {
298 // The format for the criteria is:
299 // FILE filename1, filename2 ...
300 db = criteria.substr( 5 );
301 } else {
302 using Parser = Gaudi::Utils::AttribStringParser;
303 for ( auto attrib : Parser( criteria ) ) {
304 string tmp = attrib.tag.substr( 0, 3 );
305 if ( tmp == "DAT" ) {
306 db = std::move( attrib.value );
307 } else if ( tmp == "OPT" ) {
308 if ( attrib.value.compare( 0, 3, "REA" ) != 0 ) {
309 log << MSG::ERROR << "Option:\"" << attrib.value << "\" not valid" << endmsg;
310 return StatusCode::FAILURE;
311 }
312 } else if ( tmp == "TYP" ) {
313 typ = std::move( attrib.value );
314 } else if ( tmp == "ADD" ) {
315 item = std::move( attrib.value );
316 } else if ( tmp == "SEL" ) {
317 sel = std::move( attrib.value );
318 } else if ( tmp == "FUN" ) {
319 stmt = std::move( attrib.value );
320 } else if ( tmp == "AUT" ) {
321 aut = std::move( attrib.value );
322 } else if ( tmp == "COL" ) {
323 addr = std::move( attrib.value );
324 }
325 }
326 }
327 // It's now time to parse the criteria for the event selection
328 // The format for the criteria is:
329 // FILE filename1, filename2 ...
330 // JOBID number1-number2, number3, ...
332 string rest = db;
333 files.clear();
334 while ( true ) {
335 int ipos = rest.find_first_not_of( " ," );
336 if ( ipos == -1 ) break;
337 rest = rest.substr( ipos, string::npos ); // remove blanks before
338 int lpos = rest.find_first_of( " ," ); // locate next blank
339
340 files.push_back( rest.substr( 0, lpos == -1 ? string::npos : lpos ) ); // insert in list
341 if ( lpos == -1 ) break;
342 rest = rest.substr( lpos, string::npos ); // get the rest
343 }
344 ctxt->setFiles( files );
345 ctxt->setFileIterator( ctxt->files().begin() );
346 return StatusCode::SUCCESS;
347 }
348 return error( "Invalid iteration context." );
349}
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 245 of file RootEvtSelector.cpp.

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

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: