// Author: David Lawrence June 25, 2004 // // // DTrackLSFitter.h // /// Example program for a Hall-D analyzer which uses DANA /// #ifndef _DTRACKLSFITTER_H_ #define _DTRACKLSFITTER_H_ #define DTRACKLSFITTER_UNDEFINED -2 #define DTRACKLSFITTER_FIT_NOT_ATTEMPTED -1 #define DTRACKLSFITTER_NOMINAL 0 #define DTRACKLSFITTER_EXCEPTION_THROWN 1 #include #include "HDGEOMETRY/DMagneticFieldMap.h" #include "FDC/DFDCSegment_factory.h" #include "CDC/DCDCTrackHit.h" #include "TRACKING/DMCThrown.h" #include #include #include #include #include #include "chisqMin.h" #include "hitDetails.h" #include "hddm_fitter.h" #include "combinedResidFunc.h" #include "MyTrajectoryGrkuta.h" class DTrackLSFitter:public JEventProcessor { public: DTrackLSFitter(); ~DTrackLSFitter(); jerror_t init(void); ///< Called once at program start. jerror_t brun(JEventLoop *eventLoop, int runnumber); ///< Called everytime a new run number is detected. jerror_t evnt(JEventLoop *eventLoop, int eventnumber); ///< Called every event. int eventNo; jerror_t erun(void); jerror_t fini(void); int debug_level; HepVector getParams(); double getChiSquared(); int getSizeFDC(); int getSizeCDC(); int getStatus(); private: const DMagneticFieldMap *bfield; const DLorentzDeflections *lorentz_def; DFDCSegment_factory *segment_factory; ofstream *signatureFile; ifstream *configFile; HepVector ppEnd; chisqMin *fitPtr; int size_fdc, size_cdc; vectorpseudopoints; vectortrackhits; vectorthrown; double xpInitial, zInitial, thetaInitial, phiInitial, ptinvInitial; void setFitterStartParams(); fitter_iostream_t* ios; void writeTrajectoryHddm(MyTrajectoryBfield &traj, int tag, fitter_Trajectorys_t *trajsHddm); void writeCDCDetailsHddm(vector *CDCDetailsPtr, fitter_Residuals_t *residsHddm); void writeFDCDetailsHddm(vector *FDCDetailsPtr, fitter_Residuals_t *residsHddm); void writeCDCHitsHddm(fitter_Event_t* event); void writeFDCHitsHddm(fitter_Event_t* event); int status; // status code void writeResidsHddm(const HepVector ¶ms, fitter_Trajectorys_t *trajsHddm, combinedResidFunc &prf, MyTrajectoryBfield &trajectory); void writeFitHddm(fitter_Trajectorys_t* trajsHddm); int startChoice; }; #endif // _DTRACKLSFITTER_H_