00001 #ifndef DTSegment_DTSegmentUpdator_h
00002 #define DTSegment_DTSegmentUpdator_h
00003
00018
00019 #include <vector>
00020 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00021 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00022 #include "FWCore/Framework/interface/ESHandle.h"
00023 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
00024
00025
00026
00027 class DTSegmentCand;
00028 class DTRecSegment2D;
00029 class DTRecSegment4D;
00030 class DTLinearFit;
00031 class DTRecHitBaseAlgo;
00032
00033 namespace edm{class EventSetup; class ParameterSet;}
00034
00035
00036 class DTSegmentUpdator{
00037
00038 public:
00039
00041 DTSegmentUpdator(const edm::ParameterSet& config) ;
00042
00044 ~DTSegmentUpdator() ;
00045
00046
00047
00050 bool fit(DTSegmentCand* seg);
00051
00055 void fit(DTRecSegment2D* seg);
00056
00061 void fit(DTRecSegment4D* seg);
00062
00064 void fitT0(DTRecSegment2D* seg);
00065
00067 void update(DTRecSegment4D* seg);
00068
00070 void update(DTRecSegment2D* seg);
00071
00073 void setES(const edm::EventSetup& setup);
00074
00075 protected:
00076
00077 private:
00078 DTLinearFit* theFitter;
00079 DTRecHitBaseAlgo* theAlgo;
00080 edm::ESHandle<DTGeometry> theGeom;
00081
00082 private:
00083
00084 void updateHits(DTRecSegment2D* seg);
00085
00086 void updateHits(DTRecSegment2D* seg,
00087 GlobalPoint &gpos,
00088 GlobalVector &gdir,
00089 int step=2);
00090
00092 void fit(const std::vector<float>& x,
00093 const std::vector<float>& y,
00094 const std::vector<float>& sigy,
00095 LocalPoint& pos,
00096 LocalVector& dir,
00097 AlgebraicSymMatrix& covMat,
00098 double& chi2);
00099
00100
00101 void updateHitsN(DTRecSegment2D* seg,
00102 double &vminf,float &cminf );
00103
00104 void updateHitsN(DTRecSegment2D* seg,
00105 double &vminf,float &cminf,
00106 GlobalPoint &gpos,
00107 GlobalVector &gdir,
00108 int step=2);
00109 bool fitT0_seg(DTSegmentCand* seg);
00110
00111 void fitT0_seg(DTRecSegment2D* seg,float& t0_cor , double& vminf ,float& cminf);
00112
00113 void fitT0_seg(DTRecSegment4D* seg);
00114
00116 void fitT0(
00117 const std::vector<float>& xfit,
00118 const std::vector<float>& yfit,
00119 const std::vector<float>& sigy,
00120 const std::vector<int>& lfit,
00121 int& nptfit,
00122 int& nppar,
00123 LocalPoint& pos,
00124 LocalVector& dir,
00125 float& aminf,
00126 float& bminf,
00127 float& cminf,
00128 double& chi2fit);
00129
00130
00131
00132 void Fit4Var(
00133 const std::vector<float>& xfit,
00134 const std::vector<float>& yfit,
00135 const std::vector<float>& sigy,
00136 const std::vector<int>& lfit,
00137 const std::vector<double>& tfit,
00138 int& nptfit,
00139 int& nppar,
00140 float& aminf,
00141 float& bminf,
00142 float& cminf,
00143 double& vminf,
00144 double& chi2fit,
00145 bool debug);
00146
00147 bool T0_fit_flag;
00148 bool vdrift_4parfit;
00149 double T0_hit_resolution;
00150 bool T0_seg_debug;
00151
00152 };
00153 #endif // DTSegment_DTSegmentUpdator_h