Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventProcessor_trkres_tree.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DEventProcessor_trackres_tree.h
4 // Created: Tue Apr 7 14:54:33 EDT 2009
5 // Creator: davidl (on Darwin harriet.jlab.org 9.6.0 i386)
6 //
7 
8 #ifndef _DEventProcessor_trkres_tree_
9 #define _DEventProcessor_trkres_tree_
10 
11 #include <vector>
12 using namespace std;
13 
14 #include <TTree.h>
15 #include <TFile.h>
16 #include <TH1.h>
17 #include <TH2.h>
18 
19 #include <JANA/JFactory.h>
20 #include <JANA/JEventProcessor.h>
21 #include <JANA/JEventLoop.h>
22 
23 #include <PID/DKinematicData.h>
25 #include <TRACKING/DMCTrackHit.h>
26 #include <TRACKING/DMCThrown.h>
27 #include <CDC/DCDCTrackHit.h>
28 #include <FDC/DFDCHit.h>
29 
30 #include "trackres.h"
31 
32 class DMCTrajectoryPoint;
33 class DCoordinateSystem;
34 
35 class DEventProcessor_trkres_tree:public JEventProcessor{
36  public:
39  const char* className(void){return "DEventProcessor_trackres_tree";}
40 
41  trackres *trkres_ptr, trkres;
42  TTree *ttrkres;
44 
45  pthread_mutex_t mutex;
46 
47  double SIGMA_CDC;
50 
51  class meas_t{
52  public:
53  double s;
54  double err;
55  double errc;
56  double radlen;
57  double B;
59  };
60 
61  private:
62  jerror_t init(void); ///< Called once at program start.
63  jerror_t brun(JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
64  jerror_t evnt(JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
65  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
66  jerror_t fini(void); ///< Called after last event of last event source has been processed.
67 
68  const DMCTrajectoryPoint* FindTrajectoryPoint(const DCoordinateSystem *wire, double &radlen, double &s, vector<const DMCTrajectoryPoint*> trajpoints);
69  void GetPtRes(vector<meas_t> &meas, double &deltak, double &pt_res);
70  void GetThetaRes(vector<meas_t> &meas, double &theta_res);
71 
72 };
73 
74 #endif // _DEventProcessor_trackres_tree_
75