The Gaudi Framework  v30r4 (9b837755)
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 {
53  m_rootName = "/NTUPLES";
54  m_rootCLID = CLID_DataObject;
55 }
56 
57 // Initialize the service.
59 {
61  if ( status.isSuccess() ) {
62  status = setProperties();
63  if ( status.isSuccess() ) {
64  StatusCode iret( StatusCode::SUCCESS, true );
66  status = setRoot( m_rootName, root );
67  for ( auto& i : m_output ) {
68  iret = connect( i );
69  if ( !iret.isSuccess() ) status = iret;
70  }
71  for ( auto& j : m_input ) {
72  iret = connect( j );
73  if ( !iret.isSuccess() ) status = iret;
74  }
75  }
76  }
77  return status;
78 }
79 
82 
83 // Check if a datasource is connected
84 bool NTupleSvc::isConnected( const std::string& identifier ) const
85 {
86  auto i = m_connections.find( identifier );
87  return i != m_connections.end();
88 }
89 
92 {
93  if ( !pRegistry ) return nullptr;
94  std::string full = pRegistry->identifier();
95  auto len = m_rootName.length();
96  auto idx = full.find( SEPARATOR, len + 1 );
97  std::string path = ( idx == std::string::npos ) ? full : full.substr( 0, idx );
98  auto i = m_connections.find( path );
99  return ( i != m_connections.end() ) ? i->second.service : nullptr;
100 }
101 
103 {
104  long need_update = 0;
105  DataObject* pO = nullptr;
106  StatusCode iret = findObject( m_rootName.value(), pO );
107  // debug() << "in finalize()" << endmsg;
108  if ( iret.isSuccess() ) {
110  iret = objectLeaves( pO, leaves );
111  if ( iret.isSuccess() ) {
112  // Only traverse the tree below the files
113  for ( auto d = leaves.begin(); d != leaves.end(); d++ ) {
114  if ( !( *d )->object() ) continue;
115  IOpaqueAddress* pA = ( *d )->address();
116  if ( !pA ) continue;
117  unsigned long typ = pA->ipar()[1];
118  if ( typ != 'R' && typ != 'N' && typ != 'U' ) continue;
119  // ...starting from the file entries: first save the directories/ntuples
120  IConversionSvc* svc = getDataLoader( *d );
121  if ( !svc ) continue;
122 
124  IDataManagerSvc::traverseSubTree( ( *d )->object(), [&sel]( IRegistry* r, int ) {
125  DataObject* obj = r->object();
126  if ( obj ) sel.push_back( obj );
127  return true;
128  } ).ignore();
129  for ( DataObject* o : reverse( sel ) ) {
130  IRegistry* r = o->registry();
131  auto status = svc->updateRep( r->address(), o );
132  if ( !status.isSuccess() ) iret = status;
133  }
134  for ( DataObject* o : reverse( sel ) ) {
135  IRegistry* r = o->registry();
136  auto status = svc->updateRepRefs( r->address(), o );
137  if ( !status.isSuccess() ) iret = status;
138  }
139 
140  if ( iret.isSuccess() ) need_update += sel.size();
141  }
142  }
143  }
144  if ( !iret.isSuccess() ) {
145  error() << "ERROR while saving NTuples" << endmsg;
146  return iret;
147  }
148  if ( need_update > 0 ) {
149  info() << "NTuples saved successfully" << endmsg;
150  }
151  return iret;
152 }
153 
154 // Finalize single service
156 {
157  SmartIF<IService> isvc( c.service );
158  if ( isvc ) isvc->finalize().ignore();
159  c.service->release();
160  c.service = nullptr;
161 }
162 
163 // Close all open connections
165 {
166  auto i = m_connections.find( nam );
167  if ( i == m_connections.end() ) return StatusCode::FAILURE;
168  releaseConnection( i->second );
169  m_connections.erase( i );
170  return StatusCode::SUCCESS;
171 }
172 
173 // Close all open connections
175 {
176  for ( auto& i : m_connections ) releaseConnection( i.second );
177  m_connections.clear();
178  return StatusCode::SUCCESS;
179 }
180 
183 {
184  StatusCode status = updateDirectories();
185  status = clearStore();
186  status = DataSvc::finalize();
187  status = disconnectAll();
188  return status;
189 }
190 
192 {
193  std::string logName;
194  return connect( ident, logName );
195 }
196 
198 {
199  DataObject* pO = nullptr;
200  StatusCode status = findObject( m_rootName.value(), pO );
201  if ( status.isSuccess() ) {
202  char typ = 0;
203  std::vector<Prop> props;
204  long loc = ident.find( " " );
205  std::string filename, auth, svc = "", db_typ = "";
206  logname = ident.substr( 0, loc );
207  using Parser = Gaudi::Utils::AttribStringParser;
208  // we assume that there is always a " "
209  // (but if it is not there, we probably will not match the pattern)
210  for ( auto attrib : Parser( ident.substr( loc + 1 ) ) ) {
211  switch (::toupper( attrib.tag[0] ) ) {
212  case 'A':
213  break;
214  case 'F': // FILE='<file name>'
215  case 'D': // DATAFILE='<file name>'
216  filename = std::move( attrib.value );
217  break;
218  case 'O': // OPT='<NEW<CREATE,WRITE>, UPDATE, READ>'
219  switch (::toupper( attrib.value[0] ) ) {
220  case 'C':
221  case 'N':
222  case 'W':
223  typ = 'N';
224  break;
225  case 'U':
226  typ = 'U';
227  break;
228  case 'O':
229  case 'R':
230  typ = 'O';
231  break;
232  default:
233  typ = 0;
234  break;
235  }
236  break;
237  case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
238  db_typ = std::move( attrib.value );
239  break;
240  default:
241  props.emplace_back( attrib.tag, attrib.value );
242  break;
243  }
244  }
245  if ( 0 != typ ) {
246  IConversionSvc* pSvc = nullptr;
247  status = createService( name() + '.' + logname, db_typ, props, pSvc );
248  if ( status.isSuccess() ) {
249  status = attachTuple( filename, logname, typ, pSvc->repSvcType() );
250  if ( status.isSuccess() ) {
251  m_connections.insert( {m_rootName + '/' + logname, Connection( pSvc )} );
252  return StatusCode::SUCCESS;
253  }
254  }
255  }
256  }
257  error() << "Cannot add " << ident << " invalid filename!" << endmsg;
258  return StatusCode::FAILURE;
259 }
260 
262  const std::vector<Prop>& /* props */, IConversionSvc*& pSvc )
263 {
265  // Get the value of the Stat persistancy mechanism from the AppMgr
266  auto appPropMgr = serviceLocator()->as<IProperty>();
267  if ( !appPropMgr ) {
268  // Report an error and return the FAILURE status code
269  error() << "Could not get PropMgr" << endmsg;
270  return StatusCode::FAILURE;
271  }
272 
273  Gaudi::Property<std::string> sp( "HistogramPersistency", "" );
274  StatusCode sts = appPropMgr->getProperty( &sp );
275  if ( !sts.isSuccess() ) {
276  error() << "Could not get NTuple Persistency format"
277  << " from ApplicationMgr properties" << endmsg;
278  return sts;
279  }
280 
281  long storage_typ = TEST_StorageType;
282  if ( sp.value() == "HBOOK" ) {
283  storage_typ = HBOOK_StorageType;
284  } else if ( sp.value() == "ROOT" ) {
285  storage_typ = ROOT_StorageType;
286  } else {
287  error() << "Unknown NTuple Persistency format: " << sp.value() << endmsg;
288  return StatusCode::FAILURE;
289  }
290 
291  if ( !typ.empty() && typ != sp.value() ) {
292  warning() << "NTuple persistency type is " << sp.value() << "." << endmsg << "Type given by job option "
293  << "NTupleSvc.Input/Output ignored!" << endmsg;
294  }
295 
296  // debug() << "storage type: " << m_storageType << endmsg;
297 
298  // FIXME: (MCl) why NTupleSvc has to directly create a ConversionSvc?
299  IInterface* iface = new ConversionSvc( name() + "Conversions", serviceLocator(), storage_typ );
300  auto pService = SmartIF<IService>( iface );
301  if ( !pService ) return StatusCode::FAILURE;
302 
303  auto cnvSvc = pService.as<IConversionSvc>();
304  if ( !cnvSvc ) return StatusCode::FAILURE;
305 
306  pSvc = cnvSvc.get();
307  pSvc->addRef(); // make sure the caller gets a pSvc which points at something
308  // with a refCount of (at least) one...
309  auto status = pService->sysInitialize();
310  if ( !status.isSuccess() ) return status;
311  return pSvc->setDataProvider( this );
312 }
313 
315 StatusCode NTupleSvc::create( const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple )
316 {
317  NTuple::TupleImp* pTuple = nullptr;
319  if ( typ == CLID_ColumnWiseTuple ) {
320  pTuple = new NTuple::ColumnWiseTuple( title );
321  } else if ( typ == CLID_RowWiseTuple ) {
322  pTuple = new NTuple::RowWiseTuple( title );
323  } else {
325  }
326  if ( pTuple ) {
327  pTuple->setTupleService( this );
328  status = StatusCode::SUCCESS;
329  }
330  refpTuple = pTuple;
331  return status;
332 }
333 
335 NTuple::Tuple* NTupleSvc::book( const std::string& fullPath, const CLID& type, const std::string& title )
336 {
337  DataObject* pObj = nullptr;
338  std::string path = fullPath;
339  assert( !path.empty() );
340  if ( path[0] != SEPARATOR ) {
341  path = m_rootName;
342  path += SEPARATOR;
343  path += fullPath;
344  }
345  StatusCode status = retrieveObject( path, pObj );
346  if ( status.isSuccess() ) {
347  error() << "Cannot book N-tuple " << path << " (Exists already)" << endmsg;
348  return nullptr;
349  }
350  auto sep = path.rfind( SEPARATOR );
351  if ( sep == std::string::npos ) {
352  error() << "Cannot book N-tuple " << path << " (Invalid path)" << endmsg;
353  return nullptr;
354  }
355 
356  std::string p_path( path, 0, sep );
357  std::string o_path( path, sep, path.length() );
358  DataObject* dir = createDirectory( p_path );
359  if ( !dir ) {
360  error() << "Cannot book N-tuple " << path << " (Invalid parent directory)" << endmsg;
361  return nullptr;
362  }
363 
364  NTuple::Tuple* tup = book( dir, o_path, type, title );
365  if ( !tup ) {
366  error() << "Cannot book N-tuple " << path << " (Unknown reason)" << endmsg;
367  }
368  return tup;
369 }
370 
372 NTuple::Tuple* NTupleSvc::book( const std::string& dirPath, const std::string& relPath, const CLID& type,
373  const std::string& title )
374 {
375  std::string full = dirPath;
376  assert( !relPath.empty() );
377  if ( relPath[0] != SEPARATOR ) full += SEPARATOR;
378  full += relPath;
379  return book( full, type, title );
380 }
381 
383 NTuple::Tuple* NTupleSvc::book( const std::string& dirPath, long id, const CLID& type, const std::string& title )
384 {
385  return book( dirPath, std::to_string( id ), type, title );
386 }
387 
389 NTuple::Tuple* NTupleSvc::book( DataObject* pParent, const std::string& relPath, const CLID& type,
390  const std::string& title )
391 {
392  NTuple::Tuple* pObj = nullptr;
393  // Check if object is already present
394  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) );
395  // No ? Then create it!
396  if ( !status.isSuccess() ) {
397  status = create( type, title, pObj );
398  if ( status.isSuccess() ) {
399  // Finally register the created N tuple with the store
400  status = registerObject( pParent, relPath, pObj );
401  if ( status.isSuccess() ) return pObj;
402  pObj->release();
403  }
404  }
405  return nullptr;
406 }
407 
409 NTuple::Tuple* NTupleSvc::book( DataObject* pParent, long id, const CLID& type, const std::string& title )
410 {
411  return book( pParent, std::to_string( id ), type, title );
412 }
413 
416 {
417  assert( !relPath.empty() );
418  if ( pParent ) {
419  IRegistry* pDir = pParent->registry();
420  if ( pDir ) {
421  std::string full = pDir->identifier();
422  if ( relPath[0] != '/' ) full += "/";
423  full += relPath;
424  return createDirectory( full );
425  }
426  }
427  return nullptr;
428 }
429 
432 {
433  return createDirectory( pParent, std::to_string( id ) );
434 }
435 
438 {
439  return createDirectory( dirPath, std::to_string( id ) );
440 }
441 
444 {
445  assert( !relPath.empty() );
446  std::string full = dirPath;
447  if ( relPath[0] != '/' ) full += "/";
448  full += relPath;
449  return createDirectory( full );
450 }
451 
452 StatusCode NTupleSvc::attachTuple( const std::string& filename, const std::string& logname, const char typ,
453  const long t )
454 {
455  DataObject* p;
456  // First get the root object
457  StatusCode status = retrieveObject( m_rootName.value(), p );
458  if ( status.isSuccess() ) {
459  // Now add the registry entry to the store
460  std::string entryname = m_rootName;
461  entryname += '/';
462  entryname += logname;
463  GenericAddress* pA = new GenericAddress( t, CLID_NTupleFile, filename, entryname, 0, typ );
464  status = registerAddress( p, logname, pA );
465  if ( status.isSuccess() ) {
466  info() << "Added stream file:" << filename << " as " << logname << endmsg;
467  return status;
468  }
469  pA->release();
470  }
471  error() << "Cannot add file:" << filename << " as " << logname << endmsg;
472  return status;
473 }
474 
477 {
478  NTuple::Directory* p = nullptr;
479  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &p ) );
480  if ( !status.isSuccess() ) {
481  auto sep2 = fullPath.rfind( SEPARATOR );
482  if ( sep2 != std::string::npos ) {
483  std::string relPath = fullPath.substr( 0, sep2 );
484  p = createDirectory( relPath );
485  if ( p ) {
486  p = new NTuple::Directory();
487  // Finally register the created N tuple with the store
488  status = registerObject( fullPath, p );
489  if ( status.isSuccess() ) {
490  // ...starting from the file entries
491  IConversionSvc* svc = getDataLoader( p->registry() );
492  if ( svc ) {
493  IOpaqueAddress* pAddr = nullptr;
494  status = svc->createRep( p, pAddr );
495  if ( status.isSuccess() ) {
496  p->registry()->setAddress( pAddr );
497  status = svc->fillRepRefs( pAddr, p );
498  if ( status.isSuccess() ) return p;
499  }
500  }
501  unregisterObject( p );
502  }
503  p->release();
504  p = nullptr;
505  }
506  }
507  }
508  return dynamic_cast<NTuple::Directory*>( p );
509 }
510 
512 NTuple::Tuple* NTupleSvc::access( const std::string&, const std::string& ) { return nullptr; }
513 
516 {
517  NTuple::Tuple* pObj = nullptr;
518  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
519  return status.isSuccess() ? save( pObj ) : Status::INVALID_OBJ_PATH;
520 }
521 
524 {
525  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
526  if ( tuple ) {
527  try {
528  IConversionSvc* pSvc = tuple->conversionService();
529  IRegistry* pReg = tuple->registry();
530  if ( pSvc && pReg ) {
531  IOpaqueAddress* pAddr = pReg->address();
532  StatusCode sc = pSvc->updateRep( pAddr, n_tuple );
533  if ( sc.isSuccess() ) sc = pSvc->updateRepRefs( pAddr, n_tuple );
534  return sc;
535  }
536  return Status::NO_DATA_LOADER;
537  } catch ( ... ) {
538  }
539  }
540  return Status::INVALID_OBJECT;
541 }
542 
545 {
546  NTuple::Tuple* pObj = nullptr;
547  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
548  return status.isSuccess() ? save( pObj ) : Status::INVALID_OBJ_PATH;
549 }
550 
553 {
554  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
555  if ( tuple ) {
556  try {
557  IConversionSvc* pSvc = tuple->conversionService();
558  if ( !pSvc ) {
559  pSvc = getDataLoader( n_tuple->registry() );
560  tuple->setConversionService( pSvc );
561  }
562  if ( pSvc ) {
563  IRegistry* pReg = n_tuple->registry();
564  IOpaqueAddress* pAddr = pReg->address();
565  StatusCode status = pSvc->createRep( n_tuple, pAddr );
566  if ( status.isSuccess() ) {
567  pReg->setAddress( pAddr );
568  status = pSvc->fillRepRefs( pAddr, n_tuple );
569  }
570  return status;
571  }
572  return Status::NO_DATA_LOADER;
573  } catch ( ... ) {
574  }
575  }
576  return Status::INVALID_OBJECT;
577 }
578 
581 {
582  NTuple::Tuple* pObj = nullptr;
583  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
584  return status.isSuccess() ? writeRecord( pObj ) : Status::INVALID_OBJ_PATH;
585 }
586 
589 {
590  NTuple::Tuple* pObj = nullptr;
591  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
592  return status.isSuccess() ? writeRecord( pObj ) : Status::INVALID_OBJ_PATH;
593 }
594 
597 {
598  StatusCode status = Status::INVALID_OBJECT;
599  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
600  if ( tuple ) {
601  try {
602  IConversionSvc* pSvc = tuple->conversionService();
603  if ( !pSvc ) {
604  pSvc = getDataLoader( n_tuple->registry() );
605  tuple->setConversionService( pSvc );
606  }
607  if ( pSvc ) {
608  IRegistry* pReg = n_tuple->registry();
609  IOpaqueAddress* pAddr = pReg->address();
610  status = pSvc->updateObj( pAddr, n_tuple );
611  if ( status.isSuccess() ) {
612  status = pSvc->updateObjRefs( pAddr, n_tuple );
613  }
614  return status;
615  }
616  status = Status::NO_DATA_LOADER;
617  } catch ( ... ) {
618  status = Status::INVALID_OBJECT;
619  }
620  }
621  return status;
622 }
623 
626 {
627  NTuple::Tuple* pObj = nullptr;
628  StatusCode status = findObject( fullPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
629  return status.isSuccess() ? readRecord( pObj ) : Status::INVALID_OBJ_PATH;
630 }
631 
634 {
635  NTuple::Tuple* pObj = nullptr;
636  StatusCode status = findObject( pParent, relPath, *pp_cast<DataObject>( &pObj ) ); // Check if object is present
637  return status.isSuccess() ? readRecord( pObj ) : Status::INVALID_OBJ_PATH;
638 }
StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:235
Parse attribute strings allowing iteration over the various attributes.
void releaseConnection(Connection &c)
Finalize single service.
Definition: NTupleSvc.cpp:155
StatusCode unregisterObject(boost::string_ref fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:407
#define DECLARE_NAMESPACE_OBJECT_FACTORY(n, x)
Definition: ObjectFactory.h:16
const long TEST_StorageType
Definition: ClassID.h:49
constexpr static const auto FAILURE
Definition: StatusCode.h:88
T empty(T...args)
StatusCode writeRecord(NTuple::Tuple *tuple) override
Write single record to N tuple.
Definition: NTupleSvc.cpp:552
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:288
constexpr char SEPARATOR
Implementation of property with value of concrete type.
Definition: Property.h:383
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode initialize() override
DataSvc overrides: Initialize the service.
Definition: NTupleSvc.cpp:58
StatusCode reinitialize() override
DataSvc overrides: reinitialize service.
Definition: NTupleSvc.cpp:81
bool isSuccess() const
Definition: StatusCode.h:287
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:143
::details::reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:52
T rfind(T...args)
T to_string(T...args)
sel
Definition: IOTest.py:95
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:54
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
STL namespace.
std::map< std::string, Connection > m_connections
Container of connection points.
Definition: NTupleSvc.h:119
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:335
NTuple::Tuple * access(const std::string &fullPath, const std::string &filename) override
Access N tuple on disk.
Definition: NTupleSvc.cpp:512
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:164
SmartIF< IFace > as()
Definition: ISvcLocator.h:109
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:323
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
StatusCode updateDirectories()
Update directory data.
Definition: NTupleSvc.cpp:102
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:261
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:51
IConversionSvc * service
Definition: NTupleSvc.h:27
Definition of the basic interface.
Definition: IInterface.h:277
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:596
Gaudi::Property< DBaseEntries > m_output
Definition: NTupleSvc.h:116
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:216
NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title) override
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:415
bool isConnected(const std::string &identifier) const override
Check if a datasource is connected.
Definition: NTupleSvc.cpp:84
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:937
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:294
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
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:407
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:51
T find(T...args)
T size(T...args)
StatusCode finalize() override
DataSvc overrides: stop the service.
Definition: NTupleSvc.cpp:182
virtual unsigned long release()=0
Release Interface instance.
IConversionSvc * getDataLoader(IRegistry *pReg) override
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:91
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:900
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:515
Gaudi::Property< DBaseEntries > m_input
Definition: NTupleSvc.h:115
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:191
StatusCode create(const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple) override
Create requested N tuple (Hide constructor)
Definition: NTupleSvc.cpp:315
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:978
void setConversionService(IConversionSvc *svc)
Access conversion service.
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:587
StatusCode disconnectAll() override
Close all open connections.
Definition: NTupleSvc.cpp:174
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:679
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:452
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:703
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:291
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:108
IConversionSvc * conversionService() const
Access conversion service.
T emplace_back(T...args)