00001 #include "CPPFORT/lcsth.h"
00002
00003 #include "lcio.h"
00004 #include "Exceptions.h"
00005 #include "IOIMPL/LCFactory.h"
00006 #include "IMPL/LCCollectionVec.h"
00007 #include "IMPL/SimTrackerHitImpl.h"
00008 #include "IMPL/LCTOOLS.h"
00009 #include <iostream>
00010
00011 using namespace lcio ;
00012 using namespace std ;
00013
00014 PTRTYPE lcsthcreate(){
00015 SimTrackerHitImpl* hit = new SimTrackerHitImpl ;
00016 return C2F_POINTER( LCObject*, hit ) ;
00017 }
00018
00019 int lcsthdelete( PTRTYPE hit ){
00020 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00021 delete sth ;
00022 return LCIO::SUCCESS ;
00023 }
00024
00025 int lcsthgetcellid( PTRTYPE hit ){
00026 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00027 return sth->getCellID() ;
00028 }
00029
00030 double lcsthgetposition( PTRTYPE hit, int index ){
00031 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00032 return sth->getPosition()[index] ;
00033 }
00034
00035 float lcsthgetmomentum( PTRTYPE hit, int index ){
00036 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00037 return sth->getMomentum()[index] ;
00038 }
00039
00040 float lcsthgetpathlength( PTRTYPE hit ){
00041 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00042 return sth->getPathLength() ;
00043 }
00044
00045
00046 float lcsthgetdedx( PTRTYPE hit ){
00047 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00048 return sth->getdEdx() ;
00049 }
00050
00051 float lcsthgetedep( PTRTYPE hit ){
00052 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00053 return sth->getEDep() ;
00054 }
00055
00056 float lcsthgettime( PTRTYPE hit ){
00057 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00058 return sth->getTime() ;
00059 }
00060
00061 PTRTYPE lcsthgetmcparticle( PTRTYPE hit ){
00062 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00063 return C2F_POINTER( LCObject*, sth->getMCParticle() );
00064 }
00065
00066 int lcsthsetcellid( PTRTYPE hit, int id ){
00067 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00068 sth->setCellID( id ) ;
00069 return LCIO::SUCCESS ;
00070 }
00071 int lcsthsetposition( PTRTYPE hit, double pos[3] ){
00072 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00073 sth->setPosition( pos ) ;
00074 return LCIO::SUCCESS ;
00075 }
00076
00077 int lcsthsetmomentum( PTRTYPE hit, float pos[3] ){
00078 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00079 sth->setMomentum( pos ) ;
00080 return LCIO::SUCCESS ;
00081 }
00082
00083 int lcsthsetmomentumxyz( PTRTYPE hit, float px, float py, float pz ){
00084 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00085 sth->setMomentum( px, py, pz ) ;
00086 return LCIO::SUCCESS ;
00087 }
00088
00089 int lcsthsetpathlength(PTRTYPE hit, float pathLength) {
00090 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00091 sth->setPathLength( pathLength ) ;
00092 return LCIO::SUCCESS ;
00093 }
00094
00095
00096 int lcsthsetdedx( PTRTYPE hit, float dEdX ){
00097 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00098 sth->setdEdx( dEdX ) ;
00099 return LCIO::SUCCESS ;
00100 }
00101
00102 int lcsthsetedep( PTRTYPE hit, float e ){
00103 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00104 sth->setEDep( e ) ;
00105 return LCIO::SUCCESS ;
00106 }
00107
00108 int lcsthsettime( PTRTYPE hit, float t ){
00109 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00110 sth->setTime( t ) ;
00111 return LCIO::SUCCESS ;
00112 }
00113
00114 int lcsthsetmcparticle( PTRTYPE hit, PTRTYPE particle ){
00115 SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
00116 MCParticle* mcp = f2c_pointer<MCParticle,LCObject>( particle ) ;
00117 sth->setMCParticle( mcp ) ;
00118 return LCIO::SUCCESS ;
00119 }