// $Id$ // // Created Oct 10, 2013 David Lawrence #include "hddm_cull_events.h" #include //----------- // Process_s -- HDDM simulation format //----------- void Process_s(unsigned int &NEvents, unsigned int &NEvents_read) { // Output file cout<<" output file: "<physicsEvents!=HDDM_NULL){ for(unsigned int i=0; iphysicsEvents->mult; i++){ int eventNo = hddm_s->physicsEvents->in[i].eventNo; if((unsigned int)eventNo == SPECIFIC_EVENT_TO_KEEP){ write_this_event = true; QUIT = true; } } } // Check if we're in the range of offsets to write out if(NEvents_read>EVENTS_TO_SKIP)write_this_event = true; // Write this output event to file and free its memory if(write_this_event){ flush_s_HDDM(hddm_s, fout); NEvents++; }else{ flush_s_HDDM(hddm_s, NULL); } // Update ticker time_t now = time(NULL); if(now != last_time){ cout<<" "<=(EVENTS_TO_SKIP+EVENTS_TO_KEEP))break; if(QUIT)break; } // Close input file close_s_HDDM(fin); } // Close output file close_s_HDDM(fout); }