// Author: David Lawrence Sat Jan 29 09:37:37 EST 2011 // // // MyProcessor.cc // #include using namespace std; #include #include "MyProcessor.h" #include #include #include extern void Smear(s_HDDM_t *hddm_s); extern char *OUTFILENAME; static pthread_mutex_t output_file_mutex; static pthread_t output_file_mutex_last_owner; void mcsmear_thread_HUP_sighandler(int sig) { jerr<<" Caught HUP signal for thread 0x"<GetJEvent(); JEventSource *source = event.GetJEventSource(); DEventSourceHDDM *hddm_source = dynamic_cast(source); if(!hddm_source){ cerr<<" This program MUST be used with an HDDM file as input!"<flush_on_free = false; // Smear values and add noise hits Smear(hddm); // Write event to output file pthread_mutex_lock(&output_file_mutex); output_file_mutex_last_owner = pthread_self(); flush_s_HDDM(hddm, file); Nevents_written++; pthread_mutex_unlock(&output_file_mutex); return NOERROR; } //------------------------------------------------------------------ // fini -Close output file here //------------------------------------------------------------------ jerror_t MyProcessor::fini(void) { if(file){ close_s_HDDM(file); cout<