| The Gaudi Framework v27r1

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

- File List
- File Members

NTupleImplementation.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_NTUPLEIMP_H
2 #define GAUDIKERNEL_NTUPLEIMP_H
3
4
5 #include <memory>
6 // Framework include files
7 #include "GaudiKernel/NTuple.h"
8 #include "GaudiKernel/Kernel.h"
9 #include "GaudiKernel/SmartIF.h"
10
11 // Forward declarations
12 class INTupleSvc;
13 class IConversionSvc;
14
15
16 namespace NTuple {
17 // Concrete N tuple class definition
18 class GAUDI_API TupleImp : public Tuple {
19 protected:
21 ItemContainer m_items;
23 bool m_isBooked = false;
25 std::string m_title;
27 SmartIF<ISelectStatement> m_pSelector;
29 std::unique_ptr<char[]> m_buffer;
31 INTupleSvc* m_ntupleSvc = nullptr;
33 IConversionSvc* m_cnvSvc = nullptr;
34 private:
36 TupleImp(const TupleImp&) = delete;
37
38 public:
40 INTupleItem* i_find(const std::string& name) const override;
41 public:
43 TupleImp( std::string title);
45 ~TupleImp() override;
47 ItemContainer& items() override {
48 return m_items;
49 }
51 const ItemContainer& items() const override {
52 return m_items;
53 }
55 const std::string& title() const override {
56 return m_title;
57 }
59 const INTupleItem* find(const std::string& name) const override {
60 return i_find(name);
61 }
63 INTupleItem* find(const std::string& name) override {
64 return i_find(name);
65 }
67 char* buffer() override {
68 return m_buffer.get();
69 }
71 const char* buffer() const override {
72 return m_buffer.get();
73 }
75 IConversionSvc* conversionService() const {
76 return m_cnvSvc;
77 }
79 void setConversionService( IConversionSvc* svc ) {
80 m_cnvSvc = svc;
81 }
83 INTupleSvc* tupleService() const {
84 return m_ntupleSvc;
85 }
87 void setTupleService( INTupleSvc* svc ) {
88 m_ntupleSvc = svc;
89 }
91 StatusCode attachSelector(ISelectStatement* sel) override;
93 ISelectStatement* selector() override;
95 virtual char* setBuffer(std::unique_ptr<char[]>&& buff);
96 char* setBuffer(char* buff) override;
98 void reset() override;
100 StatusCode add(INTupleItem* item) override;
102 StatusCode remove(INTupleItem* item) override;
104 StatusCode remove(const std::string& name) override;
106 StatusCode write() override;
108 StatusCode writeRecord() override;
110 StatusCode read() override;
112 StatusCode readRecord() override;
114 StatusCode save() override;
115
116 }; // end class definition: Tuple
117
118
119 // Concrete column wise N tuple class definition
120 class ColumnWiseTuple : public TupleImp {
121 public:
123 ColumnWiseTuple(std::string title ) : TupleImp(std::move(title)) {
124 }
126 ~ColumnWiseTuple() override = default;
128 const CLID& clID() const override {
129 return classID();
130 }
132 static const CLID& classID() {
133 return CLID_ColumnWiseTuple;
134 }
135 }; // end class definition: ColumnWiseTuple
136
137 // Concrete column wise N tuple class definition
138 class RowWiseTuple : public TupleImp {
139 public:
141 RowWiseTuple( std::string title ) : TupleImp(std::move(title)) {
142 }
144 ~RowWiseTuple() override = default;
146 const CLID& clID() const override {
147 return classID();
148 }
150 static const CLID& classID() {
151 return CLID_RowWiseTuple;
152 }
153 }; // end class definition: RowWiseTuple
154 } // end name space NTuple
155
156 #endif // GAUDIKERNEL_NTUPLEIMP_H
SmartIF< ISelectStatement >
Kernel.h
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
IConversionSvc
Definition: IConversionSvc.h:37
ISelectStatement
A select statement can either contain.
Definition: ISelectStatement.h:32
NTuple::TupleImp::m_buffer
std::unique_ptr< char[]> m_buffer
Buffer.
Definition: NTupleImplementation.h:29
NTuple.h
std
STL namespace.
NTuple::TupleImp::find
INTupleItem * find(const std::string &name) override
Find an item row of the Ntuple.
Definition: NTupleImplementation.h:63
NTuple::RowWiseTuple::RowWiseTuple
RowWiseTuple(std::string title)
Standard Constructor.
Definition: NTupleImplementation.h:141
NTuple::ColumnWiseTuple
Definition: NTupleImplementation.h:120
NTuple::RowWiseTuple::clID
const CLID & clID() const override
Retrieve Reference to class defininition structure.
Definition: NTupleImplementation.h:146
NTuple
NTuple name space.
Definition: INTupleSvc.h:10
NTuple::RowWiseTuple::classID
static const CLID & classID()
Static access to class defininition structure.
Definition: NTupleImplementation.h:150
NTuple::ColumnWiseTuple::ColumnWiseTuple
ColumnWiseTuple(std::string title)
Standard Constructor.
Definition: NTupleImplementation.h:123
std::string
STL class.
NTuple::TupleImp::find
const INTupleItem * find(const std::string &name) const override
Find an item row of the Ntuple (CONST)
Definition: NTupleImplementation.h:59
INTupleSvc
Definition: INTupleSvc.h:37
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:32
INTupleItem
NTuple interface class definition.
Definition: INTuple.h:26
read_lhcb_event_file.sel
tuple sel
Definition: read_lhcb_event_file.py:10
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
NTuple::TupleImp
Definition: NTupleImplementation.h:18
SmartIF.h
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
NTuple::TupleImp::items
ItemContainer & items() override
Access item container.
Definition: NTupleImplementation.h:47
NTuple::TupleImp::m_title
std::string m_title
N tuple title.
Definition: NTupleImplementation.h:25
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
std::unique_ptr::get
T get(T...args)
std::vector
STL class.
NTuple::ColumnWiseTuple::clID
const CLID & clID() const override
Retrieve Reference to class defininition structure.
Definition: NTupleImplementation.h:128
std::unique_ptr< char[]>
NTuple::TupleImp::m_pSelector
SmartIF< ISelectStatement > m_pSelector
Possibly hanging selector.
Definition: NTupleImplementation.h:27
NTuple::TupleImp::buffer
const char * buffer() const override
Access N tuple data buffer (CONST)
Definition: NTupleImplementation.h:71
NTuple::RowWiseTuple
Definition: NTupleImplementation.h:138
NTuple::TupleImp::m_items
ItemContainer m_items
Container with N tuple _Columns.
Definition: NTupleImplementation.h:21
NTuple::TupleImp::setTupleService
void setTupleService(INTupleSvc *svc)
Access conversion service.
Definition: NTupleImplementation.h:87
ana.item
tuple item
print s1,s2
Definition: ana.py:146
NTuple::TupleImp::setConversionService
void setConversionService(IConversionSvc *svc)
Access conversion service.
Definition: NTupleImplementation.h:79
NTuple::TupleImp::title
const std::string & title() const override
Object title.
Definition: NTupleImplementation.h:55
NTuple::TupleImp::items
const ItemContainer & items() const override
Access item container (CONST)
Definition: NTupleImplementation.h:51
NTuple::RowWiseTuple::~RowWiseTuple
~RowWiseTuple() override=default
Standard Destructor.
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
NTuple::ColumnWiseTuple::classID
static const CLID & classID()
Static access to class defininition structure.
Definition: NTupleImplementation.h:132
NTuple::TupleImp::tupleService
INTupleSvc * tupleService() const
Access conversion service.
Definition: NTupleImplementation.h:83
NTuple::TupleImp::buffer
char * buffer() override
Access N tuple data buffer.
Definition: NTupleImplementation.h:67
NTuple::ColumnWiseTuple::~ColumnWiseTuple
~ColumnWiseTuple() override=default
Standard Destructor.
NTuple::TupleImp::conversionService
IConversionSvc * conversionService() const
Access conversion service.
Definition: NTupleImplementation.h:75