The Gaudi Framework
v26r1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
Class_dict.cpp
Go to the documentation of this file.
1
// $Id: Class_dict.cpp,v 1.8 2006/02/06 13:15:15 hmd Exp $
2
#include <iostream>
3
#include <string>
4
5
#define private public
6
#include "../Event.h"
7
#include "../MyTrack.h"
8
#include "../MyVertex.h"
9
#undef private
10
11
#include "GaudiKernel/DataObject.h"
12
13
class
C_dict
{
14
public
:
C_dict
();
15
};
16
17
void
*
Event_run
(
void
* o ) {
18
static
long
r;
19
r = ((
Event
*)o)->run();
20
return
&r;
21
}
22
void
Event_setRun
(
void
* o, std::vector<void*>
argv
) {
23
((
Event
*)o)->setRun( *(
long
*)(argv[0]) );
24
return
;
25
}
26
27
void
*
MyTrack_event
(
void
* o ) {
28
return
const_cast<
Event
*
>
(((
MyTrack
*)o)->event());
29
}
30
void
MyTrack_setEvent
(
void
* o, std::vector<void*>
argv
) {
31
((
MyTrack
*)o)->setEvent( (
Event
*)(argv[0]) );
32
return
;
33
}
34
35
static
C_dict
instance;
36
37
C_dict::C_dict
()
38
{
39
MetaClass* meta1 =
new
MetaClass(
"Event"
,
"Event header"
);
40
meta1->addField(
"event"
,
"long"
,
"Event Number"
, OffsetOf(
Event
,m_event));
41
meta1->addField(
"run"
,
"long"
,
"Run Number"
, OffsetOf(
Event
,m_run));
42
meta1->addField(
"time"
,
"Time"
,
"Event creation Time"
, OffsetOf(
Event
,m_time));
43
meta1->addMethod(
"getRun"
,
"Get run number"
,
"long"
,
Event_run
);
44
std::vector<std::string> argnames1;
45
argnames1.push_back(
"long"
);
46
meta1->addMethod(
"setRun"
,
"Set run number"
, argnames1,
Event_setRun
);
47
48
MetaClass* meta2 =
new
MetaClass(
"Time"
,
"Absolute time (64-bit) in ns"
);
49
meta2->addField(
"time"
,
"longlong"
,
"Time"
,OffsetOf(Gaudi::Time,m_time));
50
51
MetaClass* meta3 =
new
MetaClass(
"MyTrack"
,
"Track test object"
);
52
meta3->addField(
"px"
,
"float"
,
"Momentum in x direction"
, OffsetOf(
MyTrack
,m_px));
53
meta3->addField(
"py"
,
"float"
,
"Momentum in y direction"
, OffsetOf(
MyTrack
,m_py));
54
meta3->addField(
"pz"
,
"float"
,
"Momentum in z direction"
, OffsetOf(
MyTrack
,m_pz));
55
meta3->addField(
"event"
,
"SmartRef<Event>"
,
"Link to event root"
,OffsetOf(
MyTrack
,m_event));
56
meta3->addField(
"decay"
,
"SmartRef<MyVertex>"
,
"Link to decay Vertex"
, OffsetOf(
MyTrack
,m_decay));
57
meta3->addMethod(
"getEvent"
,
"Get Event pointer"
,
"Event*"
,
MyTrack_event
);
58
std::vector<std::string> argnames3;
59
argnames3.push_back(
"Event*"
);
60
meta3->addMethod(
"setEvent"
,
"Set Event"
, argnames3,
MyTrack_setEvent
);
61
62
MetaClass* meta4 =
new
MetaClass(
"MyVertex"
,
"Vertex test object"
);
63
meta4->addField(
"x"
,
"double"
,
"Position in x"
, OffsetOf(
MyVertex
,m_x));
64
meta4->addField(
"y"
,
"double"
,
"Position in y"
, OffsetOf(
MyVertex
,m_y));
65
meta4->addField(
"z"
,
"double"
,
"Position in z"
, OffsetOf(
MyVertex
,m_z));
66
meta4->addField(
"mother"
,
"SmartRef<MyTrack>"
,
"Link to mother Track"
, OffsetOf(
MyVertex
,m_mother));
67
meta4->addField(
"daughters"
,
"SmartRefVector<MyTrack>"
,
"Link to daughter Tracks"
, OffsetOf(
MyVertex
,m_daughters));
68
}
69
GaudiPython
src
Test
Dictionary
Class_dict.cpp
Generated on Mon Feb 16 2015 11:56:57 for The Gaudi Framework by
1.8.2