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

Go to the documentation of this file.
00001 #include "CPPFORT/lcevt.h"
00002 
00003 #include "lcio.h" 
00004 #include "IOIMPL/LCFactory.h"
00005 #include "IMPL/LCRunHeaderImpl.h"
00006 #include "IMPL/LCEventImpl.h"
00007 #include "IMPL/LCCollectionVec.h"
00008 #include "IMPL/LCTOOLS.h"
00009 #include <iostream>
00010 
00011 
00012 using namespace lcio ;
00013 
00014 
00015 PTRTYPE lcevtcreate(){
00016   LCEventImpl*  event = new LCEventImpl() ;
00017   return reinterpret_cast<PTRTYPE>( event ) ;
00018 }
00019 
00020 int lcevtdelete( PTRTYPE event ){
00021   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00022   delete evt ;
00023   return LCIO::SUCCESS ;
00024 }
00025 
00026 int lcevtgetrunnumber( PTRTYPE event ){
00027   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00028   return evt->getRunNumber()  ;
00029 }
00030 
00031 int lcevtgeteventnumber( PTRTYPE event ){
00032   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00033   return evt->getEventNumber()  ;
00034 }
00035 
00036 char* lcevtgetdetectorname( PTRTYPE event ){
00037   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00038   return const_cast<char*> (evt->getDetectorName().c_str()  ) ;
00039 }
00040 
00041 PTRTYPE lcevtgetcollectionnames( PTRTYPE event ){
00042   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00043   return reinterpret_cast<PTRTYPE> ( evt->getCollectionNames() ) ;
00044 }
00045 
00046 // PTRTYPE lcevtgettrelationnames( PTRTYPE event ){
00047 //   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00048 //   return reinterpret_cast<PTRTYPE> ( evt->getRelationNames() ) ;
00049 // }
00050 
00051 long lcevtgettimestamp( PTRTYPE event )
00052 {
00053   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00054   return evt->getTimeStamp()  ;
00055 }
00056 
00057 PTRTYPE lcevtgetcollection(PTRTYPE event, const char* colname){
00058   try{
00059     LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00060     return reinterpret_cast<PTRTYPE>( evt->getCollection( colname ) ) ;
00061   }catch(...){ return 0 ;}
00062 }
00063 
00064 // PTRTYPE lcevtgetrelation(PTRTYPE event, const char* colname){
00065 //   try{
00066 //     LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00067 //     return reinterpret_cast<PTRTYPE>( evt->getRelation( colname ) ) ;
00068 //   }catch(...){ return 0 ;}
00069 // }
00070 
00071 int lcevtaddcollection( PTRTYPE event, PTRTYPE collection, char* colname ){
00072   try{
00073     LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00074     LCCollectionVec* col = reinterpret_cast<LCCollectionVec*>(collection) ; 
00075     evt->addCollection( col , colname ) ;
00076   }catch(...){ return LCIO::ERROR ; }
00077   return LCIO::SUCCESS ;
00078 }
00079 
00080 int lcevtremovecollection( PTRTYPE event, char* colname ){
00081   try{
00082     LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00083     evt->removeCollection( colname ) ;
00084   }catch(...){ return LCIO::ERROR ; }
00085   return LCIO::SUCCESS ;
00086 }
00087 
00088 // int lcevtaddrelation( PTRTYPE event, PTRTYPE relation, char* colname ){
00089 //   try{
00090 //     LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00091 //     LCRelation* rel = reinterpret_cast<LCRelation*>(relation) ;
00092 //     evt->addRelation( rel , colname ) ;
00093 //   }catch(...){ return LCIO::ERROR ; }
00094 //   return LCIO::SUCCESS ;
00095 // }
00096 
00097 // int lcevtremoverelation( PTRTYPE event, const char* colname ){
00098 //   try{
00099 //     LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00100 //     evt->removeRelation( colname ) ;
00101 //   }catch(...){ return LCIO::ERROR ; }
00102 //   return LCIO::SUCCESS ;
00103 // }
00104 
00105 int lcevtsetrunnumber( PTRTYPE event, int rn ){
00106   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00107   evt->setRunNumber( rn ) ;
00108   return LCIO::SUCCESS ;
00109 }
00110 
00111 int lcevtseteventnumber( PTRTYPE event, int en ){
00112   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00113   evt->setEventNumber( en ) ;
00114   return LCIO::SUCCESS ;
00115 }
00116 
00117 int lcevtsetdetectorname( PTRTYPE event,  char* dn ){
00118   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00119   evt->setDetectorName( dn ) ;
00120   return LCIO::SUCCESS ;
00121 }
00122 
00123 int lcevtsettimestamp( PTRTYPE event,  long ts ){
00124   LCEventImpl* evt = reinterpret_cast<LCEventImpl*>(event) ; 
00125   evt->setTimeStamp( ts ) ;
00126   return LCIO::SUCCESS ;
00127 }

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