Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DRiemannFit.h
Go to the documentation of this file.
1 #ifndef _DRIEMANN_FIT_H_
2 #define _DRIEMANN_FIT_H_
3 
4 #include <vector>
5 using namespace std;
6 
7 #include <DMatrix.h>
8 #include "JANA/jerror.h"
9 #include <DVector3.h>
10 
11 typedef struct{
12  double x,y,z; ///< point in lab coordinates
13  double covx,covy,covxy; ///< error info for x and y coordinates
15 
17  public:
19  CovR_=NULL;
20  CovRPhi_=NULL;
21  hits.clear();
22  projections.clear();
23  };
24 
26  if (CovR_!=NULL) delete CovR_;
27  if (CovRPhi_!=NULL) delete CovRPhi_;
28 
29  for (unsigned int i=0;i<hits.size();i++)
30  delete hits[i];
31  for (unsigned int i=0;i<projections.size();i++)
32  delete projections[i];
33  hits.clear();
34  projections.clear();
35  };
36 
37 
38  jerror_t FitCircle(double rc);
39  jerror_t FitCircle();
40  jerror_t FitLine();
41 
42  jerror_t AddHit(double r, double phi, double z);
43  jerror_t AddHitXYZ(double x,double y, double z);
44  jerror_t AddHit(double x,double y,double z,double covx,double covy,
45  double covxy);
46 
47  double GetCharge(double rc);
48  double GetCharge();
49  void GetPlaneParameters(double &c,DVector3 &n){
50  c=dist_to_origin;
51  n.SetXYZ(N[0],N[1],N[2]);
52  };
53  jerror_t DoFit(double rc);
54 
55  // Center of projected circle and radius
56  double xc,yc,rc;
57  // tangent of dip angle, vertex z position,z of reference plane
58  double tanl, zvertex, z0;
59  double var_tanl;
60  double p_trans;
61  double phi;
62  double q; // sign of charge
63 
64  protected:
65  jerror_t CalcNormal(DMatrix A,double lambda,DMatrix &N);
66 
67  private:
68  vector<DRiemannHit_t*>hits;
69  vector<DRiemannHit_t*>projections;
72 
73  // Cirlce fit parameters
74  double N[3];
75 // double varN[3][3];
77 // double xavg[3],var_avg;
78 };
79 
80 #endif //_DRIEMANN_FIT_H_
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
double z
point in lab coordinates
Definition: DRiemannFit.h:12
TMatrixD DMatrix
Definition: DMatrix.h:14
vector< DRiemannHit_t * > projections
Definition: DRiemannFit.h:69
double phi
Definition: DRiemannFit.h:61
TVector3 DVector3
Definition: DVector3.h:14
Double_t x[NCHANNELS]
Definition: st_tw_resols.C:39
#define c
#define y
vector< DRiemannHit_t * > hits
Definition: DRiemannFit.h:68
DMatrix * CovR_
Definition: DRiemannFit.h:70
double p_trans
Definition: DRiemannFit.h:60
DMatrix * CovRPhi_
Definition: DRiemannFit.h:71
double yc
Definition: DRiemannFit.h:56
double var_tanl
Definition: DRiemannFit.h:59
void GetPlaneParameters(double &c, DVector3 &n)
Definition: DRiemannFit.h:49
double q
Definition: DRiemannFit.h:62
double zvertex
Definition: DRiemannFit.h:58
double dist_to_origin
Definition: DRiemannFit.h:76