Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-20 02:18:48

0001 #ifndef L1TMuonEndCap_PrimitiveSelection_h
0002 #define L1TMuonEndCap_PrimitiveSelection_h
0003 
0004 #include "L1Trigger/L1TMuonEndCap/interface/Common.h"
0005 
0006 class PrimitiveSelection {
0007 public:
0008   void configure(int verbose,
0009                  int endcap,
0010                  int sector,
0011                  int bx,
0012                  int bxShiftCSC,
0013                  int bxShiftRPC,
0014                  int bxShiftGEM,
0015                  int bxShiftME0,
0016                  bool includeNeighbor,
0017                  bool duplicateTheta,
0018                  bool bugME11Dupes,
0019                  bool useRun3CCLUT_OTMB,
0020                  bool useRun3CCLUT_TMB);
0021 
0022   template <typename T>
0023   void process(T tag,
0024                const TriggerPrimitiveCollection& muon_primitives,
0025                std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const;
0026 
0027   // Put the hits from DT, CSC, RPC, GEM, ME0 together in one collection
0028   void merge(const std::map<int, TriggerPrimitiveCollection>& selected_dt_map,
0029              const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
0030              const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
0031              const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
0032              const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
0033              std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const;
0034 
0035   // Like merge(), but keep all the hits
0036   void merge_no_truncate(const std::map<int, TriggerPrimitiveCollection>& selected_dt_map,
0037                          const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
0038                          const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
0039                          const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
0040                          const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
0041                          std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const;
0042 
0043   // ___________________________________________________________________________
0044   // CSC functions
0045   // - If a chamber is selected, return an index 0-53, else return -1.
0046   //   The index 0-53 roughly corresponds to an input link. It maps to the
0047   //   2D index [station][chamber] used in the firmware, with size [5:0][8:0].
0048   //   Station 5 = neighbor sector, all stations.
0049   int select_csc(const TriggerPrimitive& muon_primitive) const;
0050 
0051   bool is_in_sector_csc(int tp_endcap, int tp_sector) const;
0052 
0053   bool is_in_neighbor_sector_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const;
0054 
0055   bool is_in_bx_csc(int tp_bx) const;
0056 
0057   int get_index_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const;
0058 
0059   // RPC functions
0060   // - If a chamber is selected, return an index 0-41, else return -1.
0061   //   The index 0-41 corresponds to CPPF link x chamber. Each CPPF link corresponds
0062   //   to a RPC subsector (6+1 incl. neighbor), and carries data from 6 RPC chambers
0063   //   (RE1/2, RE2/2, RE3/2, RE3/3, RE4/2, RE4/3). The index maps to the 2D index
0064   //   [subsector][chamber] used in the firmware, with size [6:0][5:0].
0065   //   For Phase 2, add RE1/3, RE2/3, RE3/1, RE4/1 -> 10 chambers, so the index
0066   //   becomes 0-69.
0067   int select_rpc(const TriggerPrimitive& muon_primitive) const;
0068 
0069   bool is_in_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const;
0070 
0071   bool is_in_neighbor_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const;
0072 
0073   bool is_in_bx_rpc(int tp_bx) const;
0074 
0075   int get_index_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector, int tp_bx) const;
0076 
0077   // GEM functions
0078   int select_gem(const TriggerPrimitive& muon_primitive) const;
0079 
0080   bool is_in_sector_gem(int tp_endcap, int tp_sector) const;
0081 
0082   bool is_in_neighbor_sector_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const;
0083 
0084   bool is_in_bx_gem(int tp_bx) const;
0085 
0086   int get_index_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const;
0087 
0088   // ME0 functions
0089   int select_me0(const TriggerPrimitive& muon_primitive) const;
0090 
0091   bool is_in_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const;
0092 
0093   bool is_in_neighbor_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const;
0094 
0095   bool is_in_bx_me0(int tp_bx) const;
0096 
0097   int get_index_me0(
0098       int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_pad, int tp_bx) const;
0099 
0100   // DT functions
0101   int select_dt(const TriggerPrimitive& muon_primitive) const;
0102 
0103   bool is_in_sector_dt(int tp_endcap, int tp_sector) const;
0104 
0105   bool is_in_neighbor_sector_dt(int tp_endcap, int tp_sector, int tp_csc_ID) const;
0106 
0107   bool is_in_bx_dt(int tp_bx) const;
0108 
0109   int get_index_dt(int tp_endcap, int csc_tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const;
0110 
0111 private:
0112   int verbose_, endcap_, sector_, bx_;
0113 
0114   int bxShiftCSC_, bxShiftRPC_, bxShiftGEM_, bxShiftME0_;
0115 
0116   bool includeNeighbor_, duplicateTheta_;
0117 
0118   bool bugME11Dupes_;
0119   // Run 3 CCLUT algorithm
0120   bool useRun3CCLUT_OTMB_;
0121   bool useRun3CCLUT_TMB_;
0122 };
0123 
0124 #endif