//****************************************************************** // DFDCSegment_factory.h: class definition for a factory creating // track segments from pseudopoints //****************************************************************** #ifndef DFACTORY_DFDCSEGMENT_H #define DFACTORY_DFDCSEGMENT_H #include "JANA/JFactory.h" #include "JANA/JException.h" #include "JANA/JStreamLog.h" #include "DFDCSegment.h" #include "DFDCPseudo.h" #include "DFDCHit.h" #include "HDGEOMETRY/DMagneticFieldMap.h" #include "HDGEOMETRY/DLorentzDeflections.h" #include #include #include #include #include /* The folowing are for interpreting grid of Lorentz deflection data */ /*#define PACKAGE_Z_POINTS 10 #define LORENTZ_X_POINTS 21 #define LORENTZ_Z_POINTS 4*PACKAGE_Z_POINTS */ /// /// class DFDCSegment_factory: definition for a JFactory that /// produces space points from pseudopoints. /// class DFDCSegment_factory : public JFactory { public: /// /// DFDCSegment_factory::DFDCSegment_factory(): /// default constructor -- initializes log file /// DFDCSegment_factory(); /// /// DFDCSegment_factory::~DFDCSegment_factory(): /// default destructor -- closes log file /// ~DFDCSegment_factory(); typedef struct{ DVector2 xy; double z,covr,covrphi; }xyz_t; jerror_t FindSegments(vectorpoints); // jerror_t CorrectPoints(vectorpoint,DMatrix XYZ); jerror_t GetHelicalTrackPosition(double z,const DFDCSegment *segment, double &xpos,double &ypos); jerror_t RiemannHelicalFit(vectorpoints, DMatrix &CR,vector&XYZ); jerror_t RiemannCircleFit(vectorpoints, DMatrix &CRPhi); jerror_t RiemannLineFit(vectorpoints, DMatrix &CR,vector&XYZ); jerror_t UpdatePositionsAndCovariance(unsigned int n,double r1sq, vector &XYZ,DMatrix &CRPhi, DMatrix &CR); double GetRotationSense(unsigned int n,vector&XYZ,DMatrix &CR, DMatrix &CRPhi); protected: /// /// DFDCSegment_factory::brun(): /// jerror_t brun(JEventLoop *eventLoop, int runnumber); /// /// DFDCSegment_factory::evnt(): /// this is the place that finds track segments and /// converts pseudopoints into space points. /// jerror_t evnt(JEventLoop *eventLoop, int eventNo); private: JStreamLog* _log; double N[3]; double varN[3][3]; double dist_to_origin,xc,yc,rc; double xavg[3],var_avg; // Track parameters double tanl,z0,zvertex,D,phi0; double var_tanl,Phi1; double rotation_sense; unsigned int ref_plane; double RotationSenseToCharge; double chisq; int Ndof; const DMagneticFieldMap *bfield; const DLorentzDeflections *lorentz_def; // double ref_time; // bool use_tof,use_sc; double TARGET_Z; int DEBUG_LEVEL; //vector of flags indicating whether or not a hit has been used vectorused; int myeventno; }; #endif // DFACTORY_DFDCSEGMENT_H