Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:06

0001 /*
0002  * ISorter.h
0003  *
0004  *  Created on: Jun 28, 2017
0005  *      Author: kbunkow
0006  */
0007 
0008 #ifndef L1T_OmtfP1_SORTERBASE_H_
0009 #define L1T_OmtfP1_SORTERBASE_H_
0010 
0011 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"
0012 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternResult.h"
0013 
0014 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0015 #include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
0016 
0017 #include <vector>
0018 
0019 template <class GoldenPatternType>
0020 class SorterBase {
0021 public:
0022   virtual ~SorterBase() {}
0023 
0024   //iProcessor - continuous processor index [0...11]
0025   virtual AlgoMuons sortResults(unsigned int procIndx,
0026                                 const GoldenPatternVec<GoldenPatternType>& gPatterns,
0027                                 int charge = 0) {
0028     AlgoMuons refHitCands;
0029     //  for(auto itRefHit: procResults) refHitCands.push_back(sortRefHitResults(itRefHit,charge));
0030     for (unsigned int iRefHit = 0; iRefHit < gPatterns.at(0)->getResults()[procIndx].size(); iRefHit++) {
0031       refHitCands.emplace_back(sortRefHitResults(procIndx, iRefHit, gPatterns, charge));
0032     }
0033     return refHitCands;
0034   }
0035 
0036   ///Sort results from a single reference hit.
0037   ///Select candidate with highest number of hit layers
0038   ///Then select a candidate with largest likelihood value and given charge
0039   ///as we allow two candidates with opposite charge from single 10deg region
0040   virtual AlgoMuons::value_type sortRefHitResults(unsigned int procIndx,
0041                                                   unsigned int iRefHit,
0042                                                   const GoldenPatternVec<GoldenPatternType>& gPatterns,
0043                                                   int charge = 0) = 0;
0044 };
0045 
0046 #endif /* L1T_OmtfP1_SORTERBASE_H_ */