Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTrackCandidate_factory_FDC.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DTrackCandidate_factory_FDC.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_FDC_
9 #define _DTrackCandidate_factory_FDC_
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 "DHoughFind.h"
21 #include "DTrackCandidate.h"
22 #include "FDC/DFDCIntersection.h"
23 #include "FDC/DFDCWire.h"
24 
25 class DMagneticFieldMap;
26 
27 /// \htmlonly
28 /// <A href="index.html#legend">
29 /// <IMG src="ND.png" width="100">
30 /// <IMG src="DEP.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 /// This was originally written to help study the possibility of a wires only
39 /// design of the FDC. As such, it uses the DFDCIntersection objects as inputs
40 /// which have a far worse position resolution than what is achievable with the
41 /// the cathode strips. Consequently, this tended to produce more ghost tracks.
42 
43 class DTrackCandidate_factory_FDC:public JFactory<DTrackCandidate>{
44  public:
47  virtual const char* Tag(void){return "FDC";}
48 
50  NONE = 0x000,
51  NOISE = 0x001,
52  USED = 0x002,
53  CANT_BE_IN_SEED = 0x008,
54  ON_CIRCLE = 0x010,
55  IN_THETA_RANGE = 0x020,
56  IN_Z_RANGE = 0x040,
57  VALID_HIT = 0x080,
58  OUT_OF_TIME = 0x100
59  };
60 
61  enum ret_cond_t{
62  FIT_OK = 0,
65  FIND_FAILED
66  };
67 
68  class DFDCTrkHit{
69  public:
71  double phi_hit;
72  unsigned int flags;
73  double theta_min;
74  double theta_max;
75  double zmin;
76  double zmax;
77 
78  double Dist2(const DFDCTrkHit* trkhit){
79  DVector3 delta = trkhit->hit->pos - this->hit->pos;
80  //return delta.Mag2();
81  double dx = trkhit->hit->pos.X() - this->hit->pos.X();
82  double dy = trkhit->hit->pos.Y() - this->hit->pos.Y();
83  return dx*dx + dy*dy;
84  }
85  };
86 
87  class DFDCSeed{
88  public:
89  vector<DFDCTrkHit*> hits;
90  double p_trans;
91  double tdrift_avg;
92  bool valid;
93  double r0, x0, y0;
94  double phi;
95  double theta;
96  double z_vertex;
97  double q;
98  double theta_min, theta_max;
99  double z_min, z_max;
100  void Merge(DFDCSeed& seed);
101  double MinDist2(DFDCSeed& seed);
102  };
103 
104 
105  protected:
106  virtual jerror_t init(void);
107  virtual jerror_t brun(JEventLoop *loop, int32_t runnumber);
108  virtual jerror_t evnt(JEventLoop *loop, uint64_t eventnumber); ///< Invoked via JEventProcessor virtual method
109  virtual jerror_t fini(void); ///< Invoked via JEventProcessor virtual method
110 
112 
113  vector<DFDCTrkHit*> fdctrkhits;
114 
115  void GetTrkHits(JEventLoop *loop);
116  void FindSeeds(vector<DFDCSeed> &seeds);
117  void FillSeedHits(DFDCSeed &seed);
118  unsigned int NumAvailableHits(void);
119  void FindThetaZ(DFDCSeed &seed);
120  void FindTheta(DFDCSeed &seed, double target_z_min, double target_z_max);
121  void FindZ(DFDCSeed &seed, double theta_min, double theta_max);
122 
125  double MAX_HIT_DIST;
127 
128 };
129 
130 #endif // _DTrackCandidate_factory_FDC_
131 
TVector3 DVector3
Definition: DVector3.h:14
&lt;A href=&quot;index.html#legend&quot;&gt; &lt;IMG src=&quot;ND.png&quot; width=&quot;100&quot;&gt; &lt;IMG src=&quot;DEP.png&quot; width=&quot;100&quot;&gt; &lt;...
int seed