// Author: David Lawrence Sat Jan 29 09:37:37 EST 2011 // // // MyProcessor.cc // #include using namespace std; #include "MyProcessor.h" #include #include #include extern void Smear(s_HDDM_t *hddm_s); extern char *OUTFILENAME; //------------------------------------------------------------------ // init -Open output file //------------------------------------------------------------------ jerror_t MyProcessor::init(void) { // open HDDM file file = init_s_HDDM(OUTFILENAME); if(!file){ cout<<" Error opening output file \""<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); 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<