File indexing completed on 2024-04-06 12:26:09
0001 #ifndef DTSegment_DTSegmentUpdator_h
0002 #define DTSegment_DTSegmentUpdator_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include <vector>
0019
0020 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0021 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0022
0023 #include "FWCore/Framework/interface/ESHandle.h"
0024 #include "FWCore/Framework/interface/ConsumesCollector.h"
0025
0026 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0027
0028
0029
0030
0031 class DTSegmentCand;
0032 class DTRecSegment2D;
0033 class DTRecSegment4D;
0034 class DTLinearFit;
0035 class DTRecHitBaseAlgo;
0036 class DTChamberRecSegment2D;
0037 class DTGeometry;
0038 class MuonGeometryRecord;
0039
0040 namespace edm {
0041 class EventSetup;
0042 class ParameterSet;
0043 }
0044
0045
0046 class DTSegmentUpdator {
0047 public:
0048
0049 DTSegmentUpdator(const edm::ParameterSet& config, edm::ConsumesCollector);
0050
0051
0052 ~DTSegmentUpdator();
0053
0054
0055
0056
0057
0058 bool fit(DTSegmentCand* seg, bool allow3par, const bool fitdebug) const;
0059
0060
0061
0062
0063 void fit(DTRecSegment2D* seg, bool allow3par, bool block3par) const;
0064
0065
0066
0067
0068
0069 void fit(DTRecSegment4D* seg, bool allow3par) const;
0070
0071
0072 void update(DTRecSegment4D* seg, const bool calcT0, bool allow3par) const;
0073
0074
0075 void update(DTRecSegment2D* seg, bool allow3par) const;
0076
0077 void calculateT0corr(DTRecSegment2D* seg) const;
0078 void calculateT0corr(DTRecSegment4D* seg) const;
0079
0080
0081 void setES(const edm::EventSetup& setup);
0082
0083 protected:
0084 private:
0085 std::unique_ptr<DTLinearFit> theFitter;
0086 std::unique_ptr<DTRecHitBaseAlgo> theAlgo;
0087 edm::ESHandle<DTGeometry> theGeom;
0088 const edm::ESGetToken<DTGeometry, MuonGeometryRecord> theGeomToken;
0089
0090 void updateHits(DTRecSegment2D* seg, GlobalPoint& gpos, GlobalVector& gdir, const int step = 2) const;
0091
0092
0093 void rejectBadHits(DTChamberRecSegment2D*) const;
0094
0095
0096 void fit(const std::vector<float>& x,
0097 const std::vector<float>& y,
0098 const std::vector<int>& lfit,
0099 const std::vector<double>& dist,
0100 const std::vector<float>& sigy,
0101 LocalPoint& pos,
0102 LocalVector& dir,
0103 float& cminf,
0104 float& vminf,
0105 AlgebraicSymMatrix& covMat,
0106 double& chi2,
0107 const bool allow3par = false,
0108 const bool block3par = false) const;
0109
0110 double intime_cut;
0111 bool vdrift_4parfit;
0112 double T0_hit_resolution;
0113 bool perform_delta_rejecting;
0114 bool debug;
0115 };
0116
0117 #endif