CMS 3D CMS Logo

List of all members | Public Member Functions
MicroGMTConverter Class Reference

#include <MicroGMTConverter.h>

Public Member Functions

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

Detailed Description

Definition at line 11 of file MicroGMTConverter.h.

Constructor & Destructor Documentation

◆ MicroGMTConverter()

MicroGMTConverter::MicroGMTConverter ( )
explicit

Definition at line 3 of file MicroGMTConverter.cc.

3 {}

◆ ~MicroGMTConverter()

MicroGMTConverter::~MicroGMTConverter ( )

Definition at line 5 of file MicroGMTConverter.cc.

5 {}

Member Function Documentation

◆ convert()

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

Definition at line 7 of file MicroGMTConverter.cc.

9  {
11  int sector = in_track.Sector() - 1;
12 
13  out_cand.setHwPt(in_track.GMT_pt());
14  out_cand.setHwPtUnconstrained(in_track.GMT_pt_dxy());
15  out_cand.setHwDXY(in_track.GMT_dxy());
16  out_cand.setHwPhi(in_track.GMT_phi());
17  out_cand.setHwEta(in_track.GMT_eta());
18  out_cand.setHwSign(in_track.GMT_charge());
19  out_cand.setHwSignValid(in_track.GMT_charge_valid());
20  out_cand.setHwQual(in_track.GMT_quality());
21  out_cand.setHwHF(false); // EMTF: halo -> 1
22  out_cand.setTFIdentifiers(sector, tftype);
23 
24  const EMTFPtLUT& ptlut_data = in_track.PtLUT();
25 
26  // Form track sub addresses
27  int me1_ch_id =
28  (ptlut_data.bt_vi[0] == 0 && ptlut_data.bt_vi[1] != 0) ? ptlut_data.bt_ci[1] + 16 : ptlut_data.bt_ci[0];
29  int me2_ch_id = ptlut_data.bt_ci[2];
30  int me3_ch_id = ptlut_data.bt_ci[3];
31  int me4_ch_id = ptlut_data.bt_ci[4];
32 
33  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];
34  int me2_seg_id = ptlut_data.bt_si[2];
35  int me3_seg_id = ptlut_data.bt_si[3];
36  int me4_seg_id = ptlut_data.bt_si[4];
37 
38  auto get_gmt_chamber_me1 = [](int ch) {
39  int gmt_ch = 0;
40  if (ch == 10)
41  gmt_ch = 1;
42  else if (ch == 11)
43  gmt_ch = 2;
44  else if (ch == 12)
45  gmt_ch = 3;
46  else if (ch == 3 + 16)
47  gmt_ch = 4;
48  else if (ch == 6 + 16)
49  gmt_ch = 5;
50  else if (ch == 9 + 16)
51  gmt_ch = 6;
52  return gmt_ch;
53  };
54 
55  auto get_gmt_chamber = [](int ch) {
56  int gmt_ch = 0;
57  if (ch == 10)
58  gmt_ch = 1;
59  else if (ch == 11)
60  gmt_ch = 2;
61  else if (ch == 3)
62  gmt_ch = 3;
63  else if (ch == 9)
64  gmt_ch = 4;
65  return gmt_ch;
66  };
67 
68  // Truncate kBX to 11 bits and offset by 25 from global event BX in EMTF firmware
69  int EMTF_kBX = (abs(global_event_BX) % 2048) - 25 + in_track.BX();
70  if (EMTF_kBX < 0)
71  EMTF_kBX += 2048;
72 
74  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME1Ch, get_gmt_chamber_me1(me1_ch_id));
76  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME2Ch, get_gmt_chamber(me2_ch_id));
78  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME3Ch, get_gmt_chamber(me3_ch_id));
80  out_cand.setTrackSubAddress(l1t::RegionalMuonCand::kME4Ch, get_gmt_chamber(me4_ch_id));
83 }

References funct::abs(), 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_dxy(), l1t::EMTFTrack::GMT_eta(), l1t::EMTFTrack::GMT_phi(), l1t::EMTFTrack::GMT_pt(), l1t::EMTFTrack::GMT_pt_dxy(), 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::setHwDXY(), l1t::RegionalMuonCand::setHwEta(), l1t::RegionalMuonCand::setHwHF(), l1t::RegionalMuonCand::setHwPhi(), l1t::RegionalMuonCand::setHwPt(), l1t::RegionalMuonCand::setHwPtUnconstrained(), l1t::RegionalMuonCand::setHwQual(), l1t::RegionalMuonCand::setHwSign(), l1t::RegionalMuonCand::setHwSignValid(), l1t::RegionalMuonCand::setTFIdentifiers(), l1t::RegionalMuonCand::setTrackSubAddress(), and l1t::EMTFTrack::Track_num().

Referenced by convert_all().

◆ convert_all()

void MicroGMTConverter::convert_all ( const edm::Event iEvent,
const EMTFTrackCollection in_tracks,
l1t::RegionalMuonCandBxCollection out_cands 
) const

Definition at line 85 of file MicroGMTConverter.cc.

87  {
88  int gmtMinBX = -2;
89  int gmtMaxBX = +2;
90 
91  out_cands.clear();
92  out_cands.setBXRange(gmtMinBX, gmtMaxBX);
93 
94  for (const auto& in_track : in_tracks) {
95  int bx = in_track.BX();
96 
97  if (gmtMinBX <= bx && bx <= gmtMaxBX) {
98  l1t::RegionalMuonCand out_cand;
99 
100  convert(iEvent.bunchCrossing(), in_track, out_cand);
101  out_cands.push_back(bx, out_cand);
102  }
103  }
104 
105  // Sort by processor to match uGMT unpacked order
106  emtf::sort_uGMT_muons(out_cands);
107 }

References l1GtPatternGenerator_cfi::bx, BXVector< T >::clear(), convert(), iEvent, BXVector< T >::push_back(), BXVector< T >::setBXRange(), and emtf::sort_uGMT_muons().

l1t::RegionalMuonCand::kME1Ch
Definition: RegionalMuonCand.h:32
l1t::RegionalMuonCand::kME3Seg
Definition: RegionalMuonCand.h:35
l1t::emtf_neg
Definition: RegionalMuonCandFwd.h:8
l1t::EMTFTrack::PtLUT
EMTFPtLUT PtLUT() const
Definition: EMTFTrack.h:129
l1t::RegionalMuonCand::kME2Ch
Definition: RegionalMuonCand.h:34
l1t::tftype
tftype
Definition: RegionalMuonCandFwd.h:8
l1t::RegionalMuonCand::setHwSign
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
Definition: RegionalMuonCand.h:136
l1t::EMTFPtLUT
Definition: EMTFTrack.h:24
l1t::RegionalMuonCand::kBX
Definition: RegionalMuonCand.h:40
l1t::EMTFPtLUT::bt_si
uint16_t bt_si[5]
Definition: EMTFTrack.h:41
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
l1t::RegionalMuonCand::kME1Seg
Definition: RegionalMuonCand.h:31
l1t::EMTFTrack::GMT_pt_dxy
int GMT_pt_dxy() const
Definition: EMTFTrack.h:194
l1t::EMTFTrack::Sector
int Sector() const
Definition: EMTFTrack.h:166
l1t::EMTFTrack::BX
int BX() const
Definition: EMTFTrack.h:177
l1t::EMTFPtLUT::bt_vi
uint16_t bt_vi[5]
Definition: EMTFTrack.h:38
l1t::RegionalMuonCand::setTFIdentifiers
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
Definition: RegionalMuonCand.cc:5
l1t::EMTFTrack::GMT_phi
int GMT_phi() const
Definition: EMTFTrack.h:196
l1t::EMTFTrack::Endcap
int Endcap() const
Definition: EMTFTrack.h:165
BXVector::clear
void clear()
l1t::RegionalMuonCand::setHwPt
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
Definition: RegionalMuonCand.h:126
l1t::RegionalMuonCand::setHwHF
void setHwHF(bool bit)
Set HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
Definition: RegionalMuonCand.h:142
l1t::EMTFTrack::GMT_quality
int GMT_quality() const
Definition: EMTFTrack.h:198
emtf::sort_uGMT_muons
void sort_uGMT_muons(l1t::RegionalMuonCandBxCollection &cands)
Definition: MicroGMTConverter.cc:111
l1t::RegionalMuonCand::setHwEta
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
Definition: RegionalMuonCand.h:134
iEvent
int iEvent
Definition: GenABIO.cc:224
l1t::RegionalMuonCand::kME4Seg
Definition: RegionalMuonCand.h:37
l1t::RegionalMuonCand::setTrackSubAddress
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
Definition: RegionalMuonCand.h:152
l1t::RegionalMuonCand::setHwQual
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
Definition: RegionalMuonCand.h:140
l1t::EMTFTrack::Track_num
int Track_num() const
Definition: EMTFTrack.h:201
l1t::RegionalMuonCand::setHwSignValid
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
Definition: RegionalMuonCand.h:138
l1t::RegionalMuonCand::kTrkNum
Definition: RegionalMuonCand.h:39
l1t::emtf_pos
Definition: RegionalMuonCandFwd.h:8
l1t::RegionalMuonCand::setHwDXY
void setHwDXY(int bits)
Set compressed impact parameter with respect to beamspot (4 bits)
Definition: RegionalMuonCand.h:130
l1t::EMTFTrack::GMT_charge_valid
int GMT_charge_valid() const
Definition: EMTFTrack.h:200
l1t::EMTFTrack::GMT_dxy
int GMT_dxy() const
Definition: EMTFTrack.h:195
l1t::RegionalMuonCand::kME2Seg
Definition: RegionalMuonCand.h:33
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
l1t::RegionalMuonCand::kME3Ch
Definition: RegionalMuonCand.h:36
l1t::RegionalMuonCand::setHwPtUnconstrained
void setHwPtUnconstrained(int bits)
Set compressed second displaced pT as transmitted by hardware LSB = 1.0 (8 bits)
Definition: RegionalMuonCand.h:128
l1t::RegionalMuonCand::setHwPhi
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
Definition: RegionalMuonCand.h:132
l1t::EMTFTrack::GMT_pt
int GMT_pt() const
Definition: EMTFTrack.h:193
BXVector::setBXRange
void setBXRange(int bxFirst, int bxLast)
l1t::EMTFPtLUT::bt_ci
uint16_t bt_ci[5]
Definition: EMTFTrack.h:40
l1t::EMTFTrack::GMT_charge
int GMT_charge() const
Definition: EMTFTrack.h:199
BXVector::push_back
void push_back(int bx, T object)
l1t::EMTFTrack::GMT_eta
int GMT_eta() const
Definition: EMTFTrack.h:197
l1t::RegionalMuonCand
Definition: RegionalMuonCand.h:8
l1t::RegionalMuonCand::kME4Ch
Definition: RegionalMuonCand.h:38
MicroGMTConverter::convert
void convert(const int global_event_BX, const EMTFTrack &in_track, l1t::RegionalMuonCand &out_cand) const
Definition: MicroGMTConverter.cc:7