CMS 3D CMS Logo

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