File indexing completed on 2024-09-07 04:36:45
0001 #ifndef L1Trigger_DTTriggerPhase2_MuonPathAnalyticAnalyzer_h
0002 #define L1Trigger_DTTriggerPhase2_MuonPathAnalyticAnalyzer_h
0003
0004 #include "L1Trigger/DTTriggerPhase2/interface/MuonPathAnalyzer.h"
0005
0006
0007
0008
0009
0010 struct MAGNITUDE {
0011 int add;
0012 int coeff[4];
0013 int mult;
0014 };
0015
0016 struct CONSTANTS {
0017 MAGNITUDE pos;
0018 MAGNITUDE slope;
0019 MAGNITUDE slope_xhh;
0020 MAGNITUDE t0;
0021 };
0022
0023 struct LATCOMB_CONSTANTS {
0024 int latcomb;
0025 CONSTANTS constants;
0026 };
0027
0028 struct CELL_VALID_LAYOUT {
0029 int cell_horiz_layout[4];
0030 int valid[4];
0031 };
0032
0033 struct CELL_VALID_LAYOUT_CONSTANTS {
0034 CELL_VALID_LAYOUT cell_valid_layout;
0035 LATCOMB_CONSTANTS latcomb_constants[6];
0036 };
0037
0038
0039
0040
0041
0042 class MuonPathAnalyticAnalyzer : public MuonPathAnalyzer {
0043 public:
0044
0045 MuonPathAnalyticAnalyzer(const edm::ParameterSet &pset,
0046 edm::ConsumesCollector &iC,
0047 std::shared_ptr<GlobalCoordsObtainer> &globalcoordsobtainer);
0048 ~MuonPathAnalyticAnalyzer() override;
0049
0050
0051 void initialise(const edm::EventSetup &iEventSetup) override;
0052 void run(edm::Event &iEvent,
0053 const edm::EventSetup &iEventSetup,
0054 MuonPathPtrs &inMpath,
0055 std::vector<cmsdt::metaPrimitive> &metaPrimitives) override;
0056 void run(edm::Event &iEvent,
0057 const edm::EventSetup &iEventSetup,
0058 MuonPathPtrs &inMpath,
0059 std::vector<lat_vector> &lateralities,
0060 std::vector<cmsdt::metaPrimitive> &metaPrimitives) override {};
0061 void run(edm::Event &iEvent,
0062 const edm::EventSetup &iEventSetup,
0063 std::vector<cmsdt::metaPrimitive> &inMPaths,
0064 std::vector<cmsdt::metaPrimitive> &outMPaths) override {};
0065 void run(edm::Event &iEvent,
0066 const edm::EventSetup &iEventSetup,
0067 MuonPathPtrs &inMpath,
0068 MuonPathPtrs &outMPath) override {};
0069
0070 void finish() override;
0071
0072
0073
0074 bool hasPosRF(int wh, int sec) { return wh > 0 || (wh == 0 && sec % 4 > 1); };
0075
0076
0077 DTGeometry const *dtGeo_;
0078 edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH;
0079
0080
0081 edm::FileInPath shift_filename_;
0082 std::map<int, float> shiftinfo_;
0083
0084
0085 edm::FileInPath shift_theta_filename_;
0086 std::map<int, float> shiftthetainfo_;
0087
0088 int chosen_sl_;
0089
0090 private:
0091
0092 void analyze(MuonPathPtr &inMPath, std::vector<cmsdt::metaPrimitive> &metaPrimitives);
0093 void fillLAYOUT_VALID_TO_LATCOMB_CONSTS_ENCODER();
0094 void segment_fitter(DTSuperLayerId MuonPathSLId,
0095 int wires[4],
0096 int t0s[4],
0097 int valid[4],
0098 int reduced_times[4],
0099 int cell_horiz_layout[4],
0100 LATCOMB_CONSTANTS latcomb_consts,
0101 int xwire_mm[4],
0102 int coarse_pos,
0103 int coarse_offset,
0104 std::vector<cmsdt::metaPrimitive> &metaPrimitives);
0105 int compute_parameter(MAGNITUDE constants, int t0s[4], int DIV_SHR_BITS, int INCREASED_RES);
0106 std::vector<int> getLateralityCombination(int latcomb);
0107
0108
0109
0110 const bool debug_;
0111 double chi2Th_;
0112 double tanPhiTh_;
0113 double tanPhiThw2max_;
0114 double tanPhiThw2min_;
0115 double tanPhiThw1max_;
0116 double tanPhiThw1min_;
0117 double tanPhiThw0_;
0118 int cellLayout_[cmsdt::NUM_LAYERS];
0119 std::vector<CELL_VALID_LAYOUT_CONSTANTS> LAYOUT_VALID_TO_LATCOMB_CONSTS_ENCODER;
0120
0121
0122 std::shared_ptr<GlobalCoordsObtainer> globalcoordsobtainer_;
0123 };
0124
0125 #endif