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

Go to the documentation of this file.
00001 #include "CPPFORT/lcpid.h"
00002 
00003 #include "lcio.h" 
00004 #include "IMPL/ParticleIDImpl.h"
00005 #include "EVENT/LCFloatVec.h"
00006 
00007 using namespace lcio ;
00008 
00009 #include <iostream>
00010 
00011 // create delete ParticleID
00012 
00013 PTRTYPE lcpidcreate(){
00014   ParticleIDImpl* pid = new ParticleIDImpl ;
00015   return C2F_POINTER( LCObject*, pid ) ;
00016 }
00017 int lcpiddelete( PTRTYPE pidit ){
00018   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00019   delete pid ;
00020   return LCIO::SUCCESS ;
00021 }
00022 
00023 
00024 // get Methods
00025 
00026 int lcpidid( PTRTYPE pidit )  {
00027   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00028   return pid->id() ;
00029 }
00030 
00031 int lcpidgettype( PTRTYPE pidit )  {
00032   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00033   return pid->getType() ;
00034 }
00035 
00036 int lcpidgetpdg( PTRTYPE pidit )  {
00037   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00038   return pid->getPDG() ;
00039 }
00040 
00041 float lcpidgetlikelihood( PTRTYPE pidit ) {
00042   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00043   return pid->getLikelihood() ;
00044 }
00045 
00046 int lcpidgetalgorithmtype( PTRTYPE pidit )  {
00047   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00048   return pid->getAlgorithmType() ;
00049 }
00050 
00051 int lcpidgetparameters( PTRTYPE pidit, float* vec, int* nvec ) {
00052   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00053   int ntot = *nvec - 1 ;
00054   const FloatVec* floatVec = &pid->getParameters() ;
00055   for(unsigned int l=0;l<floatVec->size();l++){
00056     if ( l > (unsigned)(ntot) ) {
00057       std::cout << "LCParticleID: in getParameters more than " << ntot << "weights to store" << std::endl ;
00058       return LCIO::ERROR ;
00059     }
00060     *vec++ = (*floatVec)[l] ;
00061   }
00062   *nvec = (int)(floatVec->size() + 1);
00063   return LCIO::SUCCESS ;
00064 }
00065 
00066 
00067 // set,add Methods
00068 
00069 int lcpidsettype( PTRTYPE pidit, int type ) {
00070   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00071   pid->setType( type ) ;
00072   return LCIO::SUCCESS ;
00073 }
00074 
00075 int lcpidsetpdg( PTRTYPE pidit, int pdg ) {
00076   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00077   pid->setPDG( pdg ) ;
00078   return LCIO::SUCCESS ;
00079 }
00080 
00081 int lcpidsetlikelihood( PTRTYPE pidit, float logl) {
00082   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00083   pid->setLikelihood( logl ) ;
00084   return LCIO::SUCCESS ;
00085 }
00086 
00087 int lcpidsetalgorithmtype( PTRTYPE pidit, int ident ) {
00088   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00089   pid->setAlgorithmType( ident ) ;
00090   return LCIO::SUCCESS ;
00091 }
00092 
00093 int lcpidaddparameter( PTRTYPE pidit, float param) {
00094   ParticleIDImpl* pid = f2c_pointer<ParticleIDImpl,LCObject>( pidit ) ;
00095   pid->addParameter( param ) ;
00096   return LCIO::SUCCESS ;
00097 }
00098 
00099 

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