Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-15 23:40:40

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuBMTrackFinder
0004  *
0005  *   L1 barrel Muon Trigger Track Finder (MTTF)
0006  *
0007  *   The barrel MTTF consists of:
0008  *      - 72 Sector Processors (SP),
0009  *      - 12 Eta Processors,
0010  *      - 12 Wedge Sorters (WS) and
0011  *      -  1 BM Muon Sorter (MS)
0012  *
0013  *
0014  *
0015  *   N. Neumeister            CERN EP
0016  *   J. Troconiz              UAM Madrid
0017  *   modification: G.Karathanasis UoAthens
0018  */
0019 //
0020 //--------------------------------------------------
0021 #ifndef L1MUBM_TRACK_FINDER_H
0022 #define L1MUBM_TRACK_FINDER_H
0023 
0024 //---------------
0025 // C++ Headers --
0026 //---------------
0027 
0028 #include <vector>
0029 #include <iostream>
0030 #include <memory>
0031 
0032 //----------------------
0033 // Base Class Headers --
0034 //----------------------
0035 
0036 #include <map>
0037 
0038 //------------------------------------
0039 // Collaborating Class Declarations --
0040 //------------------------------------
0041 
0042 #include "FWCore/Framework/interface/Event.h"
0043 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0044 #include "FWCore/Framework/interface/ConsumesCollector.h"
0045 #include "FWCore/Utilities/interface/EDGetToken.h"
0046 #include "FWCore/Utilities/interface/ESGetToken.h"
0047 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
0048 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0049 #include "DataFormats/L1TMuon/interface/L1MuBMTrack.h"
0050 #include "DataFormats/L1TMuon/interface/L1MuBMTrackSegEta.h"
0051 #include "DataFormats/L1TMuon/interface/L1MuBMTrackSegPhi.h"
0052 #include "CondFormats/L1TObjects/interface/L1TMuonBarrelParams.h"
0053 #include "CondFormats/DataRecord/interface/L1TMuonBarrelParamsRcd.h"
0054 #include "L1Trigger/L1TMuonBarrel/interface/L1MuBMTFConfig.h"
0055 #include "L1Trigger/L1TMuonBarrel/interface/L1MuBMSecProcMap.h"
0056 #include "L1Trigger/L1TMuonBarrel/interface/L1MuBMMuonSorter.h"
0057 
0058 class L1MuBMSecProcId;
0059 class L1MuBMSectorProcessor;
0060 class L1MuBMEtaProcessor;
0061 class L1MuBMWedgeSorter;
0062 class L1MuRegionalCand;
0063 class L1MuDTTrack;
0064 class L1MuDTTrackSegPhi;
0065 class L1MuDTTrackSegEta;
0066 
0067 //              ---------------------
0068 //              -- Class Interface --
0069 //              ---------------------
0070 
0071 class L1MuBMTrackFinder {
0072 public:
0073   /// container for muon candidates
0074   typedef l1t::RegionalMuonCandBxCollection::const_iterator TFtracks_const_iter;
0075   typedef l1t::RegionalMuonCandBxCollection::iterator TFtracks_iter;
0076 
0077   /// constructor
0078   L1MuBMTrackFinder(const edm::ParameterSet& ps, edm::ConsumesCollector&& iC);
0079 
0080   /// destructor
0081   virtual ~L1MuBMTrackFinder();
0082 
0083   /// build the structure of the barrel MTTF
0084   void setup(edm::ConsumesCollector&&);
0085 
0086   /// run the barrel MTTF
0087   void run(const edm::Event& e, const edm::EventSetup& c);
0088 
0089   /// reset the barrel MTTF
0090   void reset();
0091 
0092   inline int setAdd(int ust, int rel_add);
0093 
0094   /// get a pointer to a Sector Processor
0095   const L1MuBMSectorProcessor* sp(const L1MuBMSecProcId&) const;
0096   L1MuBMSectorProcessor* sp(const L1MuBMSecProcId&);
0097 
0098   /// get a pointer to an Eta Processor, index [0-11]
0099   inline const L1MuBMEtaProcessor* ep(int id) const { return m_epvec[id].get(); }
0100 
0101   /// get a pointer to a Wedge Sorter, index [0-11]
0102   inline const L1MuBMWedgeSorter* ws(int id) const { return m_wsvec[id].get(); }
0103 
0104   /// get a pointer to the BM Muon Sorter
0105   inline const L1MuBMMuonSorter& ms() const { return m_ms; }
0106 
0107   /// get number of muon candidates found by the barrel MTTF
0108   int numberOfTracks();
0109 
0110   TFtracks_const_iter begin(int bx);
0111 
0112   TFtracks_const_iter end(int bx);
0113 
0114   void clear();
0115 
0116   /// get number of muon candidates found by the barrel MTTF at a given bx
0117   int numberOfTracks(int bx);
0118 
0119   /// return configuration
0120   const L1MuBMTFConfig& config() const { return m_config; }
0121 
0122   l1t::RegionalMuonCandBxCollection& getcache() { return _cache; }
0123   l1t::RegionalMuonCandBxCollection& getcache0() { return _cache0; }
0124   L1MuBMTrackCollection& getcache1() { return _cache1; }
0125   L1MuBMTrackSegPhiCollection& getcache2() { return _cache2; }
0126   L1MuBMTrackSegEtaCollection& getcache3() { return _cache3; }
0127 
0128 private:
0129   /// run Track Finder and store candidates in cache
0130   virtual void reconstruct(const edm::Event& e, const edm::EventSetup& c) {
0131     reset();
0132     run(e, c);
0133   }
0134 
0135 private:
0136   l1t::RegionalMuonCandBxCollection _cache0;
0137   l1t::RegionalMuonCandBxCollection _cache;
0138   L1MuBMTrackCollection _cache1;
0139   L1MuBMTrackSegPhiCollection _cache2;
0140   L1MuBMTrackSegEtaCollection _cache3;
0141 
0142   L1MuBMSecProcMap m_spmap;                                  ///< Sector Processors
0143   std::vector<std::unique_ptr<L1MuBMEtaProcessor>> m_epvec;  ///< Eta Processors
0144   std::vector<std::unique_ptr<L1MuBMWedgeSorter>> m_wsvec;   ///< Wedge Sorters
0145   L1MuBMMuonSorter m_ms;                                     ///< BM Muon Sorter
0146 
0147   L1MuBMTFConfig m_config;  ///< Track Finder configuration
0148 
0149   unsigned long long m_recordCache = 0;
0150   edm::EDGetTokenT<L1MuDTChambPhContainer> m_DTDigiToken;
0151   edm::ESGetToken<L1TMuonBarrelParams, L1TMuonBarrelParamsRcd> m_mbParamsToken;
0152 };
0153 
0154 #endif