/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/analyse/lcio/addDifSynchro.cc

Go to the documentation of this file.
00001 #include "lcio/AddDifSynchro.hh" 
00002 #include "lcio/Count.hh" 
00003 
00004 
00005 #include "Log.hh" 
00006 
00007 #include <iostream>
00008 #include <string>
00009 
00010 using namespace std;
00011 
00012 int main(int argc, char**argv){
00013 
00014         if ( argc != 4  ) {
00015                 cout  << endl <<"usage:addDifSynchro difSynchro_file slab_file output_file " << endl;
00016                 exit(1);
00017         }
00018         // assign file name
00019         string difSynchroName;
00020         difSynchroName.assign(argv[1]);
00021 
00022         string slabFileName;
00023         slabFileName.assign(argv[2]);
00024 
00025         unsigned int synchroNumber = Count(difSynchroName).getNumberOfEvent();
00026         unsigned int slabNumber = Count(slabFileName).getNumberOfEvent();
00027         
00028     if ( synchroNumber != slabNumber ) 
00029         {
00030                 cout << endl << " !!! ERROR !!! " << endl << endl ;  
00031                 cout << "Number of event differ in both file" << endl ;  
00032                 cout << difSynchroName << " "  << synchroNumber << " number of events." << endl;
00033                 cout << slabFileName << " "  << slabNumber << " number of events." << endl;
00034                 exit ( -1 ) ;
00035         }
00036         cout << "--- " << synchroNumber << " event to merge ---" <<endl; 
00037 /*
00038         // Verify events number 
00039 
00040         Count *countSync = new Count(difSynchroName);
00041     LCReader* lcReader = LCFactory::getInstance()->createLCReader() ;
00042     lcReader->open(slabFileName);
00043     // registere processor to LCReader
00044     lcReader->registerLCEventListener( evtProc ) ;
00045 
00046     // Start reading slabfile
00047     lcReader->readStream() ;
00048 
00049         Count *countSlab = new Count(slabFileName);
00050 */      
00051 
00052         // Create AddDifSynchro processor with difSynchro_file and output file as parameters
00053         AddDifSynchro *evtProc = new AddDifSynchro(difSynchroName,argv[3]) ;
00054          
00055         // Open slabFile to get event information to be coy in new output file
00056         LCReader* lcReader = LCFactory::getInstance()->createLCReader() ;
00057         lcReader->open(slabFileName);
00058         // registere processor to LCReader
00059         lcReader->registerLCEventListener( evtProc ) ;
00060         
00061         // Start reading slabfile
00062         lcReader->readStream() ;
00063         
00064         lcReader->close() ;
00065         delete lcReader ;
00066         delete evtProc;
00067         return 0 ;
00068 }

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