Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-12 01:51:33

0001 #ifndef L1Trigger_DTTriggerPhase2_MuonPathAnalyticAnalyzer_h
0002 #define L1Trigger_DTTriggerPhase2_MuonPathAnalyticAnalyzer_h
0003 
0004 #include "L1Trigger/DTTriggerPhase2/interface/MuonPathAnalyzer.h"
0005 
0006 // ===============================================================================
0007 // Previous definitions and declarations
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 // Class declarations
0040 // ===============================================================================
0041 
0042 class MuonPathAnalyticAnalyzer : public MuonPathAnalyzer {
0043 public:
0044   // Constructors and destructor
0045   MuonPathAnalyticAnalyzer(const edm::ParameterSet &pset,
0046                            edm::ConsumesCollector &iC,
0047                            std::shared_ptr<GlobalCoordsObtainer> &globalcoordsobtainer);
0048   ~MuonPathAnalyticAnalyzer() override;
0049 
0050   // Main methods
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            MuonPathPtrs &outMPath) override{};
0060 
0061   void finish() override;
0062 
0063   // Other public methods
0064 
0065   bool hasPosRF(int wh, int sec) { return wh > 0 || (wh == 0 && sec % 4 > 1); };
0066 
0067   // Public attributes
0068   DTGeometry const *dtGeo_;
0069   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH;
0070 
0071   //shift
0072   edm::FileInPath shift_filename_;
0073   std::map<int, float> shiftinfo_;
0074 
0075   //shift theta
0076   edm::FileInPath shift_theta_filename_;
0077   std::map<int, float> shiftthetainfo_;
0078 
0079   int chosen_sl_;
0080 
0081 private:
0082   // Private methods
0083   void analyze(MuonPathPtr &inMPath, std::vector<cmsdt::metaPrimitive> &metaPrimitives);
0084   void fillLAYOUT_VALID_TO_LATCOMB_CONSTS_ENCODER();
0085   void segment_fitter(DTSuperLayerId MuonPathSLId,
0086                       int wires[4],
0087                       int t0s[4],
0088                       int valid[4],
0089                       int reduced_times[4],
0090                       int cell_horiz_layout[4],
0091                       LATCOMB_CONSTANTS latcomb_consts,
0092                       int xwire_mm[4],
0093                       int coarse_pos,
0094                       int coarse_offset,
0095                       std::vector<cmsdt::metaPrimitive> &metaPrimitives);
0096   int compute_parameter(MAGNITUDE constants, int t0s[4], int DIV_SHR_BITS, int INCREASED_RES);
0097   std::vector<int> getLateralityCombination(int latcomb);
0098 
0099   // Private attributes
0100 
0101   const bool debug_;
0102   double chi2Th_;
0103   double tanPhiTh_;
0104   double tanPhiThw2max_;
0105   double tanPhiThw2min_;
0106   double tanPhiThw1max_;
0107   double tanPhiThw1min_;
0108   double tanPhiThw0_;
0109   int cellLayout_[cmsdt::NUM_LAYERS];
0110   std::vector<CELL_VALID_LAYOUT_CONSTANTS> LAYOUT_VALID_TO_LATCOMB_CONSTS_ENCODER;
0111 
0112   // global coordinates
0113   std::shared_ptr<GlobalCoordsObtainer> globalcoordsobtainer_;
0114 };
0115 
0116 #endif