// Author: David Lawrence June 25, 2004 // // // MyProcessor.h // /// Example program for a Hall-D analyzer which uses DANA /// #ifndef _MYPROCESSOR_H_ #define _MYPROCESSOR_H_ #include #include #include #include #include #include #include #include #include #include class DQuickFit; class DTrackCandidate_factory; class DCDCTrackHit; #include "hdv_mainframe.h" class hdv_fulllistframe; #include #include #include #include #include #include #define MAX_HIT_MARKERS 2000 #define MAX_LINES 100 #define MAX_CIRCLES 100 class MyProcessor; extern MyProcessor *gMYPROC; class MyProcessor:public JEventProcessor { public: MyProcessor(); ~MyProcessor(); 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. //void DrawXY(void); //void DrawRPhi(void); //jerror_t DrawHelicalTrack(DQuickFit *qf, int color); //jerror_t DrawStraightTrack(TVector3 p, TVector3 vertex, int color, int style); //jerror_t DrawTrack(double q, TVector3 pos, TVector3 mom, int color); //jerror_t DrawDetectors(void); const DMagneticFieldMap *Bfield; int eventNo; enum poly_type{ kMarker =0, kLine =1 }; class DGraphicSet{ public: DGraphicSet(Color_t c, poly_type t, double s):color(c),type(t),size(s),marker_style(8){} vector points; Color_t color; poly_type type; // 0=markers, 1=lines double size; int marker_style; }; vector graphics; void FillGraphics(void); void UpdateTrackLabels(void); // Additional graphics that may be appropriate for only certain views vector graphics_xyA; vector graphics_xyB; vector graphics_xz; vector graphics_yz; void GetFactoryNames(vector &facnames); void GetFactories(vector &factories); unsigned int GetNrows(const string &factory, string tag); void GetDReferenceTrajectory(string dataname, string tag, unsigned int index, DReferenceTrajectory* &rt, vector &cdchits); void GetAllWireHits(vector > &allhits); private: hdv_mainframe *hdvmf; hdv_fulllistframe *fulllistmf; JEventLoop *loop; JEvent last_jevent; DRootGeom *RootGeom; DGeometry *geom; string MATERIAL_MAP_MODEL; map photon_track_matching; double DELTA_R_FCAL; void AddKinematicDataTrack(const DKinematicData* kd, int color, double size); void GetIntersectionWithCalorimeter(const DKinematicData* kd, DVector3 &pos, DPhoton::PhotonTag &who); //DTrackCandidate_factory* factory; //void DrawTrackXY(const DKinematicData *, int color, float size); }; extern MyProcessor* gMYPROC; #endif // _MYPROCESSOR_H_