CMS 3D CMS Logo

MuonPathFitter.h
Go to the documentation of this file.
1 #ifndef L1Trigger_DTTriggerPhase2_MuonPathFitter_h
2 #define L1Trigger_DTTriggerPhase2_MuonPathFitter_h
3 
6 
7 // ===============================================================================
8 // Previous definitions and declarations
9 // ===============================================================================
10 
11 using coeff_arr_t = std::vector<std::vector<int>>;
12 struct coeffs_t {
20 };
21 
22 struct SLhitP {
23  int ti; // unsigned(16 downto 0); -- 12 msb = bunch_ctr, 5 lsb = tdc counts, resolution 25/32 ns
24  int wi; // unsigned(6 downto 0); -- ~ 96 channels per layer
25  int ly; // unsigned(1 downto 0); -- 4 layers
26  int wp; // signed(WIREPOS_WIDTH-1 downto 0);
27 };
28 
30  // int valid; not needed, we will not propagate the mpath to the fitter
31  std::vector<SLhitP> hits;
32  std::vector<int> hits_valid; // slv(0 to 7)
33  std::vector<int> lateralities; // slv(0 to 7)
35  int coarse_bctr; // unsigned(11 downto 0)
36  int coarse_wirepos; // signed(WIDTH_FULL_POS-1 downto WIREPOS_NORM_LSB_IGNORED);
37 };
38 
40  int t0;
41  int slope;
42  int position;
43  int chi2;
44  int valid_fit;
45  fit_common_out_t() : t0(0), slope(0), position(0), chi2(0), valid_fit(0) {}
46 };
47 
48 // ===============================================================================
49 // Class declarations
50 // ===============================================================================
51 
53 public:
54  // Constructors and destructor
57  std::shared_ptr<GlobalCoordsObtainer> &globalcoordsobtainer);
58  ~MuonPathFitter() override;
59 
60  // Main methods
61 
62  // Other public methods
63  coeffs_t RomDataConvert(std::vector<int> slv,
64  short COEFF_WIDTH_T0,
65  short COEFF_WIDTH_POSITION,
66  short COEFF_WIDTH_SLOPE,
67  short LOLY,
68  short HILY);
69 
70  bool hasPosRF(int wh, int sec) { return wh > 0 || (wh == 0 && sec % 4 > 1); };
71  void setChi2Th(double chi2Th) { chi2Th_ = chi2Th; };
72  void setTanPhiTh(double tanPhiTh) { tanPhiTh_ = tanPhiTh; };
73 
74  // Public attributes
75  DTGeometry const *dtGeo_;
77 
78  //shift
80  std::map<int, float> shiftinfo_;
81 
82  // max drift velocity
84  int maxdriftinfo_[5][4][14];
85  int max_drift_tdc = -1;
86 
87  int get_rom_addr(MuonPathPtr &inMPath, latcomb lats);
88  fit_common_out_t fit(fit_common_in_t fit_common_in,
89  int XI_WIDTH,
90  int COEFF_WIDTH_T0,
91  int COEFF_WIDTH_POSITION,
92  int COEFF_WIDTH_SLOPE,
93  int PRECISSION_T0,
94  int PRECISSION_POSITION,
95  int PRECISSION_SLOPE,
96  int PROD_RESIZE_T0,
97  int PROD_RESIZE_POSITION,
98  int PROD_RESIZE_SLOPE,
99  int MAX_DRIFT_TDC,
100  int sl);
101 
102  double tanPhiTh_;
103  const bool debug_;
104  double chi2Th_;
105 
106  // global coordinates
107  std::shared_ptr<GlobalCoordsObtainer> globalcoordsobtainer_;
108 
109 private:
110  // Private methods
111 
112  // Private attributes
113 };
114 
115 #endif
void setChi2Th(double chi2Th)
int maxdriftinfo_[5][4][14]
std::vector< int > lateralities
std::vector< SLhitP > hits
edm::FileInPath maxdrift_filename_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
std::map< int, float > shiftinfo_
std::vector< short > latcomb
coeff_arr_t slope
bool hasPosRF(int wh, int sec)
void setTanPhiTh(double tanPhiTh)
MuonPathFitter(const edm::ParameterSet &pset, edm::ConsumesCollector &iC, std::shared_ptr< GlobalCoordsObtainer > &globalcoordsobtainer)
edm::FileInPath shift_filename_
std::vector< std::vector< int > > coeff_arr_t
std::shared_ptr< GlobalCoordsObtainer > globalcoordsobtainer_
coeffs_t RomDataConvert(std::vector< int > slv, short COEFF_WIDTH_T0, short COEFF_WIDTH_POSITION, short COEFF_WIDTH_SLOPE, short LOLY, short HILY)
constexpr int GENERIC_COEFF_WIDTH
Definition: constants.h:250
constexpr int N_COEFFS
Definition: constants.h:249
int get_rom_addr(MuonPathPtr &inMPath, latcomb lats)
coeff_arr_t t0
std::shared_ptr< MuonPath > MuonPathPtr
Definition: MuonPath.h:131
DTGeometry const * dtGeo_
~MuonPathFitter() override
coeff_arr_t position
const bool debug_
fit_common_out_t fit(fit_common_in_t fit_common_in, int XI_WIDTH, int COEFF_WIDTH_T0, int COEFF_WIDTH_POSITION, int COEFF_WIDTH_SLOPE, int PRECISSION_T0, int PRECISSION_POSITION, int PRECISSION_SLOPE, int PROD_RESIZE_T0, int PROD_RESIZE_POSITION, int PROD_RESIZE_SLOPE, int MAX_DRIFT_TDC, int sl)
std::vector< int > hits_valid