Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBCALCluster.h
Go to the documentation of this file.
1 #ifndef _DBCALCluster_
2 #define _DBCALCluster_
3 
4 /*
5  * DBCALCluster.h
6  *
7  * Created by Matthew Shepherd on 3/12/11.
8  *
9  */
10 
11 #include "BCAL/DBCALGeometry.h"
12 #include "BCAL/DBCALPoint.h"
13 
14 #include <JANA/JObject.h>
15 #include <JANA/JFactory.h>
16 
17 #include <vector>
18 
19 using namespace jana;
20 using namespace std;
21 
22 class DBCALCluster : public JObject {
23 
24 public:
25 
26  JOBJECT_PUBLIC( DBCALCluster );
27 
28  DBCALCluster(double z_target_center, const DBCALGeometry *locGeom);
29  DBCALCluster(const DBCALPoint* point, double z_target_center, double q, const DBCALGeometry *locGeom);
30 
31  vector< const DBCALPoint* > points() const { return m_points; }
32  // Returns a vector of the single-ended hits used in the cluster.
33  // This returns a pair because we need to store the attenuated-corrected energy
34  // and the DBCALUnifiedHit cannot hold this information.
35  vector< pair<const DBCALUnifiedHit*,double> > hits() const { return m_single_ended_hits; }
36 
37  int nCells() const { return m_points.size(); }
38 
39  // the total energy in the cluster
40 
41  float E() const { return m_E; }
42  float E_preshower() const { return m_E_preshower; }
43  float E_L2() const { return m_E_L2; }
44  float E_L3() const { return m_E_L3; }
45  float E_L4() const { return m_E_L4; }
46 
47  // this is the time at the inner radius of BCAL assuming shower
48  // particles propagte into module at the speed of light
49  float t() const { return m_t; }
50  float sigT() const { return m_sig_t; }
51  float rmsTime() const { return m_t_rms; }
52 
53  // assuming a photon leaving the target, this the estimate of t0
54  // (could be helpful for photon/pion discrimination)
55  float t0() const;
56 
57  // location of cluster in spherical coordinates with the origin
58  // at the center of the target -- WARNING: errors are not rigorously derived!
59  float rho() const { return m_rho; }
60  float sigRho() const { return m_sig_rho; }
61 
62  float theta() const { return m_theta; }
63  float sigTheta() const { return m_sig_theta; }
64 
65  float phi() const { return m_phi; }
66  float sigPhi() const { return m_sig_phi; }
67 
68  int Q() const { return charge; }
69 
70  // these functions modify the cluster
71  void addPoint( const DBCALPoint* point , int q );
72  void addHit ( const DBCALUnifiedHit* hit, double hit_E_unattenuated );
73  void mergeClust( const DBCALCluster& clust, double point_reatten_E );
74  void removePoint( const DBCALPoint* point );
75 
76  // this prints out info
77  void toStrings( vector< pair < string, string > > &items ) const;
78 
79 private:
80 
81  void makeFromPoints();
82  void clear();
83 
84  vector< const DBCALPoint* > m_points;
85  vector< const DBCALPoint* > m_points_remove;
86  vector< pair<const DBCALUnifiedHit*,double> > m_single_ended_hits; //Store single-ended hits together with their unattenuated energies
87 
88  float m_hit_E_unattenuated_sum; //attenuation-corrected sum of energies from single-ended hits
90  float m_E_points;
91  float m_E;
92  float m_E_preshower;
93  float m_E_L2;
94  float m_E_L3;
95  float m_E_L4;
96 
97  float m_t;
98  float m_sig_t;
99  float m_t_rms;
100 
101  float m_rho;
102  float m_sig_rho;
103  float m_theta;
104  float m_sig_theta;
105  float m_phi;
106  float m_sig_phi;
107 
110  int charge;
112 
113 };
114 
115 #endif
vector< const DBCALPoint * > m_points
Definition: DBCALCluster.h:84
float rho() const
Definition: DBCALCluster.h:59
float rmsTime() const
Definition: DBCALCluster.h:51
const DBCALGeometry * m_BCALGeom
Definition: DBCALCluster.h:111
float t() const
Definition: DBCALCluster.h:49
int Q() const
Definition: DBCALCluster.h:68
vector< pair< const DBCALUnifiedHit *, double > > m_single_ended_hits
Definition: DBCALCluster.h:86
float sigT() const
Definition: DBCALCluster.h:50
float m_point_reatten_E_sum
Definition: DBCALCluster.h:89
float sigPhi() const
Definition: DBCALCluster.h:66
float sigTheta() const
Definition: DBCALCluster.h:63
vector< pair< const DBCALUnifiedHit *, double > > hits() const
Definition: DBCALCluster.h:35
float m_z_target_center
Definition: DBCALCluster.h:108
float m_sig_theta
Definition: DBCALCluster.h:104
float E_L3() const
Definition: DBCALCluster.h:44
float E_L4() const
Definition: DBCALCluster.h:45
vector< const DBCALPoint * > points() const
Definition: DBCALCluster.h:31
float m_E_points
Definition: DBCALCluster.h:90
float phi() const
Definition: DBCALCluster.h:65
float sigRho() const
Definition: DBCALCluster.h:60
float theta() const
Definition: DBCALCluster.h:62
float E_preshower() const
Definition: DBCALCluster.h:42
float m_hit_E_unattenuated_sum
Definition: DBCALCluster.h:88
int nCells() const
Definition: DBCALCluster.h:37
float E_L2() const
Definition: DBCALCluster.h:43
float m_E_preshower
Definition: DBCALCluster.h:92
vector< const DBCALPoint * > m_points_remove
Definition: DBCALCluster.h:85
float E() const
Definition: DBCALCluster.h:41