00001 #include "CPPFORT/lcrcp.h"
00002
00003 #include "lcio.h"
00004 #include "IMPL/ReconstructedParticleImpl.h"
00005 #include "IMPL/VertexImpl.h"
00006
00007 using namespace lcio ;
00008
00009 #include <iostream>
00010
00011
00012
00013 PTRTYPE lcrcpcreate(){
00014 ReconstructedParticleImpl* rcp = new ReconstructedParticleImpl ;
00015 return C2F_POINTER( LCObject*, rcp ) ;
00016 }
00017 int lcrcpdelete( PTRTYPE recopart ){
00018 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00019 delete rcp ;
00020 return LCIO::SUCCESS ;
00021 }
00022
00023
00024
00025
00026 int lcrcpid( PTRTYPE recopart ) {
00027 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00028 return rcp->id() ;
00029 }
00030
00031 int lcrcpgettype( PTRTYPE recopart ) {
00032 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00033 return rcp->getType() ;
00034 }
00035
00036 bool lcrcpiscompound ( PTRTYPE recopart ) {
00037 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00038 return rcp->isCompound() ;
00039 }
00040
00041 int lcrcpgetmomentum( PTRTYPE recopart, float* p ) {
00042 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00043 for( int i=0 ; i<3 ; *p++ = rcp->getMomentum()[i++] ) ;
00044 return LCIO::SUCCESS ;
00045 }
00046
00047 float lcrcpgetenergy( PTRTYPE recopart ) {
00048 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00049 return rcp->getEnergy() ;
00050 }
00051
00052 int lcrcpgetcovmatrix( PTRTYPE recopart, float cvmtx[NCOVARIANCE] ) {
00053 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00054 for( int i=0 ; i<NCOVARIANCE ; cvmtx[i] = rcp->getCovMatrix()[i++] ) ;
00055 return LCIO::SUCCESS ;
00056 }
00057
00058 float lcrcpgetmass( PTRTYPE recopart ) {
00059 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00060 return rcp->getMass() ;
00061 }
00062
00063 float lcrcpgetcharge( PTRTYPE recopart ) {
00064 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00065 return rcp->getCharge() ;
00066 }
00067
00068 int lcrcpgetreferencepoint( PTRTYPE recopart, float refpoint[3] ) {
00069 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00070 for( int i=0 ; i<3 ; *refpoint++ = rcp->getReferencePoint()[i++] ) ;
00071 return LCIO::SUCCESS ;
00072 }
00073
00074 PTRTYPE lcrcpgetparticleids( PTRTYPE recopart ) {
00075 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00076 const ParticleIDVec& idvect = rcp->getParticleIDs();
00077 return reinterpret_cast<PTRTYPE>( &idvect );
00078 }
00079
00080 float lcrcpgetgoodnessofpid( PTRTYPE recopart ) {
00081 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>(recopart ) ;
00082 return rcp->getGoodnessOfPID() ;
00083 }
00084
00085 PTRTYPE lcrcpgetparticles( PTRTYPE recopart ) {
00086 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00087 const ReconstructedParticleVec& idvect = rcp->getParticles();
00088 return reinterpret_cast<PTRTYPE>( &idvect );
00089 }
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 PTRTYPE lcrcpgetclusters( PTRTYPE recopart ) {
00108 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00109 const ClusterVec& idvect = rcp->getClusters();
00110 return reinterpret_cast<PTRTYPE>( &idvect );
00111 }
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 PTRTYPE lcrcpgettracks( PTRTYPE recopart ) {
00130 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00131 const TrackVec& idvect = rcp->getTracks();
00132 return reinterpret_cast<PTRTYPE>( &idvect );
00133 }
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 PTRTYPE lcrcpgetstartvertex( PTRTYPE recopart ) {
00171 ReconstructedParticle* rcp = f2c_pointer<ReconstructedParticle,LCObject>( recopart ) ;
00172 Vertex* vtx = rcp->getStartVertex();
00173 return reinterpret_cast<PTRTYPE>( vtx );
00174 }
00175
00176 PTRTYPE lcrcpgetendvertex( PTRTYPE recopart ) {
00177 ReconstructedParticle* rcp = f2c_pointer<ReconstructedParticle,LCObject>( recopart ) ;
00178 Vertex* vtx = rcp->getEndVertex();
00179 return reinterpret_cast<PTRTYPE>( vtx );
00180 }
00181
00182
00183
00184
00185 int lcrcpsettype( PTRTYPE recopart, int type ) {
00186 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00187 rcp->setType( type ) ;
00188 return LCIO::SUCCESS ;
00189 }
00190
00191
00192
00193
00194
00195
00196
00197 int lcrcpsetmomentum( PTRTYPE recopart, float p[3] ) {
00198 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00199 rcp->setMomentum( p ) ;
00200 return LCIO::SUCCESS ;
00201 }
00202
00203 int lcrcpsetenergy( PTRTYPE recopart, float energy ) {
00204 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00205 rcp->setEnergy( energy ) ;
00206 return LCIO::SUCCESS ;
00207 }
00208
00209 int lcrcpsetcovmatrix( PTRTYPE recopart, float cvmtx[NCOVARIANCE] ) {
00210 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00211 rcp->setCovMatrix( cvmtx ) ;
00212 return LCIO::SUCCESS ;
00213 }
00214
00215 int lcrcpsetmass( PTRTYPE recopart, float xmass) {
00216 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00217 rcp->setMass( xmass ) ;
00218 return LCIO::SUCCESS ;
00219 }
00220
00221 int lcrcpsetcharge( PTRTYPE recopart, float charge ) {
00222 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00223 rcp->setCharge( charge ) ;
00224 return LCIO::SUCCESS ;
00225 }
00226
00227 int lcrcpsetreferencepoint( PTRTYPE recopart, float refpoint[3] ) {
00228 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00229 rcp->setReferencePoint( refpoint ) ;
00230 return LCIO::SUCCESS ;
00231 }
00232
00233 int lcrcpaddparticleid( PTRTYPE recopart, PTRTYPE pid ) {
00234 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00235 ParticleID* ppid = f2c_pointer<ParticleID,LCObject>( pid ) ;
00236 rcp->addParticleID( ppid ) ;
00237 return LCIO::SUCCESS ;
00238 }
00239
00240 int lcrcpsetgoodnessofpid( PTRTYPE recopart, float good) {
00241 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00242 rcp->setGoodnessOfPID( good ) ;
00243 return LCIO::SUCCESS ;
00244 }
00245
00246 int lcrcpaddparticle( PTRTYPE recopart, PTRTYPE particle ) {
00247 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00248 ReconstructedParticle* rparticle = f2c_pointer<ReconstructedParticle,LCObject>( particle ) ;
00249 rcp->addParticle( rparticle ) ;
00250 return LCIO::SUCCESS ;
00251 }
00252
00253 int lcrcpaddcluster( PTRTYPE recopart, PTRTYPE clus ) {
00254 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00255 Cluster* cclus = f2c_pointer<Cluster,LCObject>( clus ) ;
00256 rcp->addCluster( cclus ) ;
00257 return LCIO::SUCCESS ;
00258 }
00259
00260 int lcrcpaddtrack( PTRTYPE recopart, PTRTYPE track ) {
00261 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00262 Track* ctrack = f2c_pointer<Track,LCObject>( track ) ;
00263 rcp->addTrack( ctrack ) ;
00264 return LCIO::SUCCESS ;
00265 }
00266
00267
00268
00269
00270
00271
00272
00273
00274 int lcrcpsetstartvertex( PTRTYPE recopart, PTRTYPE vertex ) {
00275 ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00276 Vertex* vtx = f2c_pointer<Vertex,LCObject>( vertex ) ;
00277 rcp->setStartVertex( vtx ) ;
00278 return LCIO::SUCCESS ;
00279 }
00280