Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTrackTimeBased_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DTrackTimeBased_factory.h
4 // Created: Thu Sep 4 14:02:44 EDT 2008
5 // Creator: davidl (on Darwin harriet.jlab.org 8.11.1 i386)
6 //
7 
8 #ifndef _DTrackTimeBased_factory_
9 #define _DTrackTimeBased_factory_
10 
11 #include <memory>
12 
13 #include <TH2.h>
14 
15 #include <JANA/JFactory.h>
16 #include <PID/DParticleID.h>
17 #include <BCAL/DBCALShower.h>
18 #include <FCAL/DFCALShower.h>
19 #include <TOF/DTOFPoint.h>
20 #include <CDC/DCDCHit.h>
21 #include <START_COUNTER/DSCHit.h>
22 #include "PID/DParticleID.h"
23 
24 #include "DMCThrown.h"
25 #include "DTrackFitter.h"
26 #include "DTrackTimeBased.h"
27 #include "DReferenceTrajectory.h"
28 
29 class DTrackWireBased;
30 class DTrackHitSelector;
31 class DParticleID;
32 
33 using namespace jana;
34 using namespace std;
35 
36 class DTrackTimeBased_factory:public jana::JFactory<DTrackTimeBased>{
37 
38  private:
39  jerror_t init(void); ///< Called once at program start.
40  jerror_t brun(jana::JEventLoop *loop, int32_t runnumber); ///< Called everytime a new run number is detected.
41  jerror_t evnt(jana::JEventLoop *loop, uint64_t eventnumber); ///< Called every event.
42  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
43  jerror_t fini(void); ///< Called after last event of last event source has been processed.
44 
45 
46 
51 
56 
57  // Optional debugging histograms
58  TH1F *fom_chi2_trk;
59  TH1F *fom;
60  TH1F *hitMatchFOM;
61  TH2F *chi2_trk_mom;
62  TH2F *Hstart_time;
63 
64  void FilterDuplicates(void);
65  double GetTruthMatchingFOM(int trackIndex,DTrackTimeBased *dtrack,vector<const DMCThrown*>mcthrowns);
66  int GetThrownIndex(vector<const DMCThrown*>& locMCThrowns, const DKinematicData *kd, double &f);
67 
68  void CreateStartTimeList(const DTrackWireBased *track,
69  vector<const DSCHit*>&sc_hits,
70  vector<const DTOFPoint*>&tof_points,
71  vector<const DBCALShower*>&bcal_showers,
72  vector<const DFCALShower*>&fcal_showers,
73  vector<DTrackTimeBased::DStartTime_t>&start_times);
74  bool DoFit(const DTrackWireBased *track,
75  vector<DTrackTimeBased::DStartTime_t>&start_times,
76  JEventLoop *loop,double mass);
77 
78  void AddMissingTrackHypothesis(vector<DTrackTimeBased*>&tracks_to_add,
79  const DTrackTimeBased *src_track,
80  double my_mass,double q,
81  JEventLoop *loop);
82  bool InsertMissingHypotheses(JEventLoop *loop);
83  void CorrectForELoss(DVector3 &position,DVector3 &momentum,double q,double my_mass);
84  void AddMissingTrackHypotheses(unsigned int mass_bits,
85  vector<DTrackTimeBased*>&tracks_to_add,
86  vector<DTrackTimeBased *>&hypotheses,
87  double q,bool flipped_charge,JEventLoop *loop);
88 
89  // Geometry
90  const DGeometry *geom;
91 
92 // double mPathLength,mEndTime,mStartTime,mFlightTime;
93  double mStartTime;
94 // DetectorSystem_t mDetector, mStartDetector;
96  int mNumHypPlus,mNumHypMinus;
97  bool dIsNoFieldFlag,INSERT_MISSING_HYPOTHESES;
98  bool USE_SC_TIME; // use start counter hits for t0
99  bool USE_FCAL_TIME; // use fcal hits for t0
100  bool USE_BCAL_TIME; // use bcal hits for t0
101  bool USE_TOF_TIME; // use tof hits for t0
102 // double SC_DPHI_CUT_WB;
103 
104  // start counter geometry
105 // double sc_light_guide_length_cor;
106 // double sc_angle_cor;
107  vector<DVector3>sc_pos;
108  vector<DVector3>sc_norm;
109 
110  int myevt;
111 };
112 
113 #endif // _DTrackTimeBased_factory_
114 
Definition: track.h:16
const DParticleID * pid_algorithm
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
DetectorSystem_t
Definition: GlueX.h:15
The DTrackHitSelector class is a base class for algorithms that will select hits from the drift chamb...
TF1 * f
Definition: FitGains.C:21