Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTOFPoint_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DTOFPoint_factory.h
4 // Created: Tue Oct 18 09:50:52 EST 2005
5 // Creator: remitche (on Linux mantrid00 2.4.20-18.8smp i686)
6 //
7 
8 #ifndef _DTOFPoint_factory_
9 #define _DTOFPoint_factory_
10 
11 #include "JANA/JFactory.h"
12 #include "DTOFGeometry_factory.h"
13 #include "DTOFPoint.h"
14 #include "DTOFPaddleHit.h"
15 #include <deque>
16 
17 /// \htmlonly
18 /// <A href="index.html#legend">
19 /// <IMG src="CORE.png" width="100">
20 /// </A>
21 /// \endhtmlonly
22 
23 /// 2-plane (4-fold) TOF coincidences. The 2-hit coincidences come from DTOFPaddleHit objects
24 /// which are combined into coincidnces between the two planes to form 4-D space points
25 /// which are represented by DTOFPoint objects.
26 
27 using namespace std;
28 
29 class DTOFPoint_factory : public JFactory<DTOFPoint>
30 {
31  public:
32 
33  double HALFPADDLE;
35  double E_THRESHOLD;
36  double ATTEN_LENGTH;
37  double ONESIDED_PADDLE_MIDPOINT_MAG; //+/- this number for North/South
38 
39  int NUM_BARS;
40 
42 
44  {
45  public:
46  double x;
47  double y;
48  double t;
49  double pos_cut; //x_cut for horizontal bars, y_cut for vertical bars
50  double t_cut;
54  bool dIsSingleEndedNorthPaddle; //if !this and !dIsDoubleEndedBar, is single-ended south paddle
55  };
56 
58  {
59  public:
60  double delta_r;
61  double delta_t;
65  };
66 
67  tof_spacetimehit_t* Build_TOFSpacetimeHit_Horizontal(const DTOFPaddleHit* locTOFHit);
68  tof_spacetimehit_t* Build_TOFSpacetimeHit_Vertical(const DTOFPaddleHit* locTOFHit);
69 
70  private:
71  jerror_t brun(JEventLoop *loop, int32_t runnumber);
72  jerror_t evnt(JEventLoop *loop, uint64_t eventnumber);
73  jerror_t fini(void);
74 
75  tof_spacetimehit_t* Get_TOFSpacetimeHitResource(void);
76 
77  bool Match_Hits(tof_spacetimehit_t* locTOFSpacetimeHit_Horizontal, tof_spacetimehit_t* locTOFSpacetimeHit_Vertical, tof_spacetimehitmatch_t& locTOFSpacetimeHitMatch);
78 
79  void Create_MatchedTOFPoint(const tof_spacetimehit_t* locTOFSpacetimeHit_Horizontal, const tof_spacetimehit_t* locTOFSpacetimeHit_Vertical);
80  void Create_UnMatchedTOFPoint(const tof_spacetimehit_t* locTOFSpacetimeHit);
81 
85 
87  deque<tof_spacetimehit_t*> dTOFSpacetimeHitPool_All;
88  deque<tof_spacetimehit_t*> dTOFSpacetimeHitPool_Available;
89 
90  // calibration tables
91  vector<double> propagation_speed;
92  vector<double> paddle_resolutions;
93 
94 };
95 
96 #endif // _DTOFPoint_factory_
97 
vector< double > paddle_resolutions
size_t MAX_TOFSpacetimeHitPoolSize
float dTimeMatchCut_PositionWellDefined
float dTimeMatchCut_PositionNotWellDefined
double ONESIDED_PADDLE_MIDPOINT_MAG
deque< tof_spacetimehit_t * > dTOFSpacetimeHitPool_All
float dPositionMatchCut_DoubleEnded
deque< tof_spacetimehit_t * > dTOFSpacetimeHitPool_Available
vector< double > propagation_speed
const DTOFGeometry * dTOFGeometry