// // Author: Richard Jones June 29, 2012 // // DEventSourceREST // /// Implements JEventSource for REST files #ifndef _JEVENT_SOURCEREST_H_ #define _JEVENT_SOURCEREST_H_ #include #include #include #include #include #include #include "hddm_r.hpp" #include #include #include #include "TRACKING/DMCThrown.h" #include #include #include #include #include #include class DEventSourceREST:public JEventSource { public: DEventSourceREST(const char* source_name); virtual ~DEventSourceREST(); virtual const char* className(void) { return static_className(); } static const char* static_className(void) { return "DEventSourceREST"; } jerror_t GetEvent(JEvent &event); void FreeEvent(JEvent &event); jerror_t GetObjects(JEvent &event, JFactory_base *factory); jerror_t Extract_DMCReaction(hddm_r::HDDM *record, JFactory *factory); jerror_t Extract_DBeamPhoton(hddm_r::HDDM *record, JFactory *factory); jerror_t Extract_DMCThrown(hddm_r::HDDM *record, JFactory *factory); jerror_t Extract_DTagger(hddm_r::HDDM *record, JFactory* factory); jerror_t Extract_DSCHit(hddm_r::HDDM *record, JFactory* factory); jerror_t Extract_DTOFPoint(hddm_r::HDDM *record, JFactory* factory); jerror_t Extract_DFCALShower(hddm_r::HDDM *record, JFactory* factory); jerror_t Extract_DBCALShower(hddm_r::HDDM *record, JFactory* factory); jerror_t Extract_DTrackTimeBased(hddm_r::HDDM *record, JFactory* factory); #if 0 jerror_t Extract_DRFTime(hddm_r::HDDM *record, JFactory* factory); #endif Particle_t PDGtoPtype(int pdgtype); DMatrixDSym Get7x7ErrorMatrix(double mass, const double vec[5], const DMatrixDSym& C5x5); private: // Warning: Class JEventSource methods must be re-entrant, so do not // store any data here that might change from event to event. std::ifstream *ifs; // input hddm file ifstream hddm_r::istream *fin; // provides hddm layer on top of ifstream pthread_mutex_t rt_mutex; std::map > rt_by_event; std::list rt_pool; DApplication *dapp; const DMagneticFieldMap *saved_bfield; const DGeometry *saved_geom; int saved_runnumber; }; #endif //_JEVENT_SOURCEREST_H_