CMS 3D CMS Logo

PrimitiveSelection.h
Go to the documentation of this file.
1 #ifndef L1TMuonEndCap_PrimitiveSelection_h
2 #define L1TMuonEndCap_PrimitiveSelection_h
3 
5 
7 public:
8  void configure(int verbose,
9  int endcap,
10  int sector,
11  int bx,
12  int bxShiftCSC,
13  int bxShiftRPC,
14  int bxShiftGEM,
15  int bxShiftME0,
16  bool includeNeighbor,
17  bool duplicateTheta,
18  bool bugME11Dupes,
19  bool useRun3CCLUT_OTMB,
20  bool useRun3CCLUT_TMB);
21 
22  template <typename T>
23  void process(T tag,
24  const TriggerPrimitiveCollection& muon_primitives,
25  std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const;
26 
27  // Put the hits from DT, CSC, RPC, GEM, ME0 together in one collection
28  void merge(const std::map<int, TriggerPrimitiveCollection>& selected_dt_map,
29  const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
30  const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
31  const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
32  const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
33  std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const;
34 
35  // Like merge(), but keep all the hits
36  void merge_no_truncate(const std::map<int, TriggerPrimitiveCollection>& selected_dt_map,
37  const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
38  const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
39  const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
40  const std::map<int, TriggerPrimitiveCollection>& selected_me0_map,
41  std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const;
42 
43  // ___________________________________________________________________________
44  // CSC functions
45  // - If a chamber is selected, return an index 0-53, else return -1.
46  // The index 0-53 roughly corresponds to an input link. It maps to the
47  // 2D index [station][chamber] used in the firmware, with size [5:0][8:0].
48  // Station 5 = neighbor sector, all stations.
49  int select_csc(const TriggerPrimitive& muon_primitive) const;
50 
51  bool is_in_sector_csc(int tp_endcap, int tp_sector) const;
52 
53  bool is_in_neighbor_sector_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const;
54 
55  bool is_in_bx_csc(int tp_bx) const;
56 
57  int get_index_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const;
58 
59  // RPC functions
60  // - If a chamber is selected, return an index 0-41, else return -1.
61  // The index 0-41 corresponds to CPPF link x chamber. Each CPPF link corresponds
62  // to a RPC subsector (6+1 incl. neighbor), and carries data from 6 RPC chambers
63  // (RE1/2, RE2/2, RE3/2, RE3/3, RE4/2, RE4/3). The index maps to the 2D index
64  // [subsector][chamber] used in the firmware, with size [6:0][5:0].
65  // For Phase 2, add RE1/3, RE2/3, RE3/1, RE4/1 -> 10 chambers, so the index
66  // becomes 0-69.
67  int select_rpc(const TriggerPrimitive& muon_primitive) const;
68 
69  bool is_in_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const;
70 
71  bool is_in_neighbor_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const;
72 
73  bool is_in_bx_rpc(int tp_bx) const;
74 
75  int get_index_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector, int tp_bx) const;
76 
77  // GEM functions
78  int select_gem(const TriggerPrimitive& muon_primitive) const;
79 
80  bool is_in_sector_gem(int tp_endcap, int tp_sector) const;
81 
82  bool is_in_neighbor_sector_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const;
83 
84  bool is_in_bx_gem(int tp_bx) const;
85 
86  int get_index_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const;
87 
88  // ME0 functions
89  int select_me0(const TriggerPrimitive& muon_primitive) const;
90 
91  bool is_in_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const;
92 
93  bool is_in_neighbor_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const;
94 
95  bool is_in_bx_me0(int tp_bx) const;
96 
97  int get_index_me0(
98  int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_pad, int tp_bx) const;
99 
100  // DT functions
101  int select_dt(const TriggerPrimitive& muon_primitive) const;
102 
103  bool is_in_sector_dt(int tp_endcap, int tp_sector) const;
104 
105  bool is_in_neighbor_sector_dt(int tp_endcap, int tp_sector, int tp_csc_ID) const;
106 
107  bool is_in_bx_dt(int tp_bx) const;
108 
109  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;
110 
111 private:
113 
115 
117 
119  // Run 3 CCLUT algorithm
122 };
123 
124 #endif
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
void merge(const std::map< int, TriggerPrimitiveCollection > &selected_dt_map, const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, const std::map< int, TriggerPrimitiveCollection > &selected_me0_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
bool is_in_neighbor_sector_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
int get_index_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const
int select_rpc(const TriggerPrimitive &muon_primitive) const
bool verbose
bool is_in_sector_csc(int tp_endcap, int tp_sector) const
bool is_in_bx_gem(int tp_bx) const
bool is_in_bx_csc(int tp_bx) const
bool is_in_neighbor_sector_dt(int tp_endcap, int tp_sector, int tp_csc_ID) const
int get_index_me0(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_pad, int tp_bx) const
void merge_no_truncate(const std::map< int, TriggerPrimitiveCollection > &selected_dt_map, const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, const std::map< int, TriggerPrimitiveCollection > &selected_me0_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
bool is_in_sector_gem(int tp_endcap, int tp_sector) const
bool is_in_neighbor_sector_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
int select_csc(const TriggerPrimitive &muon_primitive) const
int get_index_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID, int tp_bx) const
bool is_in_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const
void configure(int verbose, int endcap, int sector, int bx, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, int bxShiftME0, bool includeNeighbor, bool duplicateTheta, bool bugME11Dupes, bool useRun3CCLUT_OTMB, bool useRun3CCLUT_TMB)
int get_index_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector, int tp_bx) const
bool is_in_neighbor_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const
int select_dt(const TriggerPrimitive &muon_primitive) const
bool is_in_bx_me0(int tp_bx) const
int select_gem(const TriggerPrimitive &muon_primitive) const
bool is_in_sector_dt(int tp_endcap, int tp_sector) const
bool is_in_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const
int select_me0(const TriggerPrimitive &muon_primitive) const
void process(T tag, const TriggerPrimitiveCollection &muon_primitives, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
bool is_in_bx_rpc(int tp_bx) const
bool is_in_neighbor_sector_me0(int tp_endcap, int tp_sector, int tp_csc_ID, int tp_pad) const
long double T
L1TMuon::TriggerPrimitiveCollection TriggerPrimitiveCollection
Definition: Common.h:32
bool is_in_bx_dt(int tp_bx) const