CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SurveyPxbImageLocalFit.h
Go to the documentation of this file.
1 #ifndef GUARD_surveypxbimagelocalfit_h
2 #define GUARD_surveypxbimagelocalfit_h
3 
4 #include <sstream>
5 #include <vector>
6 #include <utility>
9 #include "Math/SMatrix.h"
10 #include "Math/SVector.h"
11 #include <iostream>
12 
15 {
16 public:
17  typedef std::vector<value_t> localpars_t;
18  typedef std::vector<coord_t> fidpoint_t;
19  typedef unsigned int count_t;
20  static const count_t nGlD = 3; // no of global derivs
21  static const count_t nLcD = 4; // no of local derivs
22  static const count_t nMsrmts = 8; // no of measurements per image
23  static const count_t nLcPars = 4; // no of local parameters
24  static const count_t nFidpoints = 4; // no of fiducial points
25  // Typedefs for pede
26  typedef int pede_label_t;
27  typedef float pede_deriv_t;
28 
29  // Constructors
32  {
33  initFidPoints();
34  };
35 
37  SurveyPxbImageLocalFit(std::istringstream &iss):
39  {
40  initFidPoints();
41  };
42 
44  void doFit(const fidpoint_t &fidpointvec);
45  void doFit(const fidpoint_t &fidpointvec, const pede_label_t &label1, const pede_label_t &label2);
46  void doFit(value_t x1, value_t y1, value_t g1, value_t x2, value_t y2, value_t g2);
47 
49  bool isFitValid() { return fitValidFlag_; };
50 
53 
55  value_t getChi2();
56 
64 
67 
68 private:
71 
73  ROOT::Math::SVector<value_t, nMsrmts> r;
74 
76  //std::vector<localDerivs_t> globalDerivsVec_;
77  ROOT::Math::SMatrix<pede_deriv_t,nMsrmts,nGlD> globalDerivsMatrix_;
78 
80  //std::vector<globalDerivs_t> localDerivsVec_;
81  ROOT::Math::SMatrix<pede_deriv_t,nMsrmts,nLcD> localDerivsMatrix_;
82 
84  std::vector<pede_label_t> labelVec1_, labelVec2_;
85 
87  std::vector<coord_t> fidpoints_;
88 
91 
94 
97 
100  {
101  fidpoints_[0] = coord_t(-0.91,-3.30);
102  fidpoints_[1] = coord_t(+0.91,-3.30);
103  fidpoints_[2] = coord_t(-0.91,+3.30);
104  fidpoints_[3] = coord_t(+0.91,+3.30);
105  }
106 
108  value_t dist(const coord_t& p1, const coord_t& p2)
109  {
110  value_t dx = p1.x()-p2.x();
111  value_t dy = p1.y()-p2.y();
112  return sqrt(dx*dx+dy*dy);
113  }
114 
115 };
116 
117 #endif
118 
int i
Definition: DBlmapReader.cc:9
bool isFitValid()
returns validity flag
std::vector< coord_t > fidpoint_t
static const count_t nLcPars
localpars_t getLocalParameters()
returns local parameters after fit
bool fitValidFlag_
Validity Flag.
const pede_deriv_t * getLocalDerivsPtr(count_t i)
T y() const
Definition: PV3DBase.h:63
std::vector< pede_label_t > labelVec2_
value_t sigma_x_
Gaussian errors.
localpars_t a_
Local parameters.
Class to hold one picture of the BPix survey and the local fit.
static const count_t nFidpoints
value_t getChi2()
returns the chi^2 of the fit
ROOT::Math::SVector< value_t, nMsrmts > r
Vector of residuals.
Point3DBase< value_t, LocalTag > coord_t
T sqrt(T t)
Definition: SSEVec.h:48
static const count_t nGlD
pede_deriv_t getSigma(count_t i)
ROOT::Math::SMatrix< pede_deriv_t, nMsrmts, nLcD > localDerivsMatrix_
Matrix with local derivs.
static const count_t nLcD
double p2[4]
Definition: TauolaWrapper.h:90
ROOT::Math::SMatrix< pede_deriv_t, nMsrmts, nGlD > globalDerivsMatrix_
Matrix with global derivs.
pede_deriv_t getResiduum(count_t i)
const pede_deriv_t * getGlobalDerivsPtr(count_t i)
SurveyPxbImageLocalFit(std::istringstream &iss)
Constructor from istringstream.
std::vector< pede_label_t > labelVec1_
Vector with labels to global derivs.
void doFit(const fidpoint_t &fidpointvec)
Invoke the fit.
Class to hold one picture of the BPix survey.
value_t chi2_
chi2 of the local fit
value_t dist(const coord_t &p1, const coord_t &p2)
Distance.
std::vector< value_t > localpars_t
std::vector< coord_t > fidpoints_
True position of the fiducial points on a sensor wrt. local frame (u,v)
double p1[4]
Definition: TauolaWrapper.h:89
void initFidPoints()
Initialise the fiducial points.
static const count_t nMsrmts
volatile std::atomic< bool > shutdown_flag false
const pede_label_t * getGlobalDerivsLabelPtr(count_t i)
T x() const
Definition: PV3DBase.h:62