// Author: David Lawrence June 24, 2004 // // // DEventSourceHDDM // /// Implements JEventSource for HDDM files // // Changes: Oct 3, 2012 Yi Qiang: add classes for Cerenkov detector // #ifndef _JEVENT_SOURCEHDDM_H_ #define _JEVENT_SOURCEHDDM_H_ #include #include using namespace std; #include #include #include #include #include "hddm_s.h" #include "hddm_s.hpp" #include "TRACKING/DMCTrackHit.h" #include "TRACKING/DMCThrown.h" #include "TRACKING/DMCTrajectoryPoint.h" #include "BCAL/DBCALSiPMHit.h" #include "BCAL/DBCALHit.h" #include "BCAL/DBCALTDCHit.h" #include "BCAL/DBCALTruthShower.h" #include "BCAL/DBCALTruthCell.h" #include "CDC/DCDCHit.h" #include "FDC/DFDCHit.h" #include "FCAL/DFCALTruthShower.h" #include "FCAL/DFCALHit.h" #include "CCAL/DCCALTruthShower.h" #include "CCAL/DCCALHit.h" #include "TOF/DTOFTruth.h" #include "TOF/DTOFRawHit.h" #include "TOF/DTOFRawHitMC.h" #include "START_COUNTER/DSCTruthHit.h" #include "START_COUNTER/DSCHit.h" #include #include #include #include // load CERE headers, yqiang Oct 3, 2012 #include #include class DEventSourceHDDM:public JEventSource { public: DEventSourceHDDM(const char* source_name); virtual ~DEventSourceHDDM(); virtual const char* className(void){return static_className();} static const char* static_className(void){return "DEventSourceHDDM";} jerror_t GetEvent(JEvent &event); void FreeEvent(JEvent &event); jerror_t GetObjects(JEvent &event, JFactory_base *factory); jerror_t Extract_DMCTrackHit(s_HDDM_t *hddm_s, JFactory *factory); jerror_t GetCDCTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t GetFDCTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t GetBCALTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t GetTOFTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t GetCherenkovTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t GetFCALTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t GetCCALTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t GetSCTruthHits(s_HDDM_t *hddm_s, vector& data); jerror_t Extract_DBCALTruthShower(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DBCALTruthCell(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DBCALSiPMHit(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DBCALHit(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DBCALTDCHit(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DMCReaction(s_HDDM_t *hddm_s, JFactory *factory, JEventLoop *loop); jerror_t Extract_DBeamPhoton(s_HDDM_t *hddm_s, JFactory *factory, JEventLoop *loop); jerror_t Extract_DMCThrown(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DCDCHit(s_HDDM_t *hddm_s, JFactory *factory, string tag); jerror_t Extract_DFDCHit(s_HDDM_t *hddm_s, JFactory *factory, string tag); jerror_t Extract_DFCALTruthShower(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DCCALHit(s_HDDM_t *hddm_s, JFactory *factory, JEventLoop* eventLoop, string tag); jerror_t Extract_DCCALTruthShower(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DFCALHit(s_HDDM_t *hddm_s, JFactory *factory, JEventLoop* eventLoop, string tag); jerror_t Extract_DMCTrajectoryPoint(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DTOFTruth(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DTOFRawHit( s_HDDM_t *hddm_s, JFactory* factory, JFactory* factoryMC,string tag); jerror_t Extract_DTOFRawHitMC( s_HDDM_t *hddm_s, JFactory* factoryMC, JFactory* factory,string tag); jerror_t Extract_DSCHit(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DSCTruthHit(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DTrackTimeBased(s_HDDM_t *hddm_s, JFactory *factory, int runnumber); string StringToDMatrixDSym(string &str_vals, DMatrixDSym &mat, int &Nrows, int Ncols); jerror_t Extract_DTagger( s_HDDM_t *hddm_s, JFactory* factory); Particle_t IDTrack(float locCharge, float locMass) const; // add RICH hit and Truth, yqiang Oct 3, 2012 jerror_t Extract_DCereTruth(s_HDDM_t *hddm_s, JFactory *factory); jerror_t Extract_DCereRichHit(s_HDDM_t *hddm_s, JFactory *factory); s_iostream_t *fin; s_HDDM_t *hddm_s; bool flush_on_free; DApplication *dapp; const DMagneticFieldMap *bfield; const DGeometry *geom; private: bool initialized; pthread_mutex_t rt_mutex; map > rt_by_event; list rt_pool; JCalibration *jcalib; float uscale[192],vscale[192]; }; #endif //_JEVENT_SOURCEHDDM_H_