|
| 1 | +#ifndef Phase2L1Trigger_DTTrigger_MPThetaMatching_h |
| 2 | +#define Phase2L1Trigger_DTTrigger_MPThetaMatching_h |
| 3 | + |
| 4 | +#include "L1Trigger/DTTriggerPhase2/interface/MPFilter.h" |
| 5 | + |
| 6 | +#include <iostream> |
| 7 | +#include <fstream> |
| 8 | + |
| 9 | +// =============================================================================== |
| 10 | +// Previous definitions and declarations |
| 11 | +// =============================================================================== |
| 12 | + |
| 13 | +// =============================================================================== |
| 14 | +// Class declarations |
| 15 | +// =============================================================================== |
| 16 | + |
| 17 | +class MPThetaMatching : public MPFilter { |
| 18 | +public: |
| 19 | + // Constructors and destructor |
| 20 | + MPThetaMatching(const edm::ParameterSet &pset); |
| 21 | + ~MPThetaMatching() override; // = default; |
| 22 | + |
| 23 | + // Main methods |
| 24 | + void initialise(const edm::EventSetup &iEventSetup) override; |
| 25 | + void run(edm::Event &iEvent, |
| 26 | + const edm::EventSetup &iEventSetup, |
| 27 | + std::vector<cmsdt::metaPrimitive> &inMPaths, |
| 28 | + std::vector<cmsdt::metaPrimitive> &outMPaths) override; |
| 29 | + void run(edm::Event &iEvent, |
| 30 | + const edm::EventSetup &iEventSetup, |
| 31 | + std::vector<cmsdt::metaPrimitive> &allMPaths, |
| 32 | + std::vector<cmsdt::metaPrimitive> &inMPaths, |
| 33 | + std::vector<cmsdt::metaPrimitive> &outMPaths) override {}; |
| 34 | + void run(edm::Event &iEvent, |
| 35 | + const edm::EventSetup &iEventSetup, |
| 36 | + MuonPathPtrs &inMPath, |
| 37 | + MuonPathPtrs &outMPath) override {}; |
| 38 | + |
| 39 | + void finish() override; |
| 40 | + |
| 41 | + // Public attributes |
| 42 | + |
| 43 | +private: |
| 44 | + // Private methods |
| 45 | + std::vector<cmsdt::metaPrimitive> filter(std::vector<cmsdt::metaPrimitive> inMPs, double shift_back); |
| 46 | + |
| 47 | + bool isThereThetaMPInChamber(int sector, int wheel, int station, std::vector<cmsdt::metaPrimitive> thetaMPs); |
| 48 | + std::vector<cmsdt::metaPrimitive> getBestThetaMPInChamber(std::vector<cmsdt::metaPrimitive> thetaMPs); |
| 49 | + |
| 50 | + // Function to compare pairs based on the float value, ascending order |
| 51 | + static bool comparePairs(const std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float> &a, |
| 52 | + const std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float> &b) { |
| 53 | + return std::get<2>(a) < std::get<2>(b); |
| 54 | + }; |
| 55 | + void orderAndSave(std::vector<std::tuple<cmsdt::metaPrimitive, cmsdt::metaPrimitive, float>> deltaTimePosPhiCands, |
| 56 | + std::vector<cmsdt::metaPrimitive> *outMPaths, |
| 57 | + std::vector<cmsdt::metaPrimitive> *savedThetas); |
| 58 | + |
| 59 | + // Private attributes |
| 60 | + const bool debug_; |
| 61 | + int th_option_; |
| 62 | + int th_quality_; |
| 63 | + int scenario_; |
| 64 | +}; |
| 65 | + |
| 66 | +#endif |
0 commit comments