Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBCALPoint.h
Go to the documentation of this file.
1 #ifndef _DBCALPoint_
2 #define _DBCALPoint_
3 
4 /*
5  * DBCALPoint.h
6  *
7  * Created by Matthew Shepherd on 3/13/11.
8  *
9  */
10 
11 #include "BCAL/DBCALHit.h"
12 #include "BCAL/DBCALUnifiedHit.h"
13 #include "BCAL/DBCALGeometry.h"
14 
15 #include <JANA/JObject.h>
16 #include <JANA/JFactory.h>
17 
18 using namespace jana;
19 
20 /**
21  This object gives a z position to BCAL hits using timing information.
22  The z position is relative to the target center because higher objects use
23  the position of hits relative to the target in spherical coordinates.
24 
25 */
26 
27 class DBCALPoint : public JObject {
28 
29 public:
30 
31  JOBJECT_PUBLIC(DBCALPoint);
32 
33  // this constructor uses two hits to obtain a local z position
34  DBCALPoint(const DBCALUnifiedHit& hit1, const DBCALUnifiedHit& hit2, double z_target_center,
35  double attenutation_length, double c_effective, double track_p0, double track_p1, double track_p2,
36  const DBCALGeometry *locGeom);
37 
38  float E() const { return m_E; }
39  float E_US() const { return m_E_US; } ///< Return the attenuation corrected Energy of US Hit
40  float E_DS() const { return m_E_DS; } ///< Return the attenuation corrected Energy of DS Hit
41  float t() const { return m_t; }
42  float t_US() const { return m_t_US; } ///< Return the time of US Hit
43  float t_DS() const { return m_t_DS; } ///< Return the time of DS Hit
44 
45  // assuming a photon, this gives time at the inner radius of BCAL
46  // by extrapolating back on path from center of cell to target
47  float tInnerRadius() const;
48 
49  // spherical coordinates, origin at the center of the target
50  float rho() const { return m_rho; }
51  float sigRho() const { return m_sig_rho; }
52 
53  float theta() const { return m_theta; }
54  float sigTheta() const { return m_sig_theta; }
55 
56  float phi() const { return m_phi; }
57  float sigPhi() const { return m_sig_phi; }
58 
59  // cylindrical coordinates, origin at the center of the target
60  float z() const { return m_z; }
61  float sigZ() const { return m_sig_z; }
62  float r() const { return m_r; }
63 
64  int module() const {return m_module;}
65  int layer() const {return m_layer;}
66  int sector() const {return m_sector;}
67 
68  // these rotate point in phi by 2 pi -- effectively leaves point unchanged
69  void add2Pi() const;
70  void sub2Pi() const;
71 
72  void toStrings(vector<pair<string,string> > &items) const {
73  AddString(items, "E(GeV)", "%5.3f", m_E);
74  AddString(items, "t(ns)", "%5.1f", m_t);
75  AddString(items, "z(cm)", "%5.1f", m_z);
76  AddString(items, "r(cm)", "%5.1f", m_r);
77  AddString(items, "phi", "%5.3f", m_phi);
78  AddString(items, "module", "%i", m_module);
79  AddString(items, "layer", "%i", m_layer);
80  AddString(items, "sector", "%i", m_sector);
81 
82  }
83 
84 private:
85 
86  void convertCylindricalToSpherical();
87 
88  float m_E; ///< Energy of the Point used in higher objects
89  float m_E_US; ///< Attenuation corrected Energy of US Hit that contributed to the Point
90  float m_E_DS; ///< Attenuation corrected Energy of DS Hit that contributed to the Point
91  float m_t; ///< Arrival time
92  float m_t_US; ///< Time of DS Hit that contributed to the Point
93  float m_t_DS; ///< Time of DS Hit that contributed to the Point
94 
95  int m_module, m_layer, m_sector;
96 
97  // cylindrical coordinate locations
98  float m_zGlobal; ///< z-coordinate relative to the beginning of the BCAL
99  float m_zLocal; ///< z-coordinate relative to the center of BCAL
100  float m_z, m_sig_z; ///< z-coordinate relative to the center of the target
101  float m_r, m_sig_r; ///< distance from beam axis
102  float m_phi, m_sig_phi; ///< azimuthal angle
103 
104  // spherical coordinate locations
105  float m_rho, m_sig_rho; ///< spherical distance wrt target center
106  float m_theta, m_sig_theta; ///< polar angle wrt target center
107 
109 
110 };
111 
112 
113 #endif
float m_z
Definition: DBCALPoint.h:100
float rho() const
Definition: DBCALPoint.h:50
int module() const
Definition: DBCALPoint.h:64
float m_sig_r
distance from beam axis
Definition: DBCALPoint.h:101
float m_t
Arrival time.
Definition: DBCALPoint.h:91
float phi() const
Definition: DBCALPoint.h:56
int sector() const
Definition: DBCALPoint.h:66
float m_E
Energy of the Point used in higher objects.
Definition: DBCALPoint.h:88
float m_theta
Definition: DBCALPoint.h:106
float sigPhi() const
Definition: DBCALPoint.h:57
int layer() const
Definition: DBCALPoint.h:65
float m_sig_rho
spherical distance wrt target center
Definition: DBCALPoint.h:105
float sigRho() const
Definition: DBCALPoint.h:51
float m_zLocal
z-coordinate relative to the center of BCAL
Definition: DBCALPoint.h:99
float m_zGlobal
z-coordinate relative to the beginning of the BCAL
Definition: DBCALPoint.h:98
float m_E_DS
Attenuation corrected Energy of DS Hit that contributed to the Point.
Definition: DBCALPoint.h:90
float theta() const
Definition: DBCALPoint.h:53
float E() const
Definition: DBCALPoint.h:38
float t_US() const
Return the time of US Hit.
Definition: DBCALPoint.h:42
float z() const
Definition: DBCALPoint.h:60
float m_t_US
Time of DS Hit that contributed to the Point.
Definition: DBCALPoint.h:92
float m_sig_phi
azimuthal angle
Definition: DBCALPoint.h:102
void toStrings(vector< pair< string, string > > &items) const
Definition: DBCALPoint.h:72
int m_sector
Definition: DBCALPoint.h:95
float sigZ() const
Definition: DBCALPoint.h:61
float E_DS() const
Return the attenuation corrected Energy of DS Hit.
Definition: DBCALPoint.h:40
const DBCALGeometry * m_BCALGeom
Definition: DBCALPoint.h:108
float t() const
Definition: DBCALPoint.h:41
float r() const
Definition: DBCALPoint.h:62
float m_t_DS
Time of DS Hit that contributed to the Point.
Definition: DBCALPoint.h:93
float E_US() const
Return the attenuation corrected Energy of US Hit.
Definition: DBCALPoint.h:39
float m_E_US
Attenuation corrected Energy of US Hit that contributed to the Point.
Definition: DBCALPoint.h:89
float sigTheta() const
Definition: DBCALPoint.h:54
float t_DS() const
Return the time of DS Hit.
Definition: DBCALPoint.h:43