Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:55:33

0001 #ifndef OMTF_OMTFSorter_H
0002 #define OMTF_OMTFSorter_H
0003 
0004 #include <tuple>
0005 #include <vector>
0006 
0007 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0008 #include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
0009 
0010 #include "L1Trigger/L1TMuonOverlap/interface/OMTFResult.h"
0011 #include "L1Trigger/L1TMuonOverlap/interface/OMTFProcessor.h"
0012 #include "L1Trigger/L1TMuonOverlap/interface/AlgoMuon.h"
0013 #include "L1Trigger/L1TMuonOverlap/interface/GhostBuster.h"
0014 
0015 class OMTFConfiguration;
0016 
0017 class OMTFSorter {
0018 public:
0019   void initialize(const OMTFConfiguration* cfg) { myOmtfConfig = cfg; }
0020   void setNphiBins(unsigned int phiBins) { nPhiBins = phiBins; }
0021 
0022   void sortRefHitResults(const std::vector<OMTFProcessor::resultsMap>& procResults,
0023                          std::vector<AlgoMuon>& refHitCleanCands,
0024                          int charge = 0);
0025 
0026   //convert algo muon to outgoing Candidates
0027   //FIXME (MK): nothing to do with sorter, move it from here!
0028   std::vector<l1t::RegionalMuonCand> candidates(unsigned int iProcessor,
0029                                                 l1t::tftype mtfType,
0030                                                 const std::vector<AlgoMuon>& algoCands);
0031 
0032   ///Sort results from a single reference hit.
0033   ///Select candidate with highest number of hit layers
0034   ///Then select a candidate with largest likelihood value and given charge
0035   ///as we allow two candidates with opposite charge from single 10deg region
0036   AlgoMuon sortRefHitResults(const OMTFProcessor::resultsMap& aResultsMap, int charge = 0);
0037 
0038 private:
0039   ///Check if the hit pattern of given OMTF candite is not on the list
0040   ///of invalid hit patterns. Invalid hit patterns provode very little
0041   ///to efficiency, but gives high contribution to rate.
0042   ///Candidate with invalid hit patterns is assigned quality=0.
0043   ///Currently the list of invalid patterns is hardcoded.
0044   ///This has to be read from configuration.
0045   bool checkHitPatternValidity(unsigned int hits);
0046 
0047   ///Find a candidate with best parameters for given GoldenPattern
0048   ///Sorting is made amongs candidates with different reference layers
0049   ///The output tuple contains (nHitsMax, pdfValMax, refPhi, refLayer, hitsWord, refEta)
0050   ///hitsWord codes number of layers hit: hitsWord= sum 2**iLogicLayer,
0051   ///where sum runs over layers which were hit
0052   AlgoMuon sortSingleResult(const OMTFResult& aResult);
0053 
0054   unsigned int nPhiBins;
0055   const OMTFConfiguration* myOmtfConfig;
0056 };
0057 
0058 #endif