Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:49

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 
0055 class L1MuBMTFConfig;
0056 class L1MuBMSecProcMap;
0057 class L1MuBMSecProcId;
0058 class L1MuBMSectorProcessor;
0059 class L1MuBMEtaProcessor;
0060 class L1MuBMWedgeSorter;
0061 class L1MuBMMuonSorter;
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 
0097   /// get a pointer to an Eta Processor, index [0-11]
0098   inline const L1MuBMEtaProcessor* ep(int id) const { return m_epvec[id]; }
0099 
0100   /// get a pointer to a Wedge Sorter, index [0-11]
0101   inline const L1MuBMWedgeSorter* ws(int id) const { return m_wsvec[id]; }
0102 
0103   /// get a pointer to the BM Muon Sorter
0104   inline const L1MuBMMuonSorter* ms() const { return m_ms; }
0105 
0106   /// get number of muon candidates found by the barrel MTTF
0107   int numberOfTracks();
0108 
0109   TFtracks_const_iter begin(int bx);
0110 
0111   TFtracks_const_iter end(int bx);
0112 
0113   void clear();
0114 
0115   /// get number of muon candidates found by the barrel MTTF at a given bx
0116   int numberOfTracks(int bx);
0117 
0118   /// return configuration
0119   static const L1MuBMTFConfig* config() { return m_config.get(); }
0120 
0121   l1t::RegionalMuonCandBxCollection& getcache() { return _cache; }
0122   l1t::RegionalMuonCandBxCollection& getcache0() { return _cache0; }
0123   L1MuBMTrackCollection& getcache1() { return _cache1; }
0124   L1MuBMTrackSegPhiCollection& getcache2() { return _cache2; }
0125   L1MuBMTrackSegEtaCollection& getcache3() { return _cache3; }
0126 
0127 private:
0128   /// run Track Finder and store candidates in cache
0129   virtual void reconstruct(const edm::Event& e, const edm::EventSetup& c) {
0130     reset();
0131     run(e, c);
0132   }
0133 
0134 private:
0135   l1t::RegionalMuonCandBxCollection _cache0;
0136   l1t::RegionalMuonCandBxCollection _cache;
0137   L1MuBMTrackCollection _cache1;
0138   L1MuBMTrackSegPhiCollection _cache2;
0139   L1MuBMTrackSegEtaCollection _cache3;
0140 
0141   L1MuBMSecProcMap* m_spmap;                 ///< Sector Processors
0142   std::vector<L1MuBMEtaProcessor*> m_epvec;  ///< Eta Processors
0143   std::vector<L1MuBMWedgeSorter*> m_wsvec;   ///< Wedge Sorters
0144   L1MuBMMuonSorter* m_ms;                    ///< BM Muon Sorter
0145 
0146   static std::shared_ptr<L1MuBMTFConfig> m_config;  ///< Track Finder configuration
0147 
0148   edm::EDGetTokenT<L1MuDTChambPhContainer> m_DTDigiToken;
0149   edm::ESGetToken<L1TMuonBarrelParams, L1TMuonBarrelParamsRcd> m_mbParamsToken;
0150 };
0151 
0152 #endif