File indexing completed on 2024-04-06 12:21:06
0001 #ifndef L1T_OmtfP1_OMTFProcessor_H
0002 #define L1T_OmtfP1_OMTFProcessor_H
0003
0004 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"
0005 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPattern.h"
0006 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternResult.h"
0007 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IGhostBuster.h"
0008 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IProcessorEmulator.h"
0009 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFConfiguration.h"
0010 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFinputMaker.h"
0011 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/ProcessorBase.h"
0012 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/SorterBase.h"
0013
0014 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/PtAssignmentBase.h"
0015
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018
0019 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0020 #include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
0021
0022 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
0023 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
0024 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
0025 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
0026
0027 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPattern.h"
0028
0029 #include <memory>
0030 #include <map>
0031
0032 class OMTFinput;
0033
0034 namespace edm {
0035 class ParameterSet;
0036 };
0037
0038 template <class GoldenPatternType>
0039 class OMTFProcessor : public ProcessorBase<GoldenPatternType>, public IProcessorEmulator {
0040 public:
0041 OMTFProcessor(OMTFConfiguration* omtfConfig,
0042 const edm::ParameterSet& edmCfg,
0043 edm::EventSetup const& evSetup,
0044 const L1TMuonOverlapParams* omtfPatterns);
0045
0046 OMTFProcessor(OMTFConfiguration* omtfConfig,
0047 const edm::ParameterSet& edmCfg,
0048 edm::EventSetup const& evSetup,
0049 GoldenPatternVec<GoldenPatternType>&& gps);
0050
0051 ~OMTFProcessor() override;
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 int extrapolateDtPhiBFloatPoint(const int& refLogicLayer,
0062 const int& refPhi,
0063 const int& refPhiB,
0064 unsigned int targetLayer,
0065 const int& targetStubPhi,
0066 const int& targetStubQuality,
0067 const int& targetStubEta,
0068 const int& targetStubR,
0069 const OMTFConfiguration* omtfConfig);
0070
0071
0072 int extrapolateDtPhiBFixedPoint(const int& refLogicLayer,
0073 const int& refPhi,
0074 const int& refPhiB,
0075 unsigned int targetLayer,
0076 const int& targetStubPhi,
0077 const int& targetStubQuality,
0078 const int& targetStubEta,
0079 const int& targetStubR,
0080 const OMTFConfiguration* omtfConfig);
0081
0082 int extrapolateDtPhiB(const MuonStubPtr& refStub,
0083 const MuonStubPtr& targetStub,
0084 unsigned int targetLayer,
0085 const OMTFConfiguration* omtfConfig);
0086
0087
0088
0089 void processInput(unsigned int iProcessor,
0090 l1t::tftype mtfType,
0091 const OMTFinput& aInput,
0092 std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers) override;
0093
0094 AlgoMuons sortResults(unsigned int iProcessor, l1t::tftype mtfType, int charge = 0) override;
0095
0096 AlgoMuons ghostBust(AlgoMuons refHitCands, int charge = 0) override {
0097 return ghostBuster->select(refHitCands, charge);
0098 }
0099
0100
0101 std::vector<l1t::RegionalMuonCand> getFinalcandidates(unsigned int iProcessor,
0102 l1t::tftype mtfType,
0103 const AlgoMuons& algoCands) override;
0104
0105
0106 virtual void setSorter(SorterBase<GoldenPatternType>* sorter) { this->sorter.reset(sorter); }
0107
0108
0109 void setGhostBuster(IGhostBuster* ghostBuster) override { this->ghostBuster.reset(ghostBuster); }
0110
0111 virtual void setPtAssignment(PtAssignmentBase* ptAssignment) { this->ptAssignment = ptAssignment; }
0112
0113 std::vector<l1t::RegionalMuonCand> run(unsigned int iProcessor,
0114 l1t::tftype mtfType,
0115 int bx,
0116 OMTFinputMaker* inputMaker,
0117 std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers) override;
0118
0119 void printInfo() const override;
0120
0121 void saveExtrapolFactors();
0122 void loadExtrapolFactors(const std::string& filename);
0123
0124 private:
0125 virtual void init(const edm::ParameterSet& edmCfg, edm::EventSetup const& evSetup);
0126
0127
0128
0129
0130
0131
0132
0133 bool checkHitPatternValidity(unsigned int hits) override;
0134
0135 std::unique_ptr<SorterBase<GoldenPatternType> > sorter;
0136
0137 std::unique_ptr<IGhostBuster> ghostBuster;
0138
0139
0140 PtAssignmentBase* ptAssignment = nullptr;
0141
0142 bool useStubQualInExtr = false;
0143 bool useEndcapStubsRInExtr = false;
0144
0145
0146
0147 bool useFloatingPointExtrapolation = false;
0148
0149 int extrapolMultiplier = 128;
0150
0151 std::vector<std::vector<std::map<int, double> > > extrapolFactors;
0152 std::vector<std::vector<std::map<int, int> > > extrapolFactorsNorm;
0153 };
0154
0155 #endif