Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTrackCandidate_factory_FDCCathodes.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DTrackCandidate_factory_FDCCathodes.h
4 // Created: Tue Nov 6 13:37:08 EST 2007
5 // Creator: staylor (on Linux ifarml1.jlab.org 2.4.21-47.0.1.ELsmp i686)
6 //
7 
8 #ifndef _DTrackCandidate_factory_FDCCathodes_
9 #define _DTrackCandidate_factory_FDCCathodes_
10 
11 #include <JANA/JFactory.h>
12 #include "DTrackCandidate.h"
13 #include <DMatrix.h>
16 #include "DMagneticFieldStepper.h"
17 #include <TH1F.h>
18 #include <TH2F.h>
19 #include "DHelicalFit.h"
20 
21 /// \htmlonly
22 /// <A href="index.html#legend">
23 /// <IMG src="CORE.png" width="100">
24 /// </A>
25 /// \endhtmlonly
26 
27 /// Find track candidates in the Forward Drift Chambers (FDC).
28 /// This will try to form candidates from hits found in the FDC.
29 /// Roughly, clusters of hits in single packages (6 wire planes)
30 /// are found and fit. The fit is propagated to adjacent packages
31 /// to link them up with hit clusters there. Eventually, all hits
32 /// are used to fit using a Reimann method to obtain the parameters
33 /// of the candidate.
34 ///
35 /// These candidates will be merged with those from the FDC in
36 /// the DTrackCandidate_factory class.
37 
38 class DTrackCandidate_factory_FDCCathodes:public JFactory<DTrackCandidate>{
39  public:
41  DEBUG_HISTS = false;
42  //DEBUG_HISTS = true;
43  };
45  const char* Tag(void){return "FDCCathodes";}
46 
47  private:
50 
51  //jerror_t init(void); ///< Called once at program start.
52  jerror_t brun(JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
53  jerror_t evnt(JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
54  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
55  jerror_t fini(void); ///< Called after last event of last event source has been processed.
56 
57  jerror_t GetPositionAndMomentum(const DFDCSegment *segment);
58  jerror_t GetPositionAndMomentum(DVector3 &pos,DVector3 &mom);
59  jerror_t GetPositionAndMomentum(vector<const DFDCSegment *>segments,
60  DVector3 &pos,DVector3 &mom);
61  jerror_t GetPositionAndMomentum(const DFDCSegment *segment,
62  DVector3 &pos,DVector3 &mom);
63 
64  double GetCharge(const DVector3 &pos,const DFDCSegment *segment);
65  double GetCharge(const DVector3 &pos,vector<const DFDCSegment *>segments);
66 
67  double DocaSqToHelix(const DFDCPseudo *hit);
68  DFDCSegment *GetTrackMatch(DFDCSegment *segment,vector<DFDCSegment*>package,
69  unsigned int &match_id);
70  void LinkSegments(unsigned int pack1,vector<DFDCSegment *>packages[4],
71  vector<pair<const DFDCSegment*,const DFDCSegment*> >&paired_segments, vector<vector<int> >&is_paired);
72  double Match(double p);
73 
74  bool GetTrackMatch(double q,DVector3 &pos,DVector3 &mom,
75  const DFDCSegment *segment);
76  bool LinkStraySegment(const DFDCSegment *segment);
77  bool LinkSegmentsHough(vector<pair<unsigned int,unsigned int> >&unused_segements,
78  vector<DFDCSegment *>packages[4],
79  vector<vector<int> >&is_paired);
80 
81 
83 
85 
86  vector<double>z_wires;
88 
90 
91  // Fit parameters
92  double xc,yc,rc,q,tanl;
93 
94  // Parameters at the end of the segment
95  double xs,ys,zs;
97 };
98 
100  double cut=5.5/p;
101  if (cut>9.0) cut=9.0;
102  if (cut<5.) cut=5.0;
103  return cut;
104 }
105 
106 
107 #endif // _DTrackCandidate_factory_FDCCathodes_
108 
double GetCharge(const DVector3 &pos, const DFDCSegment *segment)
TVector3 DVector3
Definition: DVector3.h:14
bool LinkSegmentsHough(vector< pair< unsigned int, unsigned int > > &unused_segements, vector< DFDCSegment * >packages[4], vector< vector< int > > &is_paired)
&lt;A href=&quot;index.html#legend&quot;&gt; &lt;IMG src=&quot;CORE.png&quot; width=&quot;100&quot;&gt; &lt;/A&gt;
class DFDCPseudo: definition for a reconstructed point in the FDC
Definition: DFDCPseudo.h:74
DMagneticFieldStepper class.
jerror_t evnt(JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t brun(JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t GetPositionAndMomentum(const DFDCSegment *segment)
jerror_t fini(void)
Called after last event of last event source has been processed.
class DFDCSegment: definition for a track segment in the FDC
Definition: DFDCSegment.h:31
void LinkSegments(unsigned int pack1, vector< DFDCSegment * >packages[4], vector< pair< const DFDCSegment *, const DFDCSegment * > > &paired_segments, vector< vector< int > > &is_paired)
DFDCSegment * GetTrackMatch(DFDCSegment *segment, vector< DFDCSegment * >package, unsigned int &match_id)