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
25 #include "GaudiKernel/SmartIF.h"
27 #include "GaudiKernel/DataObject.h"
30 
31 #include "GaudiKernel/IProperty.h"
34 
35 #include "GaudiKernel/Property.h"
36 #include "GaudiKernel/Selector.h"
40 
41 #include "NTupleSvc.h"
42 
43 // Instantiation of a static factory class used by clients to create
44 // instances of this service
46 
49 
50 #include <sstream>
51 
52 namespace {
53  inline std::string toStr(long id) {
54  std::ostringstream s; s << id;
55  return s.str();
56  }
57 }
58 
61  : base_class(name, svc)
62 {
63  declareProperty("Input", m_input);
64  declareProperty("Output", m_output);
65  m_rootName = "/NTUPLES";
66  m_rootCLID = CLID_DataObject;
67 }
68 
71 }
72 
76  if ( status.isSuccess() ) {
77  status = setProperties();
78  if ( status.isSuccess() ) {
81  status = setRoot(m_rootName, root);
82  for ( auto& i : m_output ) {
83  iret = connect(i);
84  if ( !iret.isSuccess() ) status = iret;
85  }
86  for ( auto& j : m_input ) {
87  iret = connect(j);
88  if ( !iret.isSuccess() ) status = iret;
89  }
90  }
91  }
92  return status;
93 }
94 
97  return StatusCode::SUCCESS;
98 }
99 
100 // Check if a datasource is connected
101 bool NTupleSvc::isConnected(const std::string& identifier) const {
102  auto i = m_connections.find(identifier);
103  return i!=m_connections.end();
104 }
105 
108  if ( !pRegistry ) return nullptr;
109  std::string full = pRegistry->identifier();
110  auto len = m_rootName.length();
111  auto idx = full.find(SEPARATOR,len+1);
112  std::string path = (idx==std::string::npos) ? full : full.substr(0, idx);
113  auto i = m_connections.find(path);
114  return ( i != m_connections.end() ) ? i->second.service
115  : nullptr;
116 }
117 
119  typedef std::vector<IRegistry*> Leaves;
120  long need_update = 0;
121  DataObject* pO = nullptr;
122  StatusCode iret = findObject(m_rootName, pO);
123  // debug() << "in finalize()" << endmsg;
124  if ( iret.isSuccess() ) {
125  Leaves leaves;
126  iret = objectLeaves(pO, leaves);
127  if ( iret.isSuccess() ) {
128  // Only traverse the tree below the files
129  for ( auto d = leaves.begin(); d != leaves.end(); d++ ) {
130  if ( !(*d)->object() ) continue;
131  IOpaqueAddress* pA = (*d)->address();
132  if ( !pA ) continue;
133  unsigned long typ = pA->ipar()[1];
134  if ( typ != 'R' && typ != 'N' && typ != 'U' ) continue;
135  // ...starting from the file entries: first save the directories/ntuples
136  IConversionSvc* svc = getDataLoader(*d);
137  if ( !svc ) continue;
138 
139  StatusCode status;
140  DataSelectionAgent agent;
141  IDataSelector* sel = agent.selectedObjects();
142  traverseSubTree ( (*d)->object(), &agent ).ignore();
143  for(int i = sel->size()-1; i >= 0; i-- ) {
144  DataObject* o = (*sel)[i];
145  IRegistry* r = o->registry();
146  status = svc->updateRep(r->address(), o);
147  if ( !status.isSuccess() ) {
148  iret = status;
149  }
150  }
151  for(int j = sel->size()-1; j >= 0; j-- ) {
152  DataObject* o = (*sel)[j];
153  IRegistry* r = o->registry();
154  status = svc->updateRepRefs(r->address(), o);
155  if ( !status.isSuccess() ) iret = status;
156  }
157  if ( iret.isSuccess() ) need_update += sel->size();
158  }
159  }
160  }
161  if ( !iret.isSuccess() ) {
162  error() << "ERROR while saving NTuples" << endmsg;
163  return iret;
164  }
165  else if ( need_update > 0 ) {
166  info() << "NTuples saved successfully" << endmsg;
167  }
168  return iret;
169 }
170 
171 // Finalize single service
173  SmartIF<IService> isvc( c.service );
174  if ( isvc ) isvc->finalize().ignore();
175  c.service->release();
176  c.service = nullptr;
177 }
178 
179 // Close all open connections
181  auto i = m_connections.find(nam);
182  if ( i != m_connections.end() ) {
183  releaseConnection(i->second);
185  return StatusCode::SUCCESS;
186  }
187  return StatusCode::FAILURE;
188 }
189 
190 // Close all open connections
192  for(auto &i : m_connections ) releaseConnection(i.second);
193  m_connections.clear();
194  return StatusCode::SUCCESS;
195 }
196 
199  StatusCode status = updateDirectories();
200  status = clearStore();
201  status = DataSvc::finalize();
202  status = disconnectAll();
203  return status;
204 }
205 
207  std::string logName;
208  return connect(ident, logName);
209 }
210 
212  DataObject* pO = nullptr;
213  StatusCode status = findObject(m_rootName, pO);
214  if ( status.isSuccess() ) {
215  char typ=0;
216  std::vector<Prop> props;
217  long loc = ident.find(" ");
218  std::string filename, auth, svc = "", db_typ = "";
219  logname = ident.substr(0, loc);
220  using Parser = Gaudi::Utils::AttribStringParser;
221  // we assume that there is always a " "
222  // (but if it is not there, we probably will not match the pattern)
223  for (auto attrib: Parser(ident.substr(loc + 1))) {
224  switch( ::toupper(attrib.tag[0]) ) {
225  case 'A':
226  break;
227  case 'F': // FILE='<file name>'
228  case 'D': // DATAFILE='<file name>'
229  filename = std::move(attrib.value);
230  break;
231  case 'O': // OPT='<NEW<CREATE,WRITE>, UPDATE, READ>'
232  switch( ::toupper(attrib.value[0]) ) {
233  case 'C':
234  case 'N':
235  case 'W':
236  typ = 'N';
237  break;
238  case 'U':
239  typ = 'U';
240  break;
241  case 'O':
242  case 'R':
243  typ = 'O';
244  break;
245  default:
246  typ = 0;
247  break;
248  }
249  break;
250  case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
251  db_typ = std::move(attrib.value);
252  break;
253  default:
254  props.emplace_back( attrib.tag, attrib.value);
255  break;
256  }
257  }
258  if ( 0 != typ ) {
259  IConversionSvc* pSvc = nullptr;
260  status = createService(name()+'.'+logname, db_typ, props, pSvc);
261  if ( status.isSuccess() ) {
262  status = attachTuple(filename, logname, typ, pSvc->repSvcType());
263  if ( status.isSuccess() ) {
264  m_connections.insert(Connections::value_type(m_rootName+'/'+logname,Connection(pSvc)));
265  return StatusCode::SUCCESS;
266  }
267  }
268  }
269  }
270  error() << "Cannot add " << ident << " invalid filename!" << endmsg;
271  return StatusCode::FAILURE;
272 }
273 
275  const std::string& typ,
276  const std::vector<Prop>& /* props */,
277  IConversionSvc*& pSvc)
278 {
280  // Get the value of the Stat persistancy mechanism from the AppMgr
281  auto appPropMgr = serviceLocator()->as<IProperty>();
282  if( !appPropMgr ) {
283  // Report an error and return the FAILURE status code
284  error() << "Could not get PropMgr" << endmsg;
285  return StatusCode::FAILURE;
286  }
287 
288  StringProperty sp("HistogramPersistency","");
289  StatusCode sts = appPropMgr->getProperty( &sp );
290  if ( !sts.isSuccess() ) {
291  error() << "Could not get NTuple Persistency format"
292  << " from ApplicationMgr properties" << endmsg;
293  return sts;
294  }
295 
296  long storage_typ = TEST_StorageType;
297  if ( sp.value() == "HBOOK" ) {
298  storage_typ = HBOOK_StorageType;
299  }
300  else if ( sp.value() == "ROOT" ) {
301  storage_typ = ROOT_StorageType;
302  }
303  else {
304  error() << "Unknown NTuple Persistency format: " << sp.value() << endmsg;
305  return StatusCode::FAILURE;
306  }
307 
308  if ( !typ.empty() && typ != sp.value() ) {
309  warning() << "NTuple persistency type is "
310  << sp.value() << "." << endmsg
311  << "Type given by job option "
312  << "NTupleSvc.Input/Output ignored!" << endmsg;
313  }
314 
315  // debug() << "storage type: " << m_storageType << endmsg;
316 
317  // FIXME: (MCl) why NTupleSvc has to directly create a ConversionSvc?
318  IInterface* iface = new ConversionSvc(name()+"Conversions", serviceLocator(), storage_typ);
319  auto pService = SmartIF<IService>( iface );
320  if ( !pService ) return StatusCode::FAILURE;
321 
322  auto cnvSvc = pService.as<IConversionSvc>();
323  if (!cnvSvc) return StatusCode::FAILURE;
324 
325  pSvc = cnvSvc.get();
326  pSvc->addRef(); // make sure the caller gets a pSvc which points at something
327  // with a refCount of (at least) one...
328  auto status = pService->sysInitialize();
329  if ( !status.isSuccess() ) return status;
330  return pSvc->setDataProvider(this);
331 }
332 
334 StatusCode NTupleSvc::create(const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple) {
335  NTuple::TupleImp* pTuple = nullptr;
337  if ( typ == CLID_ColumnWiseTuple ) {
338  pTuple = new NTuple::ColumnWiseTuple( title );
339  }
340  else if ( typ == CLID_RowWiseTuple ) {
341  pTuple = new NTuple::RowWiseTuple( title );
342  }
343  else {
345  }
346  if ( pTuple ) {
347  pTuple->setTupleService(this);
348  status = StatusCode::SUCCESS;
349  }
350  refpTuple = pTuple;
351  return status;
352 }
353 
355 NTuple::Tuple* NTupleSvc::book (const std::string& fullPath, const CLID& type, const std::string& title) {
356  DataObject* pObj = nullptr;
357  std::string path = fullPath;
358  if ( path[0] != SEPARATOR ) {
359  path = m_rootName;
360  path += SEPARATOR;
361  path += fullPath;
362  }
363  StatusCode status = retrieveObject(path, pObj);
364  if ( status.isSuccess() ) {
365  error() << "Cannot book N-tuple " << path << " (Exists already)" << endmsg;
366  return nullptr;
367  }
368  auto sep = path.rfind(SEPARATOR);
369  if ( sep == std::string::npos ) {
370  error() << "Cannot book N-tuple " << path << " (Invalid path)" << endmsg;
371  return nullptr;
372  }
373 
374  std::string p_path (path, 0, sep);
375  std::string o_path (path, sep, path.length());
376  DataObject* dir = createDirectory(p_path);
377  if ( !dir ) {
378  error() << "Cannot book N-tuple " << path << " (Invalid parent directory)" << endmsg;
379  return nullptr;
380  }
381 
382  NTuple::Tuple* tup = book( dir, o_path, type, title);
383  if ( !tup ) {
384  error() << "Cannot book N-tuple " << path << " (Unknown reason)" << endmsg;
385  }
386  return tup;
387 }
388 
390 NTuple::Tuple* NTupleSvc::book (const std::string& dirPath, const std::string& relPath, const CLID& type, const std::string& title) {
391  std::string full = dirPath;
392  if (relPath[0] != SEPARATOR) full += SEPARATOR;
393  full += relPath;
394  return book(full, type, title);
395 }
396 
398 NTuple::Tuple* NTupleSvc::book (const std::string& dirPath, long id, const CLID& type, const std::string& title) {
399  return book( dirPath, toStr(id), type, title);
400 }
401 
403 NTuple::Tuple* NTupleSvc::book (DataObject* pParent, const std::string& relPath, const CLID& type, const std::string& title) {
404  NTuple::Tuple* pObj = nullptr;
405  // Check if object is already present
406  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj));
407  // No ? Then create it!
408  if ( !status.isSuccess() ) {
409  status = create( type, title, pObj);
410  if ( status.isSuccess() ) {
411  // Finally register the created N tuple with the store
412  status = registerObject(pParent, relPath, pObj);
413  if ( status.isSuccess() ) return pObj;
414  pObj->release();
415  }
416  }
417  return nullptr;
418 }
419 
422  long id,
423  const CLID& type,
424  const std::string& title) {
425  return book( pParent, toStr(id), type, title);
426 }
427 
430  const std::string& relPath) {
431  if ( pParent ) {
432  IRegistry* pDir = pParent->registry();
433  if ( pDir ) {
434  std::string full = pDir->identifier();
435  if (relPath[0]!='/') full += "/";
436  full += relPath;
437  return createDirectory(full);
438  }
439  }
440  return nullptr;
441 }
442 
445  return createDirectory( pParent, toStr(id) );
446 }
447 
450  return createDirectory( dirPath, toStr(id) );
451 }
452 
455  std::string full = dirPath;
456  if (relPath[0]!='/') full += "/";
457  full += relPath;
458  return createDirectory(full);
459 }
460 
461 StatusCode NTupleSvc::attachTuple(const std::string& filename, const std::string& logname, const char typ, const long t) {
462  DataObject* p;
463  // First get the root object
464  StatusCode status = retrieveObject(m_rootName, p);
465  if ( status.isSuccess() ) {
466  // Now add the registry entry to the store
467  std::string entryname = m_rootName;
468  entryname += '/';
469  entryname += logname;
470  GenericAddress* pA =
471  new GenericAddress(t, CLID_NTupleFile, filename, entryname, 0, typ);
472  status = registerAddress(p, logname, pA);
473  if ( status.isSuccess() ) {
474  info() << "Added stream file:" << filename << " as " << logname << endmsg;
475  return status;
476  }
477  pA->release();
478  }
479  error() << "Cannot add file:" << filename << " as " << logname << endmsg;
480  return status;
481 }
482 
485  NTuple::Directory* p = nullptr;
486  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&p));
487  if ( !status.isSuccess() ) {
488  auto sep2 = fullPath.rfind(SEPARATOR);
489  if ( sep2 != std::string::npos ) {
490  std::string relPath = fullPath.substr(0, sep2);
491  p = createDirectory(relPath);
492  if ( p ) {
493  p = new NTuple::Directory();
494  // Finally register the created N tuple with the store
495  status = registerObject(fullPath, p);
496  if ( status.isSuccess() ) {
497  // ...starting from the file entries
499  if ( svc ) {
500  IOpaqueAddress* pAddr = nullptr;
501  status = svc->createRep (p, pAddr);
502  if ( status.isSuccess() ) {
503  p->registry()->setAddress(pAddr);
504  status = svc->fillRepRefs (pAddr, p);
505  if ( status.isSuccess() ) return p;
506  }
507  }
508  unregisterObject(p);
509  }
510  p->release();
511  p = nullptr;
512  }
513  }
514  }
515  return dynamic_cast<NTuple::Directory*>(p);
516 }
517 
520  return nullptr;
521 }
522 
525  NTuple::Tuple* pObj = nullptr;
526  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
527  return status.isSuccess() ? save ( pObj ) : INVALID_OBJ_PATH;
528 }
529 
532  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
533  if ( tuple ) {
534  try {
535  IConversionSvc* pSvc = tuple->conversionService();
536  IRegistry* pReg = tuple->registry();
537  if ( pSvc && pReg ) {
538  IOpaqueAddress* pAddr = pReg->address();
539  StatusCode status = pSvc->updateRep(pAddr, n_tuple);
540  if ( status.isSuccess() ) {
541  status = pSvc->updateRepRefs(pAddr, n_tuple);
542  }
543  return status;
544  }
546  }
547  catch(...) {
548  }
549  }
550  return INVALID_OBJECT;
551 }
552 
555  NTuple::Tuple* pObj = nullptr;
556  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
557  return status.isSuccess() ? save ( pObj ) : INVALID_OBJ_PATH;
558 }
559 
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  StatusCode status = pSvc->createRep(n_tuple, pAddr);
574  if ( status.isSuccess() ) {
575  pReg->setAddress(pAddr);
576  status = pSvc->fillRepRefs(pAddr, n_tuple);
577  }
578  return status;
579  }
581  }
582  catch(...) {
583  }
584  }
585  return INVALID_OBJECT;
586 }
587 
590  NTuple::Tuple* pObj = nullptr;
591  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
592  return status.isSuccess() ? writeRecord ( pObj ) : INVALID_OBJ_PATH;
593 }
594 
597  NTuple::Tuple* pObj = nullptr;
598  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
599  return status.isSuccess() ? writeRecord ( pObj ) : INVALID_OBJ_PATH;
600 }
601 
604  StatusCode status = INVALID_OBJECT;
605  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
606  if ( tuple ) {
607  try {
608  IConversionSvc* pSvc = tuple->conversionService();
609  if ( !pSvc ) {
610  pSvc = getDataLoader(n_tuple->registry());
611  tuple->setConversionService(pSvc);
612  }
613  if ( pSvc ) {
614  IRegistry* pReg = n_tuple->registry();
615  IOpaqueAddress* pAddr = pReg->address();
616  status = pSvc->updateObj(pAddr, n_tuple);
617  if ( status.isSuccess() ) {
618  status = pSvc->updateObjRefs(pAddr, n_tuple);
619  }
620  return status;
621  }
623  }
624  catch(...) {
625  status = INVALID_OBJECT;
626  }
627  }
628  return status;
629 }
630 
633  NTuple::Tuple* pObj = nullptr;
634  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
635  return status.isSuccess() ? readRecord ( pObj ) : INVALID_OBJ_PATH;
636 }
637 
640  NTuple::Tuple* pObj = nullptr;
641  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
642  return status.isSuccess() ? readRecord ( pObj ) : INVALID_OBJ_PATH;
643 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:471
Parse attribute strings allowing iteration over the various attributes.
void releaseConnection(Connection &c)
Finalize single service.
Definition: NTupleSvc.cpp:172
const long TEST_StorageType
Definition: ClassID.h:49
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
T empty(T...args)
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
DataSelectionAgent base in charge of collecting all the refereces to DataObjects in a transient store...
constexpr char SEPARATOR
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
virtual StatusCode finalize()
DataSvc overrides: stop the service.
Definition: NTupleSvc.cpp:198
virtual StatusCode save(const std::string &fullPath)
Save N tuple to disk. Must be called in order to close the ntuple file properly.
Definition: NTupleSvc.cpp:524
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
unsigned long release() override
release reference to object
No data loader available.
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:153
tuple c
Definition: gaudirun.py:391
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
T rfind(T...args)
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
T end(T...args)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
Generic Transient Address.
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:429
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:244
virtual StatusCode readRecord(NTuple::Tuple *tuple)
Read single record from N tuple.
Definition: NTupleSvc.cpp:603
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode updateDirectories()
Update directory data.
Definition: NTupleSvc.cpp:118
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
NTuple name space.
Definition: INTupleSvc.h:10
StatusCode createService(const std::string &nam, const std::string &typ, const std::vector< Prop > &props, IConversionSvc *&pSvc)
Create conversion service.
Definition: NTupleSvc.cpp:274
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
IDataSelector * selectedObjects()
Return the set of selected DataObjects.
STL class.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
string type
Definition: gaudirun.py:151
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
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:26
IConversionSvc * service
Definition: NTupleSvc.h:31
Definition of the basic interface.
Definition: IInterface.h:234
virtual StatusCode reinitialize()
DataSvc overrides: reinitialize service.
Definition: NTupleSvc.cpp:96
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
T erase(T...args)
NTupleSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition: NTupleSvc.cpp:60
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:225
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:1188
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
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
virtual StatusCode connect(const std::string &ident)
Add file to list I/O list.
Definition: NTupleSvc.cpp:206
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
T move(T...args)
virtual NTuple::Tuple * book(const std::string &fullPath, const CLID &type, const std::string &title)
Book Ntuple and register it with the data store.
Definition: NTupleSvc.cpp:355
const TYPE & value() const
explicit conversion
Definition: Property.h:341
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
Definition: Service.cpp:363
DBaseEntries m_input
Input streams.
Definition: NTupleSvc.h:126
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
virtual StatusCode writeRecord(NTuple::Tuple *tuple)
Write single record to N tuple.
Definition: NTupleSvc.cpp:561
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:107
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
T insert(T...args)
T find(T...args)
T length(T...args)
virtual unsigned long release()=0
Release Interface instance.
#define DECLARE_NAMESPACE_OBJECT_FACTORY(n, x)
Definition: ObjectFactory.h:18
NTuple service.
Definition: NTupleSvc.h:24
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:1153
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
void setTupleService(INTupleSvc *svc)
Access conversion service.
DBaseEntries m_output
Output streams.
Definition: NTupleSvc.h:124
string s
Definition: gaudirun.py:245
tuple root
Definition: IOTest.py:42
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
virtual NTuple::Tuple * access(const std::string &fullPath, const std::string &filename)
Access N tuple on disk.
Definition: NTupleSvc.cpp:519
T substr(T...args)
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:53
virtual StatusCode create(const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple)
Create requested N tuple (Hide constructor)
Definition: NTupleSvc.cpp:334
virtual StatusCode initialize()
DataSvc overrides: Initialize the service.
Definition: NTupleSvc.cpp:74
virtual const id_type & identifier() const =0
Full identifier (or key)
void setConversionService(IConversionSvc *svc)
Access conversion service.
Opaque address interface definition.
Base class for all conversion services.
Definition: ConversionSvc.h:46
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
StatusCode attachTuple(const std::string &filename, const std::string &logname, const char typ, const long t)
Attach output/input file.
Definition: NTupleSvc.cpp:461
virtual StatusCode disconnect(const std::string &nam)
Close open connection.
Definition: NTupleSvc.cpp:180
StatusCode traverseSubTree(const std::string &sub_tree_path, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full pat...
Definition: DataSvc.cpp:126
virtual StatusCode disconnectAll()
Close all open connections.
Definition: NTupleSvc.cpp:191
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:1068
list i
Definition: ana.py:128
virtual bool isConnected(const std::string &identifier) const
Check if a datasource is connected.
Definition: NTupleSvc.cpp:101
virtual ~NTupleSvc()
Standard Destructor.
Definition: NTupleSvc.cpp:70
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:244
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114
IConversionSvc * conversionService() const
Access conversion service.
T emplace_back(T...args)
Connections m_connections
Container of connection points.
Definition: NTupleSvc.h:128