LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lctrh.cc
Go to the documentation of this file.
1 #include "CPPFORT/lctrh.h"
2 
3 #include "lcio.h"
4 #include "IMPL/TrackerHitImpl.h"
5 
6 using namespace lcio ;
7 
8 #include <iostream>
9 
10 // create delete TrackerHit
11 
13  TrackerHitImpl* trh = new TrackerHitImpl ;
14  return C2F_POINTER( LCObject*, trh ) ;
15 }
16 int lctrhdelete( PTRTYPE trhit ){
17  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
18  delete trh ;
19  return LCIO::SUCCESS ;
20 }
21 
22 
23 // get Methods
24 
25 int lctrhid( PTRTYPE trhit ) {
26  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
27  return trh->id() ;
28 }
29 
30 int lctrhgetposition( PTRTYPE trhit, double dpos[3] ) {
31  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
32  for( int i=0 ; i<3 ; i++ ) dpos[i] = trh->getPosition()[i] ;
33  return LCIO::SUCCESS ;
34 }
35 
36 int lctrhgetcovmatrix( PTRTYPE trhit, float cvmtx[TRKHITNCOVMATRIX] ) {
37  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
38  for( int i=0 ; i<TRKHITNCOVMATRIX ; i++ ) cvmtx[i] = trh->getCovMatrix()[i] ;
39  return LCIO::SUCCESS ;
40 }
41 
42 // DEPRECATED. use lctrhgetedep()
43 float lctrhgetdedx( PTRTYPE trhit ) {
44  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
45  return trh->getEDep() ;
46 }
47 
48 float lctrhgetedep( PTRTYPE trhit ) {
49  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
50  return trh->getEDep() ;
51 }
52 
53 float lctrhgetedeperr( PTRTYPE trhit ) {
54  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
55  return trh->getEDepError() ;
56 }
57 
58 float lctrhgettime( PTRTYPE trhit ) {
59  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
60  return trh->getTime() ;
61 }
62 
63 // char* lctrhgettype( PTRTYPE trhit ) {
64 // TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
65 // return const_cast<char*>( trh->getType().c_str() ) ;
66 // }
67 
68 int lctrhgettype( PTRTYPE trhit ) {
69  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
70  return trh->getType() ;
71 }
72 
73 int lctrhgetquality( PTRTYPE trhit ) {
74  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
75  return trh->getQuality() ;
76 }
77 
78 int lctrhgetcellid0( PTRTYPE trhit ) {
79  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
80  return trh->getCellID0() ;
81 }
82 int lctrhgetcellid1( PTRTYPE trhit ) {
83  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
84  return trh->getCellID1() ;
85 }
86 
87 
89  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
90 // const TPCHit& hit = trh->getRawHits();
91 // return reinterpret_cast<PTRTYPE>( &hit );
92  return reinterpret_cast<PTRTYPE>( &trh->getRawHits() );
93 }
94 
95 
96 // set,add Methods
97 
98 int lctrhsetposition( PTRTYPE trhit, double dpos[3] ) {
99  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
100  trh->setPosition( dpos ) ;
101  return LCIO::SUCCESS ;
102 }
103 
104 int lctrhsetcovmatrix( PTRTYPE trhit, float cvmtx[TRKHITNCOVMATRIX] ) {
105  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
106  trh->setCovMatrix( cvmtx ) ;
107  return LCIO::SUCCESS ;
108 }
109 
110 // DEPRECATED. use lctrhsetedep()
111 int lctrhsetdedx( PTRTYPE trhit, float dedx) {
112  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
113  trh->setEDep( dedx ) ;
114  return LCIO::SUCCESS ;
115 }
116 
117 int lctrhsetedep( PTRTYPE trhit, float e ) {
118  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
119  trh->setEDep( e ) ;
120  return LCIO::SUCCESS ;
121 }
122 
123 int lctrhsetedeperr( PTRTYPE trhit, float e ) {
124  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
125  trh->setEDepError( e ) ;
126  return LCIO::SUCCESS ;
127 }
128 
129 int lctrhsettime( PTRTYPE trhit, float time) {
130  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
131  trh->setTime( time ) ;
132  return LCIO::SUCCESS ;
133 }
134 
135 int lctrhsettype( PTRTYPE trhit, int type) {
136  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
137  trh->setType( type ) ;
138  return LCIO::SUCCESS ;
139 }
140 
141 int lctrhsetquality( PTRTYPE trhit, int q) {
142  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
143  trh->setQuality( q ) ;
144  return LCIO::SUCCESS ;
145 }
146 
147 int lctrhsetcellid0( PTRTYPE trhit, int id0) {
148  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
149  trh->setCellID0( id0 ) ;
150  return LCIO::SUCCESS ;
151 }
152 int lctrhsetcellid1( PTRTYPE trhit, int id1) {
153  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
154  trh->setCellID1( id1 ) ;
155  return LCIO::SUCCESS ;
156 }
157 
158 int lctrhaddrawhit( PTRTYPE trhit, PTRTYPE rawhit ) {
159  TrackerHitImpl* trh = f2c_pointer<TrackerHitImpl,LCObject>( trhit ) ;
160  LCObject* hit = f2c_pointer<LCObject,LCObject>( rawhit ) ;
161  trh->rawHits().push_back( hit ) ;
162  return LCIO::SUCCESS ;
163 }
164 
165 
LCIO_DEPRECATED_CAPI PTRTYPE lctrhgetrawhits(PTRTYPE trh)
Definition: lctrh.cc:88
LCIO_DEPRECATED_CAPI int lctrhaddrawhit(PTRTYPE trh, PTRTYPE rawhit)
Definition: lctrh.cc:158
LCIO_DEPRECATED_CAPI int lctrhgetquality(PTRTYPE trh)
Definition: lctrh.cc:73
LCIO_DEPRECATED_CAPI float lctrhgettime(PTRTYPE trh)
Definition: lctrh.cc:58
#define TRKHITNCOVMATRIX
LCIO_DEPRECATED_CAPI float lctrhgetdedx(PTRTYPE trh)
Definition: lctrh.cc:43
LCIO_DEPRECATED_CAPI int lctrhsetcellid1(PTRTYPE trh, int id1)
Definition: lctrh.cc:152
LCIO_DEPRECATED_CAPI int lctrhid(PTRTYPE trh)
Definition: lctrh.cc:25
LCIO_DEPRECATED_CAPI int lctrhsetedep(PTRTYPE trh, float e)
Definition: lctrh.cc:117
LCIO_DEPRECATED_CAPI int lctrhgetposition(PTRTYPE trh, double *pos)
LCIO_DEPRECATED_CAPI int lctrhgettype(PTRTYPE trh)
Definition: lctrh.cc:68
LCIO_DEPRECATED_CAPI float lctrhgetedeperr(PTRTYPE trh)
Definition: lctrh.cc:53
LCIO_DEPRECATED_CAPI int lctrhgetcovmatrix(PTRTYPE trh, float *cvmtx)
LCIO_DEPRECATED_CAPI int lctrhsettype(PTRTYPE trh, int type)
Definition: lctrh.cc:135
LCIO_DEPRECATED_CAPI int lctrhsetedeperr(PTRTYPE trh, float e)
Definition: lctrh.cc:123
LCIO_DEPRECATED_CAPI int lctrhsettime(PTRTYPE trh, float time)
Definition: lctrh.cc:129
LCIO_DEPRECATED_CAPI float lctrhgetedep(PTRTYPE trh)
Definition: lctrh.cc:48
long PTRTYPE
Fortran interface - define the length of pointers this has to made machine independent ...
Definition: cpointer.h:12
LCIO_DEPRECATED_CAPI int lctrhgetcellid1(PTRTYPE trh)
Definition: lctrh.cc:82
LCIO_DEPRECATED_CAPI int lctrhsetdedx(PTRTYPE trh, float dedx)
Definition: lctrh.cc:111
LCIO_DEPRECATED_CAPI int lctrhsetcovmatrix(PTRTYPE trh, float *cvmtx)
LCIO_DEPRECATED_CAPI int lctrhsetposition(PTRTYPE trh, double *pos)
LCIO_DEPRECATED_CAPI int lctrhgetcellid0(PTRTYPE trh)
Definition: lctrh.cc:78
LCIO_DEPRECATED_CAPI int lctrhdelete(PTRTYPE trh)
Definition: lctrh.cc:16
LCIO_DEPRECATED_CAPI int lctrhsetquality(PTRTYPE trh, int q)
Definition: lctrh.cc:141
LCIO_DEPRECATED_CAPI PTRTYPE lctrhcreate()
Header file for the f77-wrapper functions of the Track Class.
Definition: lctrh.cc:12
LCIO_DEPRECATED_CAPI int lctrhsetcellid0(PTRTYPE trh, int id0)
Definition: lctrh.cc:147
#define C2F_POINTER(T, ptr)
Definition: cpointer.h:33