// $Id$ // // File: JEventSourceGenerator_EVIO_FCALTEST2011.cc // Created: Mon Nov 28 16:07:15 EST 2011 // Creator: davidl (on Linux ifarm1102 2.6.18-128.7.1.el5 x86_64) // #include using std::string; #include "JEventSourceGenerator_EVIO_FCALTEST2011.h" #include "JFactoryGenerator_fADC250.h" #include "JFactoryGenerator_MiniFCAL.h" using namespace jana; #include #include using namespace evio; // Routine used to create our JEventProcessor #include extern "C"{ void InitPlugin(JApplication *app){ InitJANAPlugin(app); app->AddEventSourceGenerator(new JEventSourceGenerator_EVIO_FCALTEST2011()); app->AddFactoryGenerator(new JFactoryGenerator_fADC250); app->AddFactoryGenerator(new JFactoryGenerator_MiniFCAL); } } // "C" //--------------------------------- // Description //--------------------------------- const char* JEventSourceGenerator_EVIO_FCALTEST2011::Description(void) { return "EVIO_FCALTEST2011"; } //--------------------------------- // CheckOpenable //--------------------------------- double JEventSourceGenerator_EVIO_FCALTEST2011::CheckOpenable(string source) { // This should return a value between 0 and 1 inclusive // with 1 indicating it definitely can read events from // the specified source and 0 meaning it definitely can't. // Typically, this will just check the file suffix. // Try to open the file try { // create evio file channel object using first arg as file name evioFileChannel chan(source); // open the file. Throws exception if not successful chan.open(); // close file chan.close(); return 0.5; } catch (evioException *e) { // Could not open file return 0.0; } } //--------------------------------- // MakeJEventSource //--------------------------------- JEventSource* JEventSourceGenerator_EVIO_FCALTEST2011::MakeJEventSource(string source) { return new JEventSource_EVIO_FCALTEST2011(source.c_str()); }