CMS 3D CMS Logo

List of all members | Public Member Functions
MicroGMTConverter Class Reference

#include <MicroGMTConverter.h>

Public Member Functions

void convert (const EMTFTrack &in_track, l1t::RegionalMuonCand &out_cand) const
 
void convert_all (const EMTFTrackCollection &in_tracks, l1t::RegionalMuonCandBxCollection &out_cands) const
 
 MicroGMTConverter ()
 
 ~MicroGMTConverter ()
 

Detailed Description

Definition at line 10 of file MicroGMTConverter.h.

Constructor & Destructor Documentation

MicroGMTConverter::MicroGMTConverter ( )
explicit

Definition at line 4 of file MicroGMTConverter.cc.

4  {
5 
6 }
MicroGMTConverter::~MicroGMTConverter ( )

Definition at line 8 of file MicroGMTConverter.cc.

8  {
9 
10 }

Member Function Documentation

void MicroGMTConverter::convert ( const EMTFTrack in_track,
l1t::RegionalMuonCand out_cand 
) const

Definition at line 12 of file MicroGMTConverter.cc.

References l1t::EMTFPtLUT::bt_ci, l1t::EMTFPtLUT::bt_si, l1t::EMTFPtLUT::bt_vi, l1t::EMTFTrack::BX(), l1t::emtf_neg, l1t::emtf_pos, l1t::EMTFTrack::Endcap(), l1t::EMTFTrack::GMT_charge(), l1t::EMTFTrack::GMT_charge_valid(), l1t::EMTFTrack::GMT_eta(), l1t::EMTFTrack::GMT_phi(), l1t::EMTFTrack::GMT_pt(), l1t::EMTFTrack::GMT_quality(), l1t::RegionalMuonCand::kBX, l1t::RegionalMuonCand::kME1Ch, l1t::RegionalMuonCand::kME1Seg, l1t::RegionalMuonCand::kME2Ch, l1t::RegionalMuonCand::kME2Seg, l1t::RegionalMuonCand::kME3Ch, l1t::RegionalMuonCand::kME3Seg, l1t::RegionalMuonCand::kME4Ch, l1t::RegionalMuonCand::kME4Seg, l1t::RegionalMuonCand::kTrkNum, l1t::EMTFTrack::PtLUT(), l1t::EMTFTrack::Sector(), l1t::RegionalMuonCand::setHwEta(), l1t::RegionalMuonCand::setHwHF(), l1t::RegionalMuonCand::setHwPhi(), l1t::RegionalMuonCand::setHwPt(), l1t::RegionalMuonCand::setHwQual(), l1t::RegionalMuonCand::setHwSign(), l1t::RegionalMuonCand::setHwSignValid(), l1t::RegionalMuonCand::setTFIdentifiers(), l1t::RegionalMuonCand::setTrackSubAddress(), and l1t::EMTFTrack::Track_num().

Referenced by convert_all().

15  {
17  int sector = in_track.Sector() - 1;
18 
19  out_cand.setHwPt ( in_track.GMT_pt() );
20  out_cand.setHwPhi ( in_track.GMT_phi() );
21  out_cand.setHwEta ( in_track.GMT_eta() );
22  out_cand.setHwSign ( in_track.GMT_charge() );
23  out_cand.setHwSignValid ( in_track.GMT_charge_valid() );
24  out_cand.setHwQual ( in_track.GMT_quality() );
25  out_cand.setHwHF ( false ); // EMTF: halo -> 1
26  out_cand.setTFIdentifiers ( sector, tftype );
27 
28  const EMTFPtLUT& ptlut_data = in_track.PtLUT();
29 
30  // Form track sub addresses
31  int me1_ch_id = (ptlut_data.bt_vi[0] == 0 && ptlut_data.bt_vi[1] != 0) ? ptlut_data.bt_ci[1]+16 : ptlut_data.bt_ci[0];
32  int me2_ch_id = ptlut_data.bt_ci[2];
33  int me3_ch_id = ptlut_data.bt_ci[3];
34  int me4_ch_id = ptlut_data.bt_ci[4];
35 
36  int me1_seg_id = (ptlut_data.bt_vi[0] == 0 && ptlut_data.bt_vi[1] != 0) ? ptlut_data.bt_si[1] : ptlut_data.bt_si[0];
37  int me2_seg_id = ptlut_data.bt_si[2];
38  int me3_seg_id = ptlut_data.bt_si[3];
39  int me4_seg_id = ptlut_data.bt_si[4];
40 
41  auto get_gmt_chamber_me1 = [](int ch) {
42  int gmt_ch = 0;
43  if (ch == 10)
44  gmt_ch = 1;
45  else if (ch == 11)
46  gmt_ch = 2;
47  else if (ch == 12)
48  gmt_ch = 3;
49  else if (ch == 3+16)
50  gmt_ch = 4;
51  else if (ch == 6+16)
52  gmt_ch = 5;
53  else if (ch == 9+16)
54  gmt_ch = 6;
55  return gmt_ch;
56  };
57 
58  auto get_gmt_chamber = [](int ch) {
59  int gmt_ch = 0;
60  if (ch == 10)
61  gmt_ch = 1;
62  else if (ch == 11)
63  gmt_ch = 2;
64  else if (ch == 3)
65  gmt_ch = 3;
66  else if (ch == 9)
67  gmt_ch = 4;
68  return gmt_ch;
69  };
70 
72  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME1Ch , get_gmt_chamber_me1(me1_ch_id));
74  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME2Ch , get_gmt_chamber(me2_ch_id));
76  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME3Ch , get_gmt_chamber(me3_ch_id));
78  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME4Ch , get_gmt_chamber(me4_ch_id));
80  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kBX , in_track.BX());
81 }
int GMT_eta() const
Definition: EMTFTrack.h:146
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
uint16_t bt_si[5]
Definition: EMTFTrack.h:32
uint16_t bt_ci[5]
Definition: EMTFTrack.h:31
int Endcap() const
Definition: EMTFTrack.h:119
int Sector() const
Definition: EMTFTrack.h:120
uint16_t bt_vi[5]
Definition: EMTFTrack.h:29
int GMT_charge() const
Definition: EMTFTrack.h:148
int GMT_quality() const
Definition: EMTFTrack.h:147
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
void setHwHF(bool bit)
Set HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
int Track_num() const
Definition: EMTFTrack.h:150
int GMT_phi() const
Definition: EMTFTrack.h:145
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
int BX() const
Definition: EMTFTrack.h:130
int GMT_pt() const
Definition: EMTFTrack.h:144
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
int GMT_charge_valid() const
Definition: EMTFTrack.h:149
EMTFPtLUT PtLUT() const
Definition: EMTFTrack.h:86
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
void MicroGMTConverter::convert_all ( const EMTFTrackCollection in_tracks,
l1t::RegionalMuonCandBxCollection out_cands 
) const

Definition at line 83 of file MicroGMTConverter.cc.

References BXVector< T >::clear(), convert(), BXVector< T >::push_back(), and BXVector< T >::setBXRange().

86  {
87  int gmtMinBX = -2;
88  int gmtMaxBX = +2;
89 
90  out_cands.clear();
91  out_cands.setBXRange(gmtMinBX, gmtMaxBX);
92 
93  for (const auto& in_track : in_tracks) {
94  int bx = in_track.BX();
95 
96  if (gmtMinBX <= bx && bx <= gmtMaxBX) {
97  l1t::RegionalMuonCand out_cand;
98 
99  convert(in_track, out_cand);
100  out_cands.push_back(bx, out_cand);
101  }
102  }
103 }
void clear()
void setBXRange(int bxFirst, int bxLast)
void convert(const EMTFTrack &in_track, l1t::RegionalMuonCand &out_cand) const
void push_back(int bx, T object)