Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
NTupleSvc.cpp
Go to the documentation of this file.
1 //====================================================================
2 // NTupleSvc.cpp
3 //--------------------------------------------------------------------
4 //
5 // Package : GaudiSvc/NTupleSvc ( The LHCb Offline System)
6 //
7 // Description: implementation of the NTuple service
8 //
9 // Author : M.Frank
10 // History :
11 // +---------+----------------------------------------------+---------
12 // | Date | Comment | Who
13 // +---------+----------------------------------------------+---------
14 // | 29/10/98| Initial version | MF
15 // | 29/09/99| Added access to ICnvManager for missing |
16 // | | converters | MF
17 // | 20/09/00| Connect dynamically to conversion service |
18 // | | for N-tuple persistency | MF
19 // +---------+----------------------------------------------+---------
20 //
21 //====================================================================
22 #define GAUDISVC_NTUPLESVC_CPP
23 
24 // Framework include files
26 #include "GaudiKernel/DataObject.h"
29 #include "GaudiKernel/SmartIF.h"
30 
32 #include "GaudiKernel/IProperty.h"
33 #include "GaudiKernel/IRegistry.h"
35 
38 #include "GaudiKernel/Property.h"
39 #include "GaudiKernel/Selector.h"
40 #include "GaudiKernel/reverse.h"
41 
42 #include "NTupleSvc.h"
43 
44 // Instantiation of a static factory class used by clients to create
45 // instances of this service
47 
48 // Selector factory instantiation
50 
51 NTupleSvc::NTupleSvc( const std::string& name, ISvcLocator* svc ) : base_class( name, svc ) {
52  m_rootName = "/NTUPLES";
53  m_rootCLID = CLID_DataObject;
54 }
55 
56 // Initialize the service.
59  if ( status.isSuccess() ) {
60  status = setProperties();
61  if ( status.isSuccess() ) {
62  StatusCode iret( StatusCode::SUCCESS, true );
64  status = setRoot( m_rootName, root );
65  for ( auto& i : m_output ) {
66  iret = connect( i );
67  if ( !iret.isSuccess() ) status = iret;
68  }
69  for ( auto& j : m_input ) {
70  iret = connect( j );
71  if ( !iret.isSuccess() ) status = iret;
72  }
73  }
74  }
75  return status;
76 }
77 
80 
81 // Check if a datasource is connected
82 bool NTupleSvc::isConnected( const std::string& identifier ) const {
83  auto i = m_connections.find( identifier );
84  return i != m_connections.end();
85 }
86 
89  if ( !pRegistry ) return nullptr;
90  std::string full = pRegistry->identifier();
91  auto len = m_rootName.length();
92  auto idx = full.find( SEPARATOR, len + 1 );
93  std::string path = ( idx == std::string::npos ) ? full : full.substr( 0, idx );
94  auto i = m_connections.find( path );
95  return ( i != m_connections.end() ) ? i->second.service : nullptr;
96 }
97 
99  long need_update = 0;
100  DataObject* pO = nullptr;
101  StatusCode iret = findObject( m_rootName.value(), pO );
102  // debug() << "in finalize()" << endmsg;
103  if ( iret.isSuccess() ) {
105  iret = objectLeaves( pO, leaves );
106  if ( iret.isSuccess() ) {
107  // Only traverse the tree below the files
108  for ( auto d = leaves.begin(); d != leaves.end(); d++ ) {
109  if ( !( *d )->object() ) continue;
110  IOpaqueAddress* pA = ( *d )->address();
111  if ( !pA ) continue;
112  unsigned long typ = pA->ipar()[1];
113  if ( typ != 'R' && typ != 'N' && typ != 'U' ) continue;
114  // ...starting from the file entries: first save the directories/ntuples
115  IConversionSvc* svc = getDataLoader( *d );
116  if ( !svc ) continue;
117 
119  IDataManagerSvc::traverseSubTree( ( *d )->object(),
120  [&sel]( IRegistry* r, int ) {
121  DataObject* obj = r->object();
122  if ( obj ) sel.push_back( obj );
123  return true;
124  } )
125  .ignore();
126  for ( DataObject* o : reverse( sel ) ) {
127  IRegistry* r = o->registry();
128  auto status = svc->updateRep( r->address(), o );
129  if ( !status.isSuccess() ) iret = status;
130  }
131  for ( DataObject* o : reverse( sel ) ) {
132  IRegistry* r = o->registry();
133  auto status = svc->updateRepRefs( r->address(), o );
134  if ( !status.isSuccess() ) iret = status;
135  }
136 
137  if ( iret.isSuccess() ) need_update += sel.size();
138  }
139  }
140  }
141  if ( !iret.isSuccess() ) {
142  error() << "ERROR while saving NTuples" << endmsg;
143  return iret;
144  }
145  if ( need_update > 0 ) { info() << "NTuples saved successfully" << endmsg; }
146  return iret;
147 }
148 
149 // Finalize single service
151  SmartIF<IService> isvc( c.service );
152  if ( isvc ) isvc->finalize().ignore();
153  c.service->release();
154  c.service = nullptr;
155 }
156 
157 // Close all open connections
159  auto i = m_connections.find( nam );
160  if ( i == m_connections.end() ) return StatusCode::FAILURE;
161  releaseConnection( i->second );
162  m_connections.erase( i );
163  return StatusCode::SUCCESS;
164 }
165 
166 // Close all open connections
168  for ( auto& i : m_connections ) releaseConnection( i.second );
169  m_connections.clear();
170  return StatusCode::SUCCESS;
171 }
172 
175  StatusCode status = updateDirectories();
176  status = clearStore();
177  status = DataSvc::finalize();
178  status = disconnectAll();
179  return status;
180 }
181 
183  std::string logName;
184  return connect( ident, logName );
185 }
186 
188  DataObject* pO = nullptr;
189  StatusCode status = findObject( m_rootName.value(), pO );
190  if ( status.isSuccess() ) {
191  char typ = 0;
192  std::vector<Prop> props;
193  long loc = ident.find( " " );
194  std::string filename, auth, svc = "", db_typ = "";
195  logname = ident.substr( 0, loc );
196  using Parser = Gaudi::Utils::AttribStringParser;
197  // we assume that there is always a " "
198  // (but if it is not there, we probably will not match the pattern)
199  for ( auto attrib : Parser( ident.substr( loc + 1 ) ) ) {
200  switch ( ::toupper( attrib.tag[0] ) ) {
201  case 'A':
202  break;
203  case 'F': // FILE='<file name>'
204  case 'D': // DATAFILE='<file name>'
205  filename = std::move( attrib.value );
206  break;
207  case 'O': // OPT='<NEW<CREATE,WRITE>, UPDATE, READ>'
208  switch ( ::toupper( attrib.value[0] ) ) {
209  case 'C':
210  case 'N':
211  case 'W':
212  typ = 'N';
213  break;
214  case 'U':
215  typ = 'U';
216  break;
217  case 'O':
218  case 'R':
219  typ = 'O';
220  break;
221  default:
222  typ = 0;
223  break;
224  }
225  break;
226  case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
227  db_typ = std::move( attrib.value );
228  break;
229  default:
230  props.emplace_back( attrib.tag, attrib.value );
231  break;
232  }
233  }
234  if ( 0 != typ ) {
235  IConversionSvc* pSvc = nullptr;
236  status = createService( name() + '.' + logname, db_typ, props, pSvc );
237  if ( status.isSuccess() ) {
238  status = attachTuple( filename, logname, typ, pSvc->repSvcType() );
239  if ( status.isSuccess() ) {
240  m_connections.insert( {m_rootName + '/' + logname, Connection( pSvc )} );
241  return StatusCode::SUCCESS;
242  }
243  }
244  }
245  }
246  error() << "Cannot add " << ident << " invalid filename!" << endmsg;
247  return StatusCode::FAILURE;
248 }
249 
251  const std::vector<Prop>& /* props */, IConversionSvc*& pSvc ) {
253  // Get the value of the Stat persistancy mechanism from the AppMgr
254  auto appPropMgr = serviceLocator()->as<IProperty>();
255  if ( !appPropMgr ) {
256  // Report an error and return the FAILURE status code
257  error() << "Could not get PropMgr" << endmsg;
258  return StatusCode::FAILURE;
259  }
260 
261  Gaudi::Property<std::string> sp( "HistogramPersistency", "" );
262  StatusCode sts = appPropMgr->getProperty( &sp );
263  if ( !sts.isSuccess() ) {
264  error() << "Could not get NTuple Persistency format"
265  << " from ApplicationMgr properties" << endmsg;
266  return sts;
267  }
268 
269  long storage_typ = TEST_StorageType;
270  if ( sp.value() == "HBOOK" ) {
271  storage_typ = HBOOK_StorageType;
272  } else if ( sp.value() == "ROOT" ) {
273  storage_typ = ROOT_StorageType;
274  } else {
275  error() << "Unknown NTuple Persistency format: " << sp.value() << endmsg;
276  return StatusCode::FAILURE;
277  }
278 
279  if ( !typ.empty() && typ != sp.value() ) {
280  warning() << "NTuple persistency type is " << sp.value() << "." << endmsg << "Type given by job option "
281  << "NTupleSvc.Input/Output ignored!" << endmsg;
282  }
283 
284  // debug() << "storage type: " << m_storageType << endmsg;
285 
286  // FIXME: (MCl) why NTupleSvc has to directly create a ConversionSvc?
287  IInterface* iface = new ConversionSvc( name() + "Conversions", serviceLocator(), storage_typ );
288  auto pService = SmartIF<IService>( iface );
289  if ( !pService ) return StatusCode::FAILURE;
290 
291  auto cnvSvc = pService.as<IConversionSvc>();
292  if ( !cnvSvc ) return StatusCode::FAILURE;
293 
294  pSvc = cnvSvc.get();
295  pSvc->addRef(); // make sure the caller gets a pSvc which points at something
296  // with a refCount of (at least) one...
297  auto status = pService->sysInitialize();
298  if ( !status.isSuccess() ) return status;
299  return pSvc->setDataProvider( this );
300 }
301 
303 StatusCode NTupleSvc::create( const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple ) {
304  NTuple::TupleImp* pTuple = nullptr;
306  if ( typ == CLID_ColumnWiseTuple ) {
307  pTuple = new NTuple::ColumnWiseTuple( title );
308  } else if ( typ == CLID_RowWiseTuple ) {
309  pTuple = new NTuple::RowWiseTuple( title );
310  } else {
312  }
313  if ( pTuple ) {
314  pTuple->setTupleService( this );
315  status = StatusCode::SUCCESS;
316  }
317  refpTuple = pTuple;
318  return status;
319 }
320 
322 NTuple::Tuple* NTupleSvc::book( const std::string& fullPath, const CLID& type, const std::string& title ) {
323  DataObject* pObj = nullptr;
324  std::string path = fullPath;
325  assert( !path.empty() );
326  if ( path[0] != SEPARATOR ) {
327  path = m_rootName;
328  path += SEPARATOR;
329  path += fullPath;
330  }
331  StatusCode status = retrieveObject( path, pObj );
332  if ( status.isSuccess() ) {
333  error() << "Cannot book N-tuple " << path << " (Exists already)" << endmsg;
334  return nullptr;
335  }
336  auto sep = path.rfind( SEPARATOR );
337  if ( sep == std::string::npos ) {
338  error() << "Cannot book N-tuple " << path << " (Invalid path)" << endmsg;
339  return nullptr;
340  }
341 
342  std::string p_path( path, 0, sep );
343  std::string o_path( path, sep, path.length() );
344  DataObject* dir = createDirectory( p_path );
345  if ( !dir ) {
346  error() << "Cannot book N-tuple " << path << " (Invalid parent directory)" << endmsg;
347  return nullptr;
348  }
349 
350  NTuple::Tuple* tup = book( dir, o_path, type, title );
351  if ( !tup ) { error() << "Cannot book N-tuple " << path << " (Unknown reason)" << endmsg; }
352  return tup;
353 }
354 
356 NTuple::Tuple* NTupleSvc::book( const std::string& dirPath, const std::string& relPath, const CLID& type,
357  const std::string& title ) {
358  std::string full = dirPath;
359  assert( !relPath.empty() );
360  if ( relPath[0] != SEPARATOR ) full += SEPARATOR;
361  full += relPath;
362  return book( full, type, title );
363 }
364 
366 NTuple::Tuple* NTupleSvc::book( const std::string& dirPath, long id, const CLID& type, const std::string& title ) {
367  return book( dirPath, std::to_string( id ), type, title );
368 }
369 
371 NTuple::Tuple* NTupleSvc::book( DataObject* pParent, const std::string& relPath, const CLID& type,
372  const std::string& title ) {
373  NTuple::Tuple* pObj = nullptr;
374  // Check if object is already present
375  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) );
376  // No ? Then create it!
377  if ( !status.isSuccess() ) {
378  status = create( type, title, pObj );
379  if ( status.isSuccess() ) {
380  // Finally register the created N tuple with the store
381  status = registerObject( pParent, relPath, pObj );
382  if ( status.isSuccess() ) return pObj;
383  pObj->release();
384  }
385  }
386  return nullptr;
387 }
388 
390 NTuple::Tuple* NTupleSvc::book( DataObject* pParent, long id, const CLID& type, const std::string& title ) {
391  return book( pParent, std::to_string( id ), type, title );
392 }
393 
396  assert( !relPath.empty() );
397  if ( pParent ) {
398  IRegistry* pDir = pParent->registry();
399  if ( pDir ) {
400  std::string full = pDir->identifier();
401  if ( relPath[0] != '/' ) full += "/";
402  full += relPath;
403  return createDirectory( full );
404  }
405  }
406  return nullptr;
407 }
408 
411  return createDirectory( pParent, std::to_string( id ) );
412 }
413 
416  return createDirectory( dirPath, std::to_string( id ) );
417 }
418 
421  assert( !relPath.empty() );
422  std::string full = dirPath;
423  if ( relPath[0] != '/' ) full += "/";
424  full += relPath;
425  return createDirectory( full );
426 }
427 
428 StatusCode NTupleSvc::attachTuple( const std::string& filename, const std::string& logname, const char typ,
429  const long t ) {
430  DataObject* p;
431  // First get the root object
432  StatusCode status = retrieveObject( m_rootName.value(), p );
433  if ( status.isSuccess() ) {
434  // Now add the registry entry to the store
435  std::string entryname = m_rootName;
436  entryname += '/';
437  entryname += logname;
438  GenericAddress* pA = new GenericAddress( t, CLID_NTupleFile, filename, entryname, 0, typ );
439  status = registerAddress( p, logname, pA );
440  if ( status.isSuccess() ) {
441  info() << "Added stream file:" << filename << " as " << logname << endmsg;
442  return status;
443  }
444  pA->release();
445  }
446  error() << "Cannot add file:" << filename << " as " << logname << endmsg;
447  return status;
448 }
449 
452  NTuple::Directory* p = nullptr;
453  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &p ) );
454  if ( !status.isSuccess() ) {
455  auto sep2 = fullPath.rfind( SEPARATOR );
456  if ( sep2 != std::string::npos ) {
457  std::string relPath = fullPath.substr( 0, sep2 );
458  p = createDirectory( relPath );
459  if ( p ) {
460  p = new NTuple::Directory();
461  // Finally register the created N tuple with the store
462  status = registerObject( fullPath, p );
463  if ( status.isSuccess() ) {
464  // ...starting from the file entries
465  IConversionSvc* svc = getDataLoader( p->registry() );
466  if ( svc ) {
467  IOpaqueAddress* pAddr = nullptr;
468  status = svc->createRep( p, pAddr );
469  if ( status.isSuccess() ) {
470  p->registry()->setAddress( pAddr );
471  status = svc->fillRepRefs( pAddr, p );
472  if ( status.isSuccess() ) return p;
473  }
474  }
475  unregisterObject( p );
476  }
477  p->release();
478  p = nullptr;
479  }
480  }
481  }
482  return p;
483 }
484 
486 NTuple::Tuple* NTupleSvc::access( const std::string&, const std::string& ) { return nullptr; }
487 
490  NTuple::Tuple* pObj = nullptr;
491  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
492  return status.isSuccess() ? save( pObj ) : Status::INVALID_OBJ_PATH;
493 }
494 
497  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
498  if ( tuple ) {
499  try {
500  IConversionSvc* pSvc = tuple->conversionService();
501  IRegistry* pReg = tuple->registry();
502  if ( pSvc && pReg ) {
503  IOpaqueAddress* pAddr = pReg->address();
504  StatusCode sc = pSvc->updateRep( pAddr, n_tuple );
505  if ( sc.isSuccess() ) sc = pSvc->updateRepRefs( pAddr, n_tuple );
506  return sc;
507  }
508  return Status::NO_DATA_LOADER;
509  } catch ( ... ) {}
510  }
511  return Status::INVALID_OBJECT;
512 }
513 
515 StatusCode NTupleSvc::save( DataObject* pParent, const std::string& relPath ) {
516  NTuple::Tuple* pObj = nullptr;
517  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
518  return status.isSuccess() ? save( pObj ) : Status::INVALID_OBJ_PATH;
519 }
520 
523  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
524  if ( tuple ) {
525  try {
526  IConversionSvc* pSvc = tuple->conversionService();
527  if ( !pSvc ) {
528  pSvc = getDataLoader( n_tuple->registry() );
529  tuple->setConversionService( pSvc );
530  }
531  if ( pSvc ) {
532  IRegistry* pReg = n_tuple->registry();
533  IOpaqueAddress* pAddr = pReg->address();
534  StatusCode status = pSvc->createRep( n_tuple, pAddr );
535  if ( status.isSuccess() ) {
536  pReg->setAddress( pAddr );
537  status = pSvc->fillRepRefs( pAddr, n_tuple );
538  }
539  return status;
540  }
541  return Status::NO_DATA_LOADER;
542  } catch ( ... ) {}
543  }
544  return Status::INVALID_OBJECT;
545 }
546 
549  NTuple::Tuple* pObj = nullptr;
550  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
551  return status.isSuccess() ? writeRecord( pObj ) : Status::INVALID_OBJ_PATH;
552 }
553 
556  NTuple::Tuple* pObj = nullptr;
557  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
558  return status.isSuccess() ? writeRecord( pObj ) : Status::INVALID_OBJ_PATH;
559 }
560 
563  StatusCode status = Status::INVALID_OBJECT;
564  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
565  if ( tuple ) {
566  try {
567  IConversionSvc* pSvc = tuple->conversionService();
568  if ( !pSvc ) {
569  pSvc = getDataLoader( n_tuple->registry() );
570  tuple->setConversionService( pSvc );
571  }
572  if ( pSvc ) {
573  IRegistry* pReg = n_tuple->registry();
574  IOpaqueAddress* pAddr = pReg->address();
575  status = pSvc->updateObj( pAddr, n_tuple );
576  if ( status.isSuccess() ) { status = pSvc->updateObjRefs( pAddr, n_tuple ); }
577  return status;
578  }
579  status = Status::NO_DATA_LOADER;
580  } catch ( ... ) { status = Status::INVALID_OBJECT; }
581  }
582  return status;
583 }
584 
587  NTuple::Tuple* pObj = nullptr;
588  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
589  return status.isSuccess() ? readRecord( pObj ) : Status::INVALID_OBJ_PATH;
590 }
591 
594  NTuple::Tuple* pObj = nullptr;
595  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
596  return status.isSuccess() ? readRecord( pObj ) : Status::INVALID_OBJ_PATH;
597 }
StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:217
Parse attribute strings allowing iteration over the various attributes.
void releaseConnection(Connection &c)
Finalize single service.
Definition: NTupleSvc.cpp:150
StatusCode unregisterObject(boost::string_ref fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:375
#define DECLARE_NAMESPACE_OBJECT_FACTORY(n, x)
Definition: ObjectFactory.h:16
const long TEST_StorageType
Definition: ClassID.h:49
T empty(T...args)
StatusCode writeRecord(NTuple::Tuple *tuple) override
Write single record to N tuple.
Definition: NTupleSvc.cpp:522
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
const long HBOOK_StorageType
Definition: ClassID.h:56
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
constexpr char SEPARATOR
Implementation of property with value of concrete type.
Definition: Property.h:352
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode initialize() override
DataSvc overrides: Initialize the service.
Definition: NTupleSvc.cpp:57
StatusCode reinitialize() override
DataSvc overrides: reinitialize service.
Definition: NTupleSvc.cpp:79
bool isSuccess() const
Definition: StatusCode.h:267
unsigned long release() override
release reference to object
StatusCode setRoot(std::string root_name, DataObject *pRootObj) override
Initialize data store for new event by giving new event path and root object.
Definition: DataSvc.cpp:134
::details::reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:49
T rfind(T...args)
T to_string(T...args)
sel
Definition: IOTest.py:93
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:52
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL namespace.
std::map< std::string, Connection > m_connections
Container of connection points.
Definition: NTupleSvc.h:118
NTuple::Tuple * book(const std::string &fullPath, const CLID &type, const std::string &title) override
Book Ntuple and register it with the data store.
Definition: NTupleSvc.cpp:322
NTuple::Tuple * access(const std::string &fullPath, const std::string &filename) override
Access N tuple on disk.
Definition: NTupleSvc.cpp:486
T end(T...args)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
StatusCode disconnect(const std::string &nam) override
Close open connection.
Definition: NTupleSvc.cpp:158
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
Generic Transient Address.
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
StatusCode registerObject(boost::string_ref parentPath, boost::string_ref objPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:295
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
StatusCode updateDirectories()
Update directory data.
Definition: NTupleSvc.cpp:98
virtual StatusCode traverseSubTree(boost::string_ref sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
NTuple name space.
Definition: INTupleSvc.h:9
StatusCode createService(const std::string &nam, const std::string &typ, const std::vector< Prop > &props, IConversionSvc *&pSvc)
Create conversion service.
Definition: NTupleSvc.cpp:250
STL class.
#define DECLARE_COMPONENT(type)
T push_back(T...args)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
virtual const id_type & identifier() const =0
Full identifier (or key)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IConversionSvc * service
Definition: NTupleSvc.h:26
Definition of the basic interface.
Definition: IInterface.h:244
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
StatusCode readRecord(NTuple::Tuple *tuple) override
Read single record from N tuple.
Definition: NTupleSvc.cpp:562
Gaudi::Property< DBaseEntries > m_output
Definition: NTupleSvc.h:115
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: DataSvc.cpp:200
NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title) override
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:395
bool isConnected(const std::string &identifier) const override
Check if a datasource is connected.
Definition: NTupleSvc.cpp:82
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
const long ROOT_StorageType
Definition: ClassID.h:52
StatusCode finalize() override
Service initialization.
Definition: DataSvc.cpp:847
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the converted representation of a transient object.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
T move(T...args)
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
Definition: Service.cpp:280
virtual DataObject * object() const =0
Retrieve object behind the link.
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:375
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:46
T find(T...args)
T size(T...args)
StatusCode finalize() override
DataSvc overrides: stop the service.
Definition: NTupleSvc.cpp:174
virtual unsigned long release()=0
Release Interface instance.
IConversionSvc * getDataLoader(IRegistry *pReg) override
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:88
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
NTuple service.
Definition: NTupleSvc.h:23
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:814
T begin(T...args)
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
void setTupleService(INTupleSvc *svc)
Access conversion service.
StatusCode save(const std::string &fullPath) override
Save N tuple to disk. Must be called in order to close the ntuple file properly.
Definition: NTupleSvc.cpp:489
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Gaudi::Property< DBaseEntries > m_input
Definition: NTupleSvc.h:114
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
T substr(T...args)
StatusCode connect(const std::string &ident) override
Add file to list I/O list.
Definition: NTupleSvc.cpp:182
StatusCode create(const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple) override
Create requested N tuple (Hide constructor)
Definition: NTupleSvc.cpp:303
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:901
void setConversionService(IConversionSvc *svc)
Access conversion service.
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:525
StatusCode disconnectAll() override
Close all open connections.
Definition: NTupleSvc.cpp:167
Opaque address interface definition.
Base class for all conversion services.
Definition: ConversionSvc.h:45
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:620
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
StatusCode attachTuple(const std::string &filename, const std::string &logname, const char typ, const long t)
Attach output/input file.
Definition: NTupleSvc.cpp:428
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:642
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:103
IConversionSvc * conversionService() const
Access conversion service.
T emplace_back(T...args)