Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-12 01:51:33

0001 #ifndef Phase2L1Trigger_DTTrigger_PseudoBayesGrouping_h
0002 #define Phase2L1Trigger_DTTrigger_PseudoBayesGrouping_h
0003 
0004 #include "L1Trigger/DTTriggerPhase2/interface/MotherGrouping.h"
0005 #include "L1Trigger/DTTriggerPhase2/interface/DTPattern.h"
0006 #include "L1Trigger/DTTriggerPhase2/interface/CandidateGroup.h"
0007 
0008 // ===============================================================================
0009 // Class declarations
0010 // ===============================================================================
0011 // using namespace dtbayesam;
0012 
0013 class PseudoBayesGrouping : public MotherGrouping {
0014 public:
0015   // Constructors and destructor
0016   PseudoBayesGrouping(const edm::ParameterSet& pset, edm::ConsumesCollector& iC);
0017   ~PseudoBayesGrouping() override;
0018 
0019   // Main methods
0020   void initialise(const edm::EventSetup& iEventSetup) override;
0021   void run(edm::Event& iEvent,
0022            const edm::EventSetup& iEventSetup,
0023            const DTDigiCollection& digis,
0024            MuonPathPtrs& outMpath) override;
0025   void finish() override;
0026 
0027   // Other public methods
0028 
0029   // Public attributes
0030 
0031 private:
0032   // Private methods
0033   void LoadPattern(TString pattern_file_name, int MB_number_input, int SL_shift);
0034   void FillDigisByLayer(const DTDigiCollection* digis);
0035   void CleanDigisByLayer();
0036   void RecognisePatternsByLayerPairs(DTChamberId chamber_ID);
0037   void RecognisePatterns(std::vector<DTPrimitive> digisinLDown,
0038                          std::vector<DTPrimitive> digisinLUp,
0039                          dtbayesam::DTPatternPtrs patterns);
0040   void ReCleanPatternsAndDigis();
0041   void FillMuonPaths(MuonPathPtrs& mpaths);
0042 
0043   //Comparator for pointer mode
0044   struct CandPointGreat {
0045     bool operator()(dtbayesam::CandidateGroupPtr c1, dtbayesam::CandidateGroupPtr c2) { return *c1 > *c2; }
0046   };
0047 
0048   // Private attributes
0049   // Config variables
0050   const bool debug_;
0051   std::string pattern_filename_;
0052   int pidx_;
0053   int minNLayerHits_;
0054   int allowedVariance_;
0055   bool allowDuplicates_;
0056   bool allowUncorrelatedPatterns_;
0057   bool setLateralities_;
0058   bool saveOnPlace_;
0059   int minSingleSLHitsMax_;
0060   int minSingleSLHitsMin_;
0061   int minUncorrelatedHits_;
0062   uint maxPathsPerMatch_;
0063 
0064   //Classified digis
0065   std::vector<DTPrimitive> alldigis_;
0066 
0067   std::vector<DTPrimitive> digisinL0_;
0068   std::vector<DTPrimitive> digisinL1_;
0069   std::vector<DTPrimitive> digisinL2_;
0070   std::vector<DTPrimitive> digisinL3_;
0071   std::vector<DTPrimitive> digisinL4_;
0072   std::vector<DTPrimitive> digisinL5_;
0073   std::vector<DTPrimitive> digisinL6_;
0074   std::vector<DTPrimitive> digisinL7_;
0075 
0076   //Preliminary matches, those can grow quite big so better not to rely on the stack
0077   std::unique_ptr<dtbayesam::CandidateGroupPtrs> prelimMatches_;
0078   std::unique_ptr<dtbayesam::CandidateGroupPtrs> allMatches_;
0079   std::unique_ptr<dtbayesam::CandidateGroupPtrs> finalMatches_;
0080 
0081   //Pattern related info
0082   int nPatterns_;
0083 
0084   // One vector per MB and per shift of SL3 wrt SL1
0085   // shift = (0, 1, 2) --> (left, nothing, right)
0086   dtbayesam::DTPatternPtrs allPatterns_[4][3];
0087 
0088   dtbayesam::DTPatternPtrs L0L7Patterns_[4][3];
0089   dtbayesam::DTPatternPtrs L1L7Patterns_[4][3];
0090   dtbayesam::DTPatternPtrs L2L7Patterns_[4][3];
0091   dtbayesam::DTPatternPtrs L3L7Patterns_[4][3];
0092   dtbayesam::DTPatternPtrs L4L7Patterns_[4][3];
0093   dtbayesam::DTPatternPtrs L5L7Patterns_[4][3];
0094   dtbayesam::DTPatternPtrs L6L7Patterns_[4][3];
0095 
0096   dtbayesam::DTPatternPtrs L0L6Patterns_[4][3];
0097   dtbayesam::DTPatternPtrs L1L6Patterns_[4][3];
0098   dtbayesam::DTPatternPtrs L2L6Patterns_[4][3];
0099   dtbayesam::DTPatternPtrs L3L6Patterns_[4][3];
0100   dtbayesam::DTPatternPtrs L4L6Patterns_[4][3];
0101   dtbayesam::DTPatternPtrs L5L6Patterns_[4][3];
0102 
0103   dtbayesam::DTPatternPtrs L0L5Patterns_[4][3];
0104   dtbayesam::DTPatternPtrs L1L5Patterns_[4][3];
0105   dtbayesam::DTPatternPtrs L2L5Patterns_[4][3];
0106   dtbayesam::DTPatternPtrs L3L5Patterns_[4][3];
0107   dtbayesam::DTPatternPtrs L4L5Patterns_[4][3];
0108 
0109   dtbayesam::DTPatternPtrs L0L4Patterns_[4][3];
0110   dtbayesam::DTPatternPtrs L1L4Patterns_[4][3];
0111   dtbayesam::DTPatternPtrs L2L4Patterns_[4][3];
0112   dtbayesam::DTPatternPtrs L3L4Patterns_[4][3];
0113 
0114   dtbayesam::DTPatternPtrs L0L3Patterns_[4][3];
0115   dtbayesam::DTPatternPtrs L1L3Patterns_[4][3];
0116   dtbayesam::DTPatternPtrs L2L3Patterns_[4][3];
0117 
0118   dtbayesam::DTPatternPtrs L0L2Patterns_[4][3];
0119   dtbayesam::DTPatternPtrs L1L2Patterns_[4][3];
0120 
0121   dtbayesam::DTPatternPtrs L0L1Patterns_[4][3];
0122 };
0123 
0124 #endif