Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTOFPoint.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DTOFPoint.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_
9 #define _DTOFPoint_
10 
11 #include <JANA/JObject.h>
12 #include <JANA/JFactory.h>
13 #include <DVector3.h>
14 using namespace jana;
15 
16 class DTOFPoint : public JObject
17 {
18  public:
19  JOBJECT_PUBLIC(DTOFPoint);
20 
21  // DTOFPoint objects are created for DTOFPaddleHit matches between planes, AND for un-matched DTOFPaddleHits.
22 
23  // Note the hit position along a PADDLE is not well-defined if:
24  // It is single-ended, or if one of the ends has a hit energy that is below threshold
25 
26  // Sometimes, these partially-defined hits are not matched to hits in the other plane.
27  // In these cases, a DTOFPoint object is created from each hit, with the following properties:
28  //The hit position is reported at the center of the paddle
29  //The energy & hit are reported at this position
30  // The properties of these hits are fully-defined through matching to tracks (in the other direction)
31  // The corrected hit energy & time (propagated to the track location) are stored in DDetectorMatches
32 
33  DVector3 pos; //reconstructed position
34  float t; //reconstructed time
35  float dE; //reconstructed deposited energy
36  float tErr; //uncertainty on reconstructed time
37 
38  int dHorizontalBar; //0 for none (unmatched)
39  int dVerticalBar; //0 for none (unmatched)
40 
41  //Status: 0 if no hit (or none above threshold), 1 if only North hit above threshold, 2 if only South hit above threshold, 3 if both hits above threshold
42  //For horizontal, North/South is +x/-x
45 
46  bool Is_XPositionWellDefined(void) const
47  {
48  return ((dVerticalBar != 0) || (dHorizontalBarStatus == 3));
49  }
50  bool Is_YPositionWellDefined(void) const
51  {
52  return ((dHorizontalBar != 0) || (dVerticalBarStatus == 3));
53  }
54 
55  void toStrings(vector<pair<string,string> > &items) const
56  {
57  AddString(items, "H-Bar", "%d", dHorizontalBar);
58  AddString(items, "V-Bar", "%d", dVerticalBar);
59  AddString(items, "x", "%1.3f", pos.x());
60  AddString(items, "y", "%1.3f", pos.y());
61  AddString(items, "z", "%1.3f", pos.z());
62  AddString(items, "t", "%1.3f", t);
63  AddString(items, "dE", "%1.6f", dE);
64  AddString(items, "H-Status", "%d", dHorizontalBarStatus);
65  AddString(items, "V-Status", "%d", dVerticalBarStatus);
66  }
67 };
68 
69 #endif // _DTOFPoint_
70 
int dHorizontalBar
Definition: DTOFPoint.h:38
float dE
Definition: DTOFPoint.h:35
TVector3 DVector3
Definition: DVector3.h:14
void toStrings(vector< pair< string, string > > &items) const
Definition: DTOFPoint.h:55
int dHorizontalBarStatus
Definition: DTOFPoint.h:43
bool Is_XPositionWellDefined(void) const
Definition: DTOFPoint.h:46
DVector3 pos
Definition: DTOFPoint.h:33
int dVerticalBar
Definition: DTOFPoint.h:39
float t
Definition: DTOFPoint.h:34
float tErr
Definition: DTOFPoint.h:36
bool Is_YPositionWellDefined(void) const
Definition: DTOFPoint.h:50
int dVerticalBarStatus
Definition: DTOFPoint.h:44