The Gaudi Framework  v32r2 (46d42edc)
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(), [&sel]( IRegistry* r, int ) {
120  DataObject* obj = r->object();
121  if ( obj ) sel.push_back( obj );
122  return true;
123  } ).ignore();
124  for ( DataObject* o : reverse( sel ) ) {
125  IRegistry* r = o->registry();
126  auto status = svc->updateRep( r->address(), o );
127  if ( !status.isSuccess() ) iret = status;
128  }
129  for ( DataObject* o : reverse( sel ) ) {
130  IRegistry* r = o->registry();
131  auto status = svc->updateRepRefs( r->address(), o );
132  if ( !status.isSuccess() ) iret = status;
133  }
134 
135  if ( iret.isSuccess() ) need_update += sel.size();
136  }
137  }
138  }
139  if ( !iret.isSuccess() ) {
140  error() << "ERROR while saving NTuples" << endmsg;
141  return iret;
142  }
143  if ( need_update > 0 ) { info() << "NTuples saved successfully" << endmsg; }
144  return iret;
145 }
146 
147 // Finalize single service
149  SmartIF<IService> isvc( c.service );
150  if ( isvc ) isvc->finalize().ignore();
151  c.service->release();
152  c.service = nullptr;
153 }
154 
155 // Close all open connections
157  auto i = m_connections.find( nam );
158  if ( i == m_connections.end() ) return StatusCode::FAILURE;
159  releaseConnection( i->second );
160  m_connections.erase( i );
161  return StatusCode::SUCCESS;
162 }
163 
164 // Close all open connections
166  for ( auto& i : m_connections ) releaseConnection( i.second );
167  m_connections.clear();
168  return StatusCode::SUCCESS;
169 }
170 
173  StatusCode status = updateDirectories();
174  status = clearStore();
175  status = DataSvc::finalize();
176  status = disconnectAll();
177  return status;
178 }
179 
181  std::string logName;
182  return connect( ident, logName );
183 }
184 
186  DataObject* pO = nullptr;
187  StatusCode status = findObject( m_rootName.value(), pO );
188  if ( status.isSuccess() ) {
189  char typ = 0;
190  std::vector<Prop> props;
191  long loc = ident.find( " " );
192  std::string filename, auth, svc = "", db_typ = "";
193  logname = ident.substr( 0, loc );
194  using Parser = Gaudi::Utils::AttribStringParser;
195  // we assume that there is always a " "
196  // (but if it is not there, we probably will not match the pattern)
197  for ( auto attrib : Parser( ident.substr( loc + 1 ) ) ) {
198  switch ( ::toupper( attrib.tag[0] ) ) {
199  case 'A':
200  break;
201  case 'F': // FILE='<file name>'
202  case 'D': // DATAFILE='<file name>'
203  filename = std::move( attrib.value );
204  break;
205  case 'O': // OPT='<NEW<CREATE,WRITE>, UPDATE, READ>'
206  switch ( ::toupper( attrib.value[0] ) ) {
207  case 'C':
208  case 'N':
209  case 'W':
210  typ = 'N';
211  break;
212  case 'U':
213  typ = 'U';
214  break;
215  case 'O':
216  case 'R':
217  typ = 'O';
218  break;
219  default:
220  typ = 0;
221  break;
222  }
223  break;
224  case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
225  db_typ = std::move( attrib.value );
226  break;
227  default:
228  props.emplace_back( attrib.tag, attrib.value );
229  break;
230  }
231  }
232  if ( 0 != typ ) {
233  IConversionSvc* pSvc = nullptr;
234  status = createService( name() + '.' + logname, db_typ, props, pSvc );
235  if ( status.isSuccess() ) {
236  status = attachTuple( filename, logname, typ, pSvc->repSvcType() );
237  if ( status.isSuccess() ) {
238  m_connections.insert( {m_rootName + '/' + logname, Connection( pSvc )} );
239  return StatusCode::SUCCESS;
240  }
241  }
242  }
243  }
244  error() << "Cannot add " << ident << " invalid filename!" << endmsg;
245  return StatusCode::FAILURE;
246 }
247 
249  const std::vector<Prop>& /* props */, IConversionSvc*& pSvc ) {
251  // Get the value of the Stat persistancy mechanism from the AppMgr
252  auto appPropMgr = serviceLocator()->as<IProperty>();
253  if ( !appPropMgr ) {
254  // Report an error and return the FAILURE status code
255  error() << "Could not get PropMgr" << endmsg;
256  return StatusCode::FAILURE;
257  }
258 
259  Gaudi::Property<std::string> sp( "HistogramPersistency", "" );
260  StatusCode sts = appPropMgr->getProperty( &sp );
261  if ( !sts.isSuccess() ) {
262  error() << "Could not get NTuple Persistency format"
263  << " from ApplicationMgr properties" << endmsg;
264  return sts;
265  }
266 
267  long storage_typ = TEST_StorageType;
268  if ( sp.value() == "HBOOK" ) {
269  storage_typ = HBOOK_StorageType;
270  } else if ( sp.value() == "ROOT" ) {
271  storage_typ = ROOT_StorageType;
272  } else {
273  error() << "Unknown NTuple Persistency format: " << sp.value() << endmsg;
274  return StatusCode::FAILURE;
275  }
276 
277  if ( !typ.empty() && typ != sp.value() ) {
278  warning() << "NTuple persistency type is " << sp.value() << "." << endmsg << "Type given by job option "
279  << "NTupleSvc.Input/Output ignored!" << endmsg;
280  }
281 
282  // debug() << "storage type: " << m_storageType << endmsg;
283 
284  // FIXME: (MCl) why NTupleSvc has to directly create a ConversionSvc?
285  IInterface* iface = new ConversionSvc( name() + "Conversions", serviceLocator(), storage_typ );
286  auto pService = SmartIF<IService>( iface );
287  if ( !pService ) return StatusCode::FAILURE;
288 
289  auto cnvSvc = pService.as<IConversionSvc>();
290  if ( !cnvSvc ) return StatusCode::FAILURE;
291 
292  pSvc = cnvSvc.get();
293  pSvc->addRef(); // make sure the caller gets a pSvc which points at something
294  // with a refCount of (at least) one...
295  auto status = pService->sysInitialize();
296  if ( !status.isSuccess() ) return status;
297  return pSvc->setDataProvider( this );
298 }
299 
301 StatusCode NTupleSvc::create( const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple ) {
302  NTuple::TupleImp* pTuple = nullptr;
304  if ( typ == CLID_ColumnWiseTuple ) {
305  pTuple = new NTuple::ColumnWiseTuple( title );
306  } else if ( typ == CLID_RowWiseTuple ) {
307  pTuple = new NTuple::RowWiseTuple( title );
308  } else {
310  }
311  if ( pTuple ) {
312  pTuple->setTupleService( this );
313  status = StatusCode::SUCCESS;
314  }
315  refpTuple = pTuple;
316  return status;
317 }
318 
320 NTuple::Tuple* NTupleSvc::book( const std::string& fullPath, const CLID& type, const std::string& title ) {
321  DataObject* pObj = nullptr;
322  std::string path = fullPath;
323  assert( !path.empty() );
324  if ( path[0] != SEPARATOR ) {
325  path = m_rootName;
326  path += SEPARATOR;
327  path += fullPath;
328  }
329  StatusCode status = retrieveObject( path, pObj );
330  if ( status.isSuccess() ) {
331  error() << "Cannot book N-tuple " << path << " (Exists already)" << endmsg;
332  return nullptr;
333  }
334  auto sep = path.rfind( SEPARATOR );
335  if ( sep == std::string::npos ) {
336  error() << "Cannot book N-tuple " << path << " (Invalid path)" << endmsg;
337  return nullptr;
338  }
339 
340  std::string p_path( path, 0, sep );
341  std::string o_path( path, sep, path.length() );
342  DataObject* dir = createDirectory( p_path );
343  if ( !dir ) {
344  error() << "Cannot book N-tuple " << path << " (Invalid parent directory)" << endmsg;
345  return nullptr;
346  }
347 
348  NTuple::Tuple* tup = book( dir, o_path, type, title );
349  if ( !tup ) { error() << "Cannot book N-tuple " << path << " (Unknown reason)" << endmsg; }
350  return tup;
351 }
352 
354 NTuple::Tuple* NTupleSvc::book( const std::string& dirPath, const std::string& relPath, const CLID& type,
355  const std::string& title ) {
356  std::string full = dirPath;
357  assert( !relPath.empty() );
358  if ( relPath[0] != SEPARATOR ) full += SEPARATOR;
359  full += relPath;
360  return book( full, type, title );
361 }
362 
364 NTuple::Tuple* NTupleSvc::book( const std::string& dirPath, long id, const CLID& type, const std::string& title ) {
365  return book( dirPath, std::to_string( id ), type, title );
366 }
367 
369 NTuple::Tuple* NTupleSvc::book( DataObject* pParent, const std::string& relPath, const CLID& type,
370  const std::string& title ) {
371  NTuple::Tuple* pObj = nullptr;
372  // Check if object is already present
373  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) );
374  // No ? Then create it!
375  if ( !status.isSuccess() ) {
376  status = create( type, title, pObj );
377  if ( status.isSuccess() ) {
378  // Finally register the created N tuple with the store
379  status = registerObject( pParent, relPath, pObj );
380  if ( status.isSuccess() ) return pObj;
381  pObj->release();
382  }
383  }
384  return nullptr;
385 }
386 
388 NTuple::Tuple* NTupleSvc::book( DataObject* pParent, long id, const CLID& type, const std::string& title ) {
389  return book( pParent, std::to_string( id ), type, title );
390 }
391 
394  assert( !relPath.empty() );
395  if ( pParent ) {
396  IRegistry* pDir = pParent->registry();
397  if ( pDir ) {
398  std::string full = pDir->identifier();
399  if ( relPath[0] != '/' ) full += "/";
400  full += relPath;
401  return createDirectory( full );
402  }
403  }
404  return nullptr;
405 }
406 
409  return createDirectory( pParent, std::to_string( id ) );
410 }
411 
414  return createDirectory( dirPath, std::to_string( id ) );
415 }
416 
419  assert( !relPath.empty() );
420  std::string full = dirPath;
421  if ( relPath[0] != '/' ) full += "/";
422  full += relPath;
423  return createDirectory( full );
424 }
425 
426 StatusCode NTupleSvc::attachTuple( const std::string& filename, const std::string& logname, const char typ,
427  const long t ) {
428  DataObject* p;
429  // First get the root object
430  StatusCode status = retrieveObject( m_rootName.value(), p );
431  if ( status.isSuccess() ) {
432  // Now add the registry entry to the store
433  std::string entryname = m_rootName;
434  entryname += '/';
435  entryname += logname;
436  GenericAddress* pA = new GenericAddress( t, CLID_NTupleFile, filename, entryname, 0, typ );
437  status = registerAddress( p, logname, pA );
438  if ( status.isSuccess() ) {
439  info() << "Added stream file:" << filename << " as " << logname << endmsg;
440  return status;
441  }
442  pA->release();
443  }
444  error() << "Cannot add file:" << filename << " as " << logname << endmsg;
445  return status;
446 }
447 
450  NTuple::Directory* p = nullptr;
451  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &p ) );
452  if ( !status.isSuccess() ) {
453  auto sep2 = fullPath.rfind( SEPARATOR );
454  if ( sep2 != std::string::npos ) {
455  std::string relPath = fullPath.substr( 0, sep2 );
456  p = createDirectory( relPath );
457  if ( p ) {
458  p = new NTuple::Directory();
459  // Finally register the created N tuple with the store
460  status = registerObject( fullPath, p );
461  if ( status.isSuccess() ) {
462  // ...starting from the file entries
463  IConversionSvc* svc = getDataLoader( p->registry() );
464  if ( svc ) {
465  IOpaqueAddress* pAddr = nullptr;
466  status = svc->createRep( p, pAddr );
467  if ( status.isSuccess() ) {
468  p->registry()->setAddress( pAddr );
469  status = svc->fillRepRefs( pAddr, p );
470  if ( status.isSuccess() ) return p;
471  }
472  }
473  unregisterObject( p );
474  }
475  p->release();
476  p = nullptr;
477  }
478  }
479  }
480  return p;
481 }
482 
484 NTuple::Tuple* NTupleSvc::access( const std::string&, const std::string& ) { return nullptr; }
485 
488  NTuple::Tuple* pObj = nullptr;
489  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
490  return status.isSuccess() ? save( pObj ) : Status::INVALID_OBJ_PATH;
491 }
492 
495  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
496  if ( tuple ) {
497  try {
498  IConversionSvc* pSvc = tuple->conversionService();
499  IRegistry* pReg = tuple->registry();
500  if ( pSvc && pReg ) {
501  IOpaqueAddress* pAddr = pReg->address();
502  StatusCode sc = pSvc->updateRep( pAddr, n_tuple );
503  if ( sc.isSuccess() ) sc = pSvc->updateRepRefs( pAddr, n_tuple );
504  return sc;
505  }
506  return Status::NO_DATA_LOADER;
507  } catch ( ... ) {}
508  }
509  return Status::INVALID_OBJECT;
510 }
511 
513 StatusCode NTupleSvc::save( DataObject* pParent, const std::string& relPath ) {
514  NTuple::Tuple* pObj = nullptr;
515  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
516  return status.isSuccess() ? save( pObj ) : Status::INVALID_OBJ_PATH;
517 }
518 
521  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
522  if ( tuple ) {
523  try {
524  IConversionSvc* pSvc = tuple->conversionService();
525  if ( !pSvc ) {
526  pSvc = getDataLoader( n_tuple->registry() );
527  tuple->setConversionService( pSvc );
528  }
529  if ( pSvc ) {
530  IRegistry* pReg = n_tuple->registry();
531  IOpaqueAddress* pAddr = pReg->address();
532  StatusCode status = pSvc->createRep( n_tuple, pAddr );
533  if ( status.isSuccess() ) {
534  pReg->setAddress( pAddr );
535  status = pSvc->fillRepRefs( pAddr, n_tuple );
536  }
537  return status;
538  }
539  return Status::NO_DATA_LOADER;
540  } catch ( ... ) {}
541  }
542  return Status::INVALID_OBJECT;
543 }
544 
547  NTuple::Tuple* pObj = nullptr;
548  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
549  return status.isSuccess() ? writeRecord( pObj ) : Status::INVALID_OBJ_PATH;
550 }
551 
554  NTuple::Tuple* pObj = nullptr;
555  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
556  return status.isSuccess() ? writeRecord( pObj ) : Status::INVALID_OBJ_PATH;
557 }
558 
561  StatusCode status = Status::INVALID_OBJECT;
562  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
563  if ( tuple ) {
564  try {
565  IConversionSvc* pSvc = tuple->conversionService();
566  if ( !pSvc ) {
567  pSvc = getDataLoader( n_tuple->registry() );
568  tuple->setConversionService( pSvc );
569  }
570  if ( pSvc ) {
571  IRegistry* pReg = n_tuple->registry();
572  IOpaqueAddress* pAddr = pReg->address();
573  status = pSvc->updateObj( pAddr, n_tuple );
574  if ( status.isSuccess() ) { status = pSvc->updateObjRefs( pAddr, n_tuple ); }
575  return status;
576  }
577  status = Status::NO_DATA_LOADER;
578  } catch ( ... ) { status = Status::INVALID_OBJECT; }
579  }
580  return status;
581 }
582 
585  NTuple::Tuple* pObj = nullptr;
586  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
587  return status.isSuccess() ? readRecord( pObj ) : Status::INVALID_OBJ_PATH;
588 }
589 
592  NTuple::Tuple* pObj = nullptr;
593  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
594  return status.isSuccess() ? readRecord( pObj ) : Status::INVALID_OBJ_PATH;
595 }
Parse attribute strings allowing iteration over the various attributes.
void releaseConnection(Connection &c)
Finalize single service.
Definition: NTupleSvc.cpp:148
const long TEST_StorageType
Definition: ClassID.h:49
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
T empty(T... args)
StatusCode writeRecord(NTuple::Tuple *tuple) override
Write single record to N tuple.
Definition: NTupleSvc.cpp:520
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
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
constexpr char SEPARATOR
Implementation of property with value of concrete type.
Definition: Property.h:352
virtual StatusCode traverseSubTree(std::string_view sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
StatusCode initialize() override
DataSvc overrides: Initialize the service.
Definition: NTupleSvc.cpp:57
bool isConnected(const std::string &identifier) const override
Check if a datasource is connected.
Definition: NTupleSvc.cpp:82
StatusCode reinitialize() override
DataSvc overrides: reinitialize service.
Definition: NTupleSvc.cpp:79
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:132
::details::reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:49
T rfind(T... args)
T to_string(T... args)
sel
Definition: IOTest.py:94
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:320
NTuple::Tuple * access(const std::string &fullPath, const std::string &filename) override
Access N tuple on disk.
Definition: NTupleSvc.cpp:484
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:156
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Generic Transient Address.
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
IConversionSvc * conversionService() const
Access conversion service.
StatusCode updateDirectories()
Update directory data.
Definition: NTupleSvc.cpp:98
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:248
STL class.
#define DECLARE_COMPONENT(type)
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode unregisterObject(std::string_view fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:373
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
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:560
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:198
NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title) override
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:393
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:845
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
bool isSuccess() const
Definition: StatusCode.h:267
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
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
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:215
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:46
T find(T... args)
StatusCode finalize() override
DataSvc overrides: stop the service.
Definition: NTupleSvc.cpp:172
#define DECLARE_NAMESPACE_OBJECT_FACTORY(n, x)
Definition: ObjectFactory.h:16
IConversionSvc * getDataLoader(IRegistry *pReg) override
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:88
NTuple service.
Definition: NTupleSvc.h:23
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:812
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:487
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:293
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:180
StatusCode create(const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple) override
Create requested N tuple (Hide constructor)
Definition: NTupleSvc.cpp:301
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:901
virtual const id_type & identifier() const =0
Full identifier (or key)
void setConversionService(IConversionSvc *svc)
Access conversion service.
StatusCode disconnectAll() override
Close all open connections.
Definition: NTupleSvc.cpp:165
StatusCode findObject(std::string_view fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:640
Opaque address interface definition.
Base class for all conversion services.
Definition: ConversionSvc.h:45
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:426
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:618
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
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:101
T emplace_back(T... args)