// Author: David Lawrence June 25, 2004 // // // MyProcessor.cc // #include using namespace std; #include #include #include "MyProcessor.h" int PAUSE_BETWEEN_EVENTS = 1; int SKIP_BORING_EVENTS = 0; int PRINT_ALL=0; vector toprint; #define ansi_escape ((char)0x1b) #define ansi_bold ansi_escape<<"[1m" #define ansi_black ansi_escape<<"[30m" #define ansi_red ansi_escape<<"[31m" #define ansi_green ansi_escape<<"[32m" #define ansi_blue ansi_escape<<"[34m" #define ansi_normal ansi_escape<<"[0m" #define ansi_up(A) ansi_escape<<"["<<(A)<<"A" #define ansi_down(A) ansi_escape<<"["<<(A)<<"B" #define ansi_forward(A) ansi_escape<<"["<<(A)<<"C" #define ansi_back(A) ansi_escape<<"["<<(A)<<"D" //------------------------------------------------------------------ // brun //------------------------------------------------------------------ jerror_t MyProcessor::brun(JEventLoop *eventLoop, int runnumber) { vector factory_names; eventLoop->GetFactoryNames(factory_names); usleep(100000); //this just gives the Main thread a chance to finish printing the "Launching threads" message cout< really_toprint; for(unsigned int i=0; iGetFactory(name,tag.c_str()); if(!factory)factory = eventLoop->GetFactory("D" + name,tag.c_str()); if(factory){ try{ if(factory->GetNrows()>0){ event_is_boring=0; break; } }catch(...){ // someone threw an exception } } } if(event_is_boring)return NOERROR; }else{ event_is_boring = 0; } // Print event separator cout<<"================================================================"<PrintFactories(1); // Print data for all specified factories for(unsigned int i=0;iPrint(name,tag.c_str()); }catch(...){ // exception thrown } } // Wait for user input if pausing if(PAUSE_BETWEEN_EVENTS && !event_is_boring){ cerr.flush(); cout<"; cout.flush(); char c = getchar(); // see note in hd_dump.cc:main() if(c=='\n')cout<Quit(); break; case 'P': //eventLoop->GotoEvent(eventnumber-1); break; case 'N': break; } cout<