Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTrackCandidate_factory_FDCpseudo.h
Go to the documentation of this file.
1 // $Id: DTrackCandidate_factory_FDCpseudo.h 2955 2007-11-11 04:54:05Z davidl $
2 //
3 // File: DTrackCandidate_factory_FDCpseudo.h
4 // Created: Mon Jul 18 15:23:04 EDT 2005
5 // Creator: davidl (on Darwin wire129.jlab.org 7.8.0 powerpc)
6 //
7 
8 #ifndef _DTrackCandidate_factory_FDCpseudo_
9 #define _DTrackCandidate_factory_FDCpseudo_
10 
11 #include <TH1.h>
12 #include <TH2F.h>
13 #include <TH3F.h>
14 
15 #include <JANA/JFactory.h>
16 #include <JANA/JGeometry.h>
17 using namespace jana;
18 
19 #include "DQuickFit.h"
20 #include "DTrackCandidate.h"
21 #include "FDC/DFDCPseudo.h"
22 #include "FDC/DFDCWire.h"
23 #include "DHoughFind.h"
24 
25 class DMagneticFieldMap;
26 
27 
28 /// \htmlonly
29 /// <A href="index.html#legend">
30 /// <IMG src="ND.png" width="100">
31 /// </A>
32 /// \endhtmlonly
33 
34 /// This is an alternate FDC track finder that is not used as part of the default
35 /// reconstruction. It is no longer maintained, but is kept around as an independent
36 /// check against the default FDC finder in DTrackCandiate_factory_FDCpseudo .
37 
38 class DTrackCandidate_factory_FDCpseudo:public JFactory<DTrackCandidate>{
39  public:
42  const string toString(void);
43  virtual const char* Tag(void){return "FDCpseudo";}
44 
46  NONE = 0x000,
47  NOISE = 0x001,
48  USED = 0x002,
49  CANT_BE_IN_SEED = 0x008,
50  ON_CIRCLE = 0x010,
51  IN_THETA_RANGE = 0x020,
52  IN_Z_RANGE = 0x040,
53  VALID_HIT = 0x080,
54  OUT_OF_TIME = 0x100
55  };
56 
57  enum ret_cond_t{
58  FIT_OK = 0,
61  FIND_FAILED
62  };
63 
64  class DFDCTrkHit{
65  public:
66  const DFDCPseudo *hit;
67  double phi_hit;
68  unsigned int flags;
69  double theta_min;
70  double theta_max;
71  double zmin;
72  double zmax;
73 
74  double Dist2(const DFDCTrkHit* trkhit){
75  //double dx = trkhit->hit->x - this->hit->x;
76  //double dy = trkhit->hit->y - this->hit->y;
77  //return dx*dx + dy*dy;
78  return (trkhit->hit->xy-this->hit->xy).Mod2();
79  }
80  };
81 
82  class DFDCSeed{
83  public:
84  vector<DFDCTrkHit*> hits;
85  double p_trans;
86  double tdrift_avg;
87  bool valid;
88  double r0, x0, y0;
89  double phi;
90  double theta;
91  double z_vertex;
92  double q;
93  double theta_min, theta_max;
94  double z_min, z_max;
95  void Merge(DFDCSeed& seed);
96  double MinDist2(DFDCSeed& seed);
97  };
98 
99 
100  protected:
101  virtual jerror_t init(void);
102  virtual jerror_t brun(JEventLoop *loop, int32_t runnumber);
103  virtual jerror_t evnt(JEventLoop *loop, uint64_t eventnumber); ///< Invoked via JEventProcessor virtual method
104  virtual jerror_t fini(void); ///< Invoked via JEventProcessor virtual method
105 
107 
108  vector<DFDCTrkHit*> fdctrkhits;
109 
110  void GetTrkHits(JEventLoop *loop);
111  void FindSeeds(vector<DFDCSeed> &seeds);
112  void FillSeedHits(DFDCSeed &seed);
113  unsigned int NumAvailableHits(void);
114  void FindThetaZ(DFDCSeed &seed);
115  void FindTheta(DFDCSeed &seed, double target_z_min, double target_z_max);
116  void FindZ(DFDCSeed &seed, double theta_min, double theta_max);
117 
120  double MAX_HIT_DIST;
122 
123 };
124 
125 #endif // _DTrackCandidate_factory_FDCpseudo_
126 
DVector2 xy
rough x,y coordinates in lab coordinate system
Definition: DFDCPseudo.h:100
class DFDCPseudo: definition for a reconstructed point in the FDC
Definition: DFDCPseudo.h:74
int seed
&lt;A href=&quot;index.html#legend&quot;&gt; &lt;IMG src=&quot;ND.png&quot; width=&quot;100&quot;&gt; &lt;/A&gt;