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

244 {
245 const RootEvtSelectorContext* pctxt = dynamic_cast<const RootEvtSelectorContext*>( &ctxt );
246 if ( pctxt ) {
247 long ent = pctxt->entry();
248 if ( ent >= 0 ) {
249 auto fileit = pctxt->fileIterator();
250 if ( fileit != pctxt->files().end() ) {
251 const string par[2] = { pctxt->fid(), m_rootName };
252 const unsigned long ipar[2] = { 0, (unsigned long)ent };
253 return m_dbMgr->createAddress( m_dbMgr->repSvcType(), m_rootCLID, &par[0], &ipar[0], pAddr );
254 }
255 }
256 }
257 pAddr = nullptr;
258 return StatusCode::FAILURE;
259}
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 144 of file RootEvtSelector.cpp.

144 {
145 refpCtxt = new RootEvtSelectorContext( this );
146 return StatusCode::SUCCESS;
147}
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 95 of file RootEvtSelector.cpp.

95 {
96 MsgStream log( msgSvc(), name() );
97 log << MSG::ERROR << msg << endmsg;
99}
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 136 of file RootEvtSelector.cpp.

136 {
137 // Initialize base class
138 if ( m_dbMgr ) m_dbMgr->release();
139 m_dbMgr = nullptr; // release
140 return Service::finalize();
141}
StatusCode finalize() override
Definition Service.cpp:223

◆ initialize()

StatusCode RootEvtSelector::initialize ( )
override

IService implementation: Db event selector override.

Definition at line 102 of file RootEvtSelector.cpp.

102 {
103 // Initialize base class
104 StatusCode status = Service::initialize();
105 if ( !status.isSuccess() ) { return error( "Error initializing base class Service!" ); }
106
107 auto ipers = serviceLocator()->service<IPersistencySvc>( m_persName );
108 if ( !ipers ) { return error( "Unable to locate IPersistencySvc interface of " + m_persName ); }
109 IConversionSvc* cnvSvc = nullptr;
110 Gaudi::Utils::TypeNameString itm( m_cnvSvcName );
111 status = ipers->getService( itm.name(), cnvSvc );
112 if ( !status.isSuccess() ) {
113 status = ipers->getService( itm.type(), cnvSvc );
114 if ( !status.isSuccess() ) {
115 return error( "Unable to locate IConversionSvc interface of database type " + m_cnvSvcName );
116 }
117 }
118 m_dbMgr = dynamic_cast<RootCnvSvc*>( cnvSvc );
119 if ( !m_dbMgr ) {
120 cnvSvc->release();
121 return error( "Unable to localize service:" + m_cnvSvcName );
122 }
123 m_dbMgr->addRef();
124
125 // Get DataSvc
126 auto eds = serviceLocator()->service<IDataManagerSvc>( "EventDataSvc" );
127 if ( !eds ) { return error( "Unable to localize service EventDataSvc" ); }
128 m_rootCLID = eds->rootCLID();
129 m_rootName = eds->rootName();
130 MsgStream log( msgSvc(), name() );
131 log << MSG::DEBUG << "Selection root:" << m_rootName << " CLID:" << m_rootCLID << endmsg;
132 return status;
133}
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 150 of file RootEvtSelector.cpp.

150{ 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 153 of file RootEvtSelector.cpp.

153 {
154 RootEvtSelectorContext* pCtxt = dynamic_cast<RootEvtSelectorContext*>( &ctxt );
155 if ( pCtxt ) {
156 TBranch* b = pCtxt->branch();
157 if ( !b ) {
158 auto fileit = pCtxt->fileIterator();
159 pCtxt->setBranch( nullptr );
160 pCtxt->setEntry( -1 );
161 if ( fileit != pCtxt->files().end() ) {
162 RootDataConnection* con = nullptr;
163 string in = *fileit;
164 StatusCode sc = m_dbMgr->connectDatabase( in, IDataConnection::READ, &con );
165 if ( sc.isSuccess() ) {
166 string section = m_rootName[0] == '/' ? m_rootName.substr( 1 ) : m_rootName;
167 b = con->getBranch( section, m_rootName );
168 if ( b ) {
169 pCtxt->setFID( con->fid() );
170 pCtxt->setBranch( b );
171 return next( ctxt );
172 }
173 }
174 m_dbMgr->disconnect( in ).ignore();
175 pCtxt->setFileIterator( ++fileit );
176 return next( ctxt );
177 }
178 return StatusCode::FAILURE;
179 }
180 long ent = pCtxt->entry();
181 Long64_t nent = b->GetEntries();
182 if ( nent > ( ent + 1 ) ) {
183 pCtxt->setEntry( ++ent );
184 return StatusCode::SUCCESS;
185 }
186 auto fit = pCtxt->fileIterator();
187 pCtxt->setFileIterator( ++fit );
188 pCtxt->setEntry( -1 );
189 pCtxt->setBranch( nullptr );
190 pCtxt->setFID( "" );
191 return next( ctxt );
192 }
193 return StatusCode::FAILURE;
194}
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 197 of file RootEvtSelector.cpp.

197 {
198 if ( jump > 0 ) {
199 for ( int i = 0; i < jump; ++i ) {
200 StatusCode status = next( ctxt );
201 if ( !status.isSuccess() ) { return status; }
202 }
203 return StatusCode::SUCCESS;
204 }
205 return StatusCode::FAILURE;
206}

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

209 {
210 return error( "EventSelector Iterator, operator -- not supported " );
211}

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

214 {
215 if ( jump > 0 ) {
216 for ( int i = 0; i < jump; ++i ) {
217 StatusCode status = previous( ctxt );
218 if ( !status.isSuccess() ) { return status; }
219 }
220 return StatusCode::SUCCESS;
221 }
222 return StatusCode::FAILURE;
223}
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 262 of file RootEvtSelector.cpp.

262 {
263 RootEvtSelectorContext* pCtxt = dynamic_cast<RootEvtSelectorContext*>( ctxt );
264 if ( pCtxt ) {
265 delete pCtxt;
266 return StatusCode::SUCCESS;
267 }
268 return StatusCode::FAILURE;
269}

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

273 {
274 MsgStream log( msgSvc(), name() );
275 RootEvtSelectorContext* ctxt = dynamic_cast<RootEvtSelectorContext*>( &context );
276 string db, typ, item, sel, stmt, aut, addr;
277 if ( ctxt ) {
278 if ( criteria.compare( 0, 5, "FILE " ) == 0 ) {
279 // The format for the criteria is:
280 // FILE filename1, filename2 ...
281 db = criteria.substr( 5 );
282 } else {
283 using Parser = Gaudi::Utils::AttribStringParser;
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;
291 return StatusCode::FAILURE;
292 }
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 );
305 }
306 }
307 }
308 // It's now time to parse the criteria for the event selection
309 // The format for the criteria is:
310 // FILE filename1, filename2 ...
311 // JOBID number1-number2, number3, ...
313 string rest = db;
314 files.clear();
315 while ( true ) {
316 int ipos = rest.find_first_not_of( " ," );
317 if ( ipos == -1 ) break;
318 rest = rest.substr( ipos, string::npos ); // remove blanks before
319 int lpos = rest.find_first_of( " ," ); // locate next blank
320
321 files.push_back( rest.substr( 0, lpos == -1 ? string::npos : lpos ) ); // insert in list
322 if ( lpos == -1 ) break;
323 rest = rest.substr( lpos, string::npos ); // get the rest
324 }
325 ctxt->setFiles( files );
326 ctxt->setFileIterator( ctxt->files().begin() );
327 return StatusCode::SUCCESS;
328 }
329 return error( "Invalid iteration context." );
330}
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 226 of file RootEvtSelector.cpp.

226 {
227 RootEvtSelectorContext* pCtxt = dynamic_cast<RootEvtSelectorContext*>( &ctxt );
228 if ( pCtxt ) {
229 auto fileit = pCtxt->fileIterator();
230 if ( fileit != pCtxt->files().end() ) {
231 string input = *fileit;
232 m_dbMgr->disconnect( input ).ignore();
233 }
234 pCtxt->setFID( "" );
235 pCtxt->setEntry( -1 );
236 pCtxt->setBranch( nullptr );
237 pCtxt->setFileIterator( pCtxt->files().begin() );
238 return StatusCode::SUCCESS;
239 }
240 return StatusCode::FAILURE;
241}

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: