Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-04-15 22:41:36

0001 #ifndef Phase2L1Trigger_DTTrigger_MPThetaMatching_h
0002 #define Phase2L1Trigger_DTTrigger_MPThetaMatching_h
0003 
0004 #include "L1Trigger/DTTriggerPhase2/interface/MPFilter.h"
0005 
0006 #include <iostream>
0007 #include <fstream>
0008 
0009 // ===============================================================================
0010 // Previous definitions and declarations
0011 // ===============================================================================
0012 
0013 // ===============================================================================
0014 // Class declarations
0015 // ===============================================================================
0016 
0017 class MPThetaMatching : public MPFilter {
0018 public:
0019   // Constructors and destructor
0020   MPThetaMatching(const edm::ParameterSet &pset);
0021   ~MPThetaMatching() override;  // = default;
0022 
0023   // Main methods
0024   void initialise(const edm::EventSetup &iEventSetup) override;
0025   void run(edm::Event &iEvent,
0026            const edm::EventSetup &iEventSetup,
0027            std::vector<cmsdt::metaPrimitive> &inMPaths,
0028            std::vector<cmsdt::metaPrimitive> &outMPaths) override;
0029   void run(edm::Event &iEvent,
0030            const edm::EventSetup &iEventSetup,
0031            std::vector<cmsdt::metaPrimitive> &allMPaths,
0032            std::vector<cmsdt::metaPrimitive> &inMPaths,
0033            std::vector<cmsdt::metaPrimitive> &outMPaths) override {};
0034   void run(edm::Event &iEvent,
0035            const edm::EventSetup &iEventSetup,
0036            MuonPathPtrs &inMPath,
0037            MuonPathPtrs &outMPath) override {};
0038 
0039   void finish() override;
0040 
0041   // Public attributes
0042 
0043 private:
0044   // Private methods
0045   std::vector<cmsdt::metaPrimitive> filter(std::vector<cmsdt::metaPrimitive> inMPs, double shift_back);
0046 
0047   bool isThereThetaMPInChamber(int sector, int wheel, int station, std::vector<cmsdt::metaPrimitive> thetaMPs);
0048   std::vector<cmsdt::metaPrimitive> getBestThetaMPInChamber(std::vector<cmsdt::metaPrimitive> thetaMPs);
0049 
0050   // Function to compare pairs based on the float value, ascending order
0051   static bool comparePairs(const std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float> &a,
0052                            const std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float> &b) {
0053     return std::get<2>(a) < std::get<2>(b);
0054   };
0055   void orderAndSave(std::vector<std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float>> deltaTimePosPhiCands,
0056                     std::vector<cmsdt::metaPrimitive> *outMPaths,
0057                     std::vector<cmsdt::metaPrimitive> *savedThetas);
0058 
0059   // Private attributes
0060   const bool debug_;
0061   int th_option_;
0062   int th_quality_;
0063   int scenario_;
0064 };
0065 
0066 #endif