/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/lcio/src/cpp/src/CPPFORT/lcrcp.cc

Go to the documentation of this file.
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 // create delete ReconstructedParticle
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 // get Methods
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 // int lcrcpgetparticleweights( PTRTYPE recopart, float* weights, int* nweights ) {
00093 //   ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00094 //   int ntot = *nweights - 1 ;
00095 //   for(unsigned int l=0;l<rcp->getParticles().size();l++){
00096 //     if ( l > (unsigned)ntot ) {
00097 //       std::cout << "LCReconstructedParticle: in getParticleWeights more than " 
00098 //                 << ntot << "weights to store" << std::endl ;
00099 //       return LCIO::ERROR ;
00100 //     }
00101 //     *weights++ = rcp->getParticleWeights()[l] ;
00102 //   }
00103 //   *nweights = (int)(rcp->getParticles().size() + 1);
00104 //   return LCIO::SUCCESS ;
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 // int lcrcpgetclusterweights( PTRTYPE recopart, float* weights, int* nweights ) {
00115 //   ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00116 //   int ntot = *nweights - 1;
00117 //   for(unsigned int l=0;l<rcp->getClusters().size();l++){
00118 //     if ( l > (unsigned)ntot ) {
00119 //       std::cout << "LCReconstructedParticle: in getClusterWeights more than " 
00120 //                 << ntot << "weights to store" << std::endl ;
00121 //       return LCIO::ERROR ;
00122 //     }
00123 //     *weights++ = rcp->getClusterWeights()[l] ;
00124 //   }
00125 //   *nweights = (int)(rcp->getClusters().size() + 1) ;
00126 //   return LCIO::SUCCESS ;
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 // int lcrcpgettrackweights( PTRTYPE recopart, float* weights, int* nweights ) {
00136 //   ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00137 //   int ntot = *nweights - 1;
00138 //   for(unsigned int l=0;l<rcp->getTracks().size();l++){
00139 //     if ( l > (unsigned)ntot ) {
00140 //       std::cout << "LCReconstructedParticle: in getTrackWeights more than "
00141 //                 << ntot << "weights to store" << std::endl ;
00142 //       return LCIO::ERROR ;
00143 //     }
00144 //     *weights++ = rcp->getTrackWeights()[l] ;
00145 //   }
00146 //   *nweights = (int)(rcp->getTracks().size() + 1) ;
00147 //   return LCIO::SUCCESS ;
00148 // }
00149 
00150 // PTRTYPE lcrcpgetmcparticles( PTRTYPE recopart ) {
00151 //   ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00152 //   const MCParticleVec& idvect = rcp->getMCParticles();
00153 //   return reinterpret_cast<PTRTYPE>( &idvect );
00154 // }
00155 
00156 // int lcrcpgetmcparticleweights( PTRTYPE recopart, float* weights, int* nweights ) {
00157 //   ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00158 //   int ntot = *nweights - 1 ;
00159 //   for(unsigned int l=0;l<rcp->getMCParticles().size();l++){
00160 //     if ( l > (unsigned)ntot ) {
00161 //       std::cout << "LCReconstructedParticle: in getMCParticleWeights more than " 
00162 //                 << ntot << "weights to store" << std::endl ;
00163 //       return LCIO::ERROR ;
00164 //     }
00165 //     *weights++ = rcp->getMCParticleWeights()[l] ;
00166 //   }
00167 //   *nweights = (int)(rcp->getMCParticles().size() + 1);
00168 //   return LCIO::SUCCESS ;
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 // set,add Methods
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 // int lcrcpsetcompound( PTRTYPE recopart, bool lcompound ) {
00192 //   ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00193 //   rcp->setCompound( lcompound ) ;
00194 //   return LCIO::SUCCESS ;
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 // int lcrcpaddmcparticle( PTRTYPE recopart, PTRTYPE particle ) {
00268 //   ReconstructedParticleImpl* rcp = f2c_pointer<ReconstructedParticleImpl,LCObject>( recopart ) ;
00269 //   MCParticle* mmcp = f2c_pointer<MCParticle,LCObject>( particle ) ;
00270 //   rcp->addMCParticle( mmcp ) ;
00271 //   return LCIO::SUCCESS ;
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 

Generated on Mon Jan 7 13:15:21 2013 for MicromegasFramework by  doxygen 1.4.7