Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTrackWireBased_factory.h
Go to the documentation of this file.
1 // $Id: DTrackWireBased_factory.h 5569 2009-10-02 22:27:08Z staylor $
2 //
3 // File: DTrackWireBased_factory.h
4 // Created: Wed Sep 3 09:33:40 EDT 2008
5 // Creator: davidl (on Darwin harriet.jlab.org 8.11.1 i386)
6 //
7 
8 #ifndef _DTrackWireBased_factory_
9 #define _DTrackWireBased_factory_
10 
11 #include <JANA/JFactory.h>
12 #include <JANA/JObject.h>
13 
14 #include <TRACKING/DTrackFitter.h>
16 #include "PID/DParticleID.h"
18 
19 
20 #include <TH2.h>
21 #include <TH1.h>
22 
23 class DTrackCandidate;
24 class DParticleID;
25 
26 #include "DTrackWireBased.h"
27 
28 ///////////////////////////////////////////////////////////////////////
29 /// The DTrackWireBased_factory class coordinates the fitting of wire-based
30 /// tracks. While the hit selection is done here, the actual heavy
31 /// lifting of the fit is done by the DTrackFitter class (or, more
32 /// specifically, a class that inherits from DTrackFitter).
33 ///
34 /// This grabs a DTrackFitter object using the default Tag through JANA
35 /// and uses it to fit the DTrackCandidate objects which it grabs
36 /// also using the default Tag.
37 ///
38 /// The DTrackWireBased objects are wire-based tracks (no drift time
39 /// information is used). As such, this is hardwired to set the fit type for
40 /// the DTrackFitter to kWireBased. See the DTrackTimeBased classes for the
41 /// time-based counterpart.
42 ///
43 /// This may appear uneccessarily complex, but it provides for using the
44 /// exact same code for fitting both wire-based and time-based tracks
45 /// as well as allowing a lot of flexibility in swapping out the
46 /// DTrackFitter class used by both the wire-based and time-based
47 /// stages using the same DEFTAG mechanism used by the rest of JANA.
48 ///////////////////////////////////////////////////////////////////////
49 
50 class DTrackWireBased_factory:public jana::JFactory<DTrackWireBased>{
51  public:
54 
55 
56  private:
57  jerror_t init(void); ///< Called once at program start.
58  jerror_t brun(jana::JEventLoop *loop, int32_t runnumber); ///< Called everytime a new run number is detected.
59  jerror_t evnt(jana::JEventLoop *loop, uint64_t eventnumber); ///< Called every event.
60  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
61  jerror_t fini(void); ///< Called after last event of last event source has been processed.
62 
66 
71 
72  void FilterDuplicates(void);
73  void DoFit(unsigned int c_id,const DTrackCandidate *candidate,
74  DReferenceTrajectory *rt,jana::JEventLoop *loop,
75  double mass);
76  void AddMissingTrackHypothesis(vector<DTrackWireBased*>&tracks_to_add,
77  const DTrackWireBased *src_track,
78  double my_mass,double q);
79  bool InsertMissingHypotheses(void);
80  void CorrectForELoss(DVector3 &position,DVector3 &momentum,
81  double q, double mass);
82  void AddMissingTrackHypotheses(unsigned int mass_bits,
83  vector<DTrackWireBased*>&tracks_to_add,
84  vector<DTrackWireBased *>&hypotheses,
85  double q);
86 
87 
88  const DGeometry *geom;
89 
93  double MIN_FIT_P;
96 
98  // start counter geom info
99  vector<vector<DVector3> >sc_dir; // direction vector in plane of plastic
100  vector<vector<DVector3> >sc_pos;
101  vector<vector<DVector3> >sc_norm;
103 
105 };
106 
107 #endif // _DTrackWireBased_factory_
108 
void AddMissingTrackHypothesis(vector< DTrackWireBased * > &tracks_to_add, const DTrackWireBased *src_track, double my_mass, double q)
The DTrackFitter class is a base class for different charged track fitting algorithms. It does not actually fit the track itself, but provides the interface and some common support features most algorthims will need to implement.
Definition: DTrackFitter.h:61
TVector3 DVector3
Definition: DVector3.h:14
const DParticleID * dPIDAlgorithm
vector< vector< DVector3 > > sc_dir
jerror_t brun(jana::JEventLoop *loop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t fini(void)
Called after last event of last event source has been processed.
void AddMissingTrackHypotheses(unsigned int mass_bits, vector< DTrackWireBased * > &tracks_to_add, vector< DTrackWireBased * > &hypotheses, double q)
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.
void CorrectForELoss(DVector3 &position, DVector3 &momentum, double q, double mass)
The DTrackWireBased_factory class coordinates the fitting of wire-based tracks. While the hit selecti...
vector< vector< DVector3 > > sc_pos
jerror_t evnt(jana::JEventLoop *loop, uint64_t eventnumber)
Called every event.
&lt;A href=&quot;index.html#legend&quot;&gt; &lt;IMG src=&quot;CORE.png&quot; width=&quot;100&quot;&gt; &lt;/A&gt;
DReferenceTrajectory * rt
void DoFit(unsigned int c_id, const DTrackCandidate *candidate, DReferenceTrajectory *rt, jana::JEventLoop *loop, double mass)
vector< vector< DVector3 > > sc_norm