//****************************************************************** // DFDCPseudo_factory.h: class definition for a factory creating // pseudopoints from anode hits and cathode clusters. // Author: Craig Bookwalter // Date: Apr 2006 // Several revisions made by Simon Taylor, Fall 2006 //****************************************************************** #ifndef DFACTORY_DFDCPSEUDO_H #define DFACTORY_DFDCPSEUDO_H #include #include #include #include using namespace jana; #include "DFDCPseudo.h" #include "DFDCCathodeCluster.h" #include "DFDCHit.h" #include "DFDCGeometry.h" #include "HDGEOMETRY/DGeometry.h" #include #include #include #include #include #include #include #include #include typedef struct { double pos; double q; double q_from_pulse_height; int numstrips; double t; // mean time of strips in peak double t_rms; // rms of strips in peak unsigned int cluster; // index for cluster from which this centroid was generated }centroid_t; /// /// class DFDCPseudo_factory: definition for a JFactory that /// produces pseudopoints from anode hits and DFDCCathodeClusters. /// For now, it is purely geometry-based. /// class DFDCPseudo_factory : public JFactory { public: /// /// DFDCPseudo_factory::DFDCPseudo_factory(): /// default constructor -- initializes log file /// DFDCPseudo_factory(); /// /// DFDCPseudo_factory::~DFDCPseudo_factory(): /// default destructor -- closes log file /// ~DFDCPseudo_factory(); protected: /// /// DFDCPseudo_factory::evnt(): /// this is the place that anode hits and DFDCCathodeClusters /// are organized into pseudopoints. /// For now, this is done purely by geometry, with no drift /// information. See also /// DFDCPseudo_factory::makePseudo(). /// jerror_t init(void); jerror_t evnt(JEventLoop *eventLoop, int eventNo); jerror_t brun(JEventLoop *loop, int runnumber); jerror_t erun(void); /// /// DFDCPseudo_factory::makePseudo(): /// performs UV+X matching to create pseudopoints /// void makePseudo( vector& x, vector& u, vector& v, int layer, vector &mctrackhits); /// /// DFDCPseudo_factory::CalcMeanTime() /// Calculates mean and RMS time for a cluster of cathode hits /// void CalcMeanTime(const vector& H, double &t, double &t_rms); void CalcMeanTime(vector::const_iterator peak, double &t, double &t_rms); /// /// DFDCPseudo_factory::FindCentroid() /// Calculates the centroids of groups of three adjacent strips /// containing a peak. /// jerror_t FindCentroid(const vector& H, vector::const_iterator peak, vector ¢roids); // Backtracking routine needed by FindCentroid jerror_t FindNewParmVec(const DMatrix3x1 &N,const DMatrix3x1 &X, const DMatrix3x1 &F,const DMatrix3x3 &J, const DMatrix3x1 &par, DMatrix3x1 &newpar); private: vector >fdcwires; vector >fdccathodes; vectorxshifts; vectoryshifts; double ROUT_FIDUCIAL,RIN_FIDUCIAL; double r2_out,r2_in; double STRIP_ANODE_TIME_CUT; unsigned int MAX_ALLOWED_FDC_HITS; bool DEBUG_HISTS,USE_FDC,MATCH_TRUTH_HITS; double MIDDLE_STRIP_THRESHOLD; double FDC_RES_PAR1,FDC_RES_PAR2; TH2F *qv_vs_qu, *dtv_vs_dtu; TH2F *uv_dt_vs_u,*uv_dt_vs_v,*v_wire_dt_vs_wire; TH2F *tv_vs_tu,*u_wire_dt_vs_wire; TH2F *Hxy[24],*ut_vs_u,*vt_vs_v; TH2F *v_vs_u,*dx_vs_dE; JStreamLog* _log; }; #endif // DFACTORY_DFDCPSEUDO_H