| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

NTupleSvc.h
Go to the documentation of this file.
1 #ifndef GAUDI_NTUPLESVC_H
2 #define GAUDI_NTUPLESVC_H 1
3
4 // Framework include files
5 #include "GaudiKernel/INTupleSvc.h"
6 #include "GaudiKernel/IDataSourceMgr.h"
7 #include "GaudiKernel/DataSvc.h"
8
9 // STL include files
10 #include <map>
11
12
24 class NTupleSvc : public extends<DataSvc,
25 INTupleSvc,
26 IDataSourceMgr>
27 {
28 private:
29 protected:
30 struct Connection final {
31 IConversionSvc* service;
32 Connection(IConversionSvc* s) : service(s) {}
33 Connection(const Connection& c) : service(c.service) {}
34 };
35 typedef std::vector< std::string > DBaseEntries;
36 typedef std::map<std::string, Connection> Connections;
37 typedef std::pair<std::string,std::string> Prop;
38
39 private:
40 public:
42 virtual StatusCode initialize();
44 virtual StatusCode reinitialize();
46 virtual StatusCode finalize();
48 virtual IConversionSvc* getDataLoader(IRegistry* pReg);
49
51 virtual NTuple::Directory* createDirectory (DataObject* pParent, const std::string& title);
53 virtual NTuple::Directory* createDirectory (DataObject* pParent, long id);
55 virtual NTuple::Directory* createDirectory (const std::string& dirPath, long id);
57 virtual NTuple::Directory* createDirectory (const std::string& dirPath, const std::string& title);
59 virtual NTuple::Directory* createDirectory (const std::string& fullPath);
60
62 virtual StatusCode create(const CLID& typ, const std::string& title, NTuple::Tuple*& refpTuple);
64 virtual NTuple::Tuple* book (const std::string& fullPath, const CLID& type, const std::string& title);
66 virtual NTuple::Tuple* book (const std::string& dirPath, const std::string& relPath, const CLID& type, const std::string& title);
68 virtual NTuple::Tuple* book (const std::string& dirPath, long id, const CLID& type, const std::string& title);
70 virtual NTuple::Tuple* book (DataObject* pParent, const std::string& relPath, const CLID& type, const std::string& title);
72 virtual NTuple::Tuple* book (DataObject* pParent, long id, const CLID& type, const std::string& title);
74 virtual NTuple::Tuple* access(const std::string& fullPath, const std::string& filename);
76 virtual StatusCode save(const std::string& fullPath);
78 virtual StatusCode save(NTuple::Tuple* tuple);
80 virtual StatusCode save(DataObject* pParent, const std::string& relPath);
82 virtual StatusCode writeRecord( NTuple::Tuple* tuple );
84 virtual StatusCode writeRecord( const std::string& fullPath );
86 virtual StatusCode writeRecord( DataObject* pParent, const std::string& relPath );
88 virtual StatusCode readRecord( NTuple::Tuple* tuple );
90 virtual StatusCode readRecord( const std::string& fullPath );
92 virtual StatusCode readRecord( DataObject* pParent, const std::string& relPath);
93
95 virtual bool isConnected(const std::string& identifier) const;
97 virtual StatusCode connect(const std::string& ident);
99 virtual StatusCode connect(const std::string& ident, std::string& logname);
101 virtual StatusCode disconnect(const std::string& nam);
103 virtual StatusCode disconnectAll();
104
106 NTupleSvc(const std::string& name, ISvcLocator* svc);
108 virtual ~NTupleSvc();
109 protected:
110
112 StatusCode createService( const std::string& nam,
113 const std::string& typ,
114 const std::vector<Prop>& props,
115 IConversionSvc*& pSvc);
117 void releaseConnection(Connection& c);
119 StatusCode attachTuple(const std::string& filename, const std::string& logname, const char typ, const long t);
121 StatusCode updateDirectories();
122
124 DBaseEntries m_output;
126 DBaseEntries m_input;
128 Connections m_connections;
129 };
130
131 #endif // GAUDI_NTUPLESVC_H
NTupleSvc::Connections
std::map< std::string, Connection > Connections
Definition: NTupleSvc.h:36
NTupleSvc::releaseConnection
void releaseConnection(Connection &c)
Finalize single service.
Definition: NTupleSvc.cpp:172
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
IConversionSvc
Definition: IConversionSvc.h:37
NTupleSvc::finalize
virtual StatusCode finalize()
DataSvc overrides: stop the service.
Definition: NTupleSvc.cpp:198
NTupleSvc::save
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
gaudirun.c
tuple c
Definition: gaudirun.py:391
NTupleSvc::Connection::Connection
Connection(IConversionSvc *s)
Definition: NTupleSvc.h:32
graphanalysis.filename
string filename
Definition: graphanalysis.py:109
NTupleSvc::createDirectory
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:429
NTupleSvc::readRecord
virtual StatusCode readRecord(NTuple::Tuple *tuple)
Read single record from N tuple.
Definition: NTupleSvc.cpp:603
std::map< std::string, Connection >
IDataSourceMgr.h
NTupleSvc::DBaseEntries
std::vector< std::string > DBaseEntries
Definition: NTupleSvc.h:35
NTupleSvc::updateDirectories
StatusCode updateDirectories()
Update directory data.
Definition: NTupleSvc.cpp:118
NTupleSvc::createService
StatusCode createService(const std::string &nam, const std::string &typ, const std::vector< Prop > &props, IConversionSvc *&pSvc)
Create conversion service.
Definition: NTupleSvc.cpp:274
std::string
STL class.
DataSvc.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
gaudirun.type
string type
Definition: gaudirun.py:151
NTupleSvc::Prop
std::pair< std::string, std::string > Prop
Definition: NTupleSvc.h:37
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
NTupleSvc::Connection::service
IConversionSvc * service
Definition: NTupleSvc.h:31
NTupleSvc::reinitialize
virtual StatusCode reinitialize()
DataSvc overrides: reinitialize service.
Definition: NTupleSvc.cpp:96
NTupleSvc::NTupleSvc
NTupleSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition: NTupleSvc.cpp:60
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
NTupleSvc::connect
virtual StatusCode connect(const std::string &ident)
Add file to list I/O list.
Definition: NTupleSvc.cpp:206
NTupleSvc::book
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
NTupleSvc::m_input
DBaseEntries m_input
Input streams.
Definition: NTupleSvc.h:126
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
std::pair< std::string, std::string >
NTupleSvc::writeRecord
virtual StatusCode writeRecord(NTuple::Tuple *tuple)
Write single record to N tuple.
Definition: NTupleSvc.cpp:561
NTupleSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:107
std::vector< std::string >
NTupleSvc
NTuple service.
Definition: NTupleSvc.h:24
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
NTupleSvc::Connection
Definition: NTupleSvc.h:30
NTupleSvc::m_output
DBaseEntries m_output
Output streams.
Definition: NTupleSvc.h:124
gaudirun.s
string s
Definition: gaudirun.py:245
NTupleSvc::access
virtual NTuple::Tuple * access(const std::string &fullPath, const std::string &filename)
Access N tuple on disk.
Definition: NTupleSvc.cpp:519
NTupleSvc::create
virtual StatusCode create(const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple)
Create requested N tuple (Hide constructor)
Definition: NTupleSvc.cpp:334
NTupleSvc::initialize
virtual StatusCode initialize()
DataSvc overrides: Initialize the service.
Definition: NTupleSvc.cpp:74
NTupleSvc::attachTuple
StatusCode attachTuple(const std::string &filename, const std::string &logname, const char typ, const long t)
Attach output/input file.
Definition: NTupleSvc.cpp:461
NTupleSvc::disconnect
virtual StatusCode disconnect(const std::string &nam)
Close open connection.
Definition: NTupleSvc.cpp:180
NTupleSvc::disconnectAll
virtual StatusCode disconnectAll()
Close all open connections.
Definition: NTupleSvc.cpp:191
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
NTuple::Directory
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:1068
NTupleSvc::isConnected
virtual bool isConnected(const std::string &identifier) const
Check if a datasource is connected.
Definition: NTupleSvc.cpp:101
NTupleSvc::~NTupleSvc
virtual ~NTupleSvc()
Standard Destructor.
Definition: NTupleSvc.cpp:70
NTupleSvc::Connection::Connection
Connection(const Connection &c)
Definition: NTupleSvc.h:33
INTupleSvc.h
NTupleSvc::m_connections
Connections m_connections
Container of connection points.
Definition: NTupleSvc.h:128