//****************************************************************** // 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 typedef struct { float pos; float q; int numstrips; float t; // mean time of strips in peak float 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 evnt(JEventLoop *eventLoop, int eventNo); jerror_t brun(JEventLoop *loop, int runnumber); /// /// 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, float &t, float &t_rms); void CalcMeanTime(vector::const_iterator peak, float &t, float &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(DMatrix N, DMatrix X, DMatrix F, DMatrix J,DMatrix par, DMatrix &newpar); private: std::vectorupeaks; std::vectorvpeaks; vector >fdcwires; JStreamLog* _log; }; #endif // DFACTORY_DFDCPSEUDO_H