// $Id$ // // File: JEventSource_ETEVIO.h // Created: Mon Nov 26 10:48:42 EST 2012 // Creator: davidl (on Darwin harriet.jlab.org 11.4.2 x86_64) // #include "JEventSource_ETEVIO.h" using namespace jana; #include using namespace evio; //---------------- // Constructor //---------------- JEventSource_ETEVIO::JEventSource_ETEVIO(const char* source_name):JEventSource_EVIO(source_name) { // open event source here et_sys_id sys_id; et_att_id att_id; et_stat_id sta_id; // Split source name into session, station, etc... vector fields; size_t cutAt; string str = source_name; while( (cutAt = str.find(":")) != str.npos ){ if(cutAt > 0)fields.push_back(str.substr(0,cutAt)); str = str.substr(cutAt+1); } if(str.length() > 0)fields.push_back(str); string session = fields.size()>1 ? fields[1]:"none"; string station = fields.size()>2 ? fields[2]:"DANA"; int Nevents = fields.size()>3 ? atoi(fields[3].c_str()):1; cout<<"Opening ET session:"<open(); } //---------------- // ReadEVIOEvent //---------------- jerror_t JEventSource_ETEVIO::ReadEVIOEvent(void) { if(!chan->read())return NO_MORE_EVENTS_IN_SOURCE; return NOERROR; } //---------------- // Destructor //---------------- JEventSource_ETEVIO::~JEventSource_ETEVIO() { // chan is closed and deleted by base class destructor }