CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCTFMuonSorter Class Reference

#include <CSCTFMuonSorter.h>

Public Member Functions

 CSCTFMuonSorter (const edm::ParameterSet &)
 
std::vector< L1MuRegionalCandrun (const CSCTriggerContainer< csc::L1Track > &) const
 

Private Member Functions

void decodeRank (const unsigned &rank, unsigned &quality, unsigned &pt) const
 

Private Attributes

int m_maxBX
 
int m_minBX
 

Detailed Description

Definition at line 9 of file CSCTFMuonSorter.h.

Constructor & Destructor Documentation

◆ CSCTFMuonSorter()

CSCTFMuonSorter::CSCTFMuonSorter ( const edm::ParameterSet pset)

Definition at line 5 of file CSCTFMuonSorter.cc.

5  {
6  m_minBX = pset.getParameter<int>("MinBX");
7  m_maxBX = pset.getParameter<int>("MaxBX");
8 }

References m_maxBX, m_minBX, and muonDTDigis_cfi::pset.

Member Function Documentation

◆ decodeRank()

void CSCTFMuonSorter::decodeRank ( const unsigned &  rank,
unsigned &  quality,
unsigned &  pt 
) const
private

Definition at line 58 of file CSCTFMuonSorter.cc.

58  {
59  if (rank == 0) {
60  quality = 0;
61  pt = 0;
62  } else {
64  pt = rank & ((1 << L1MuRegionalCand::PT_LENGTH) - 1);
65  }
66 }

References DiDispStaMuonMonitor_cfi::pt, L1MuRegionalCand::PT_LENGTH, and quality.

Referenced by run().

◆ run()

std::vector< L1MuRegionalCand > CSCTFMuonSorter::run ( const CSCTriggerContainer< csc::L1Track > &  tracks) const

Definition at line 10 of file CSCTFMuonSorter.cc.

10  {
11  std::vector<L1MuRegionalCand> result;
12 
13  // First we sort and crop the incoming tracks based on their rank.
15  ++bx) // switch back into signed BX
16  {
17  std::vector<csc::L1Track> tks = tracks.get(bx);
18  std::sort(tks.begin(), tks.end(), std::greater<csc::L1Track>());
19  if (tks.size() > 4)
20  tks.resize(4); // resize to max number of muons the MS can output
21 
22  std::vector<csc::L1Track>::iterator itr = tks.begin();
23  std::vector<csc::L1Track>::const_iterator end = tks.end();
24  for (; itr != end; itr++) {
25  unsigned gbl_phi =
26  itr->localPhi() + ((itr->sector() - 1) * 24) + 6; // for now, convert using this.. LUT in the future
27  if (gbl_phi > 143)
28  gbl_phi -= 143;
29  itr->setPhiPacked(gbl_phi & 0xff);
30  unsigned eta_sign = (itr->endcap() == 1 ? 0 : 1);
31 
32  int gbl_eta = itr->eta_packed() | eta_sign << (L1MuRegionalCand::ETA_LENGTH - 1);
33 
34  itr->setEtaPacked(gbl_eta & 0x3f);
35  unsigned pt = 0, quality = 0;
36  decodeRank(itr->rank(), quality, pt);
37 
38  itr->setQualityPacked(quality & 0x3);
39  itr->setPtPacked(pt & 0x1f);
40 
41  if (!itr->empty())
42  result.push_back(*itr);
43  }
44  }
45 
46  std::vector<L1MuRegionalCand>::const_iterator ittr = result.begin();
47  unsigned ii = 1;
48  for (; ittr != result.end(); ittr++) {
49  LogDebug("CSCTFMuonSorter:run()") << "TRACK " << ii++ << ": Eta: " << ittr->etaValue()
50  << " Phi: " << ittr->phiValue() << " Pt: " << ittr->ptValue()
51  << " Quality: " << ittr->quality() << " BX: " << ittr->bx();
52  }
53 
54  return result;
55 }

References l1GtPatternGenerator_cfi::bx, decodeRank(), mps_fire::end, L1MuRegionalCand::ETA_LENGTH, cuy::ii, CSCConstants::LCT_CENTRAL_BX, LogDebug, m_maxBX, m_minBX, DiDispStaMuonMonitor_cfi::pt, quality, mps_fire::result, jetUpdater_cfi::sort, and tracks.

Referenced by CSCTFCandidateBuilder::buildCandidates().

Member Data Documentation

◆ m_maxBX

int CSCTFMuonSorter::m_maxBX
private

Definition at line 18 of file CSCTFMuonSorter.h.

Referenced by CSCTFMuonSorter(), and run().

◆ m_minBX

int CSCTFMuonSorter::m_minBX
private

Definition at line 18 of file CSCTFMuonSorter.h.

Referenced by CSCTFMuonSorter(), and run().

DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
L1MuRegionalCand::ETA_LENGTH
Definition: L1MuRegionalCand.h:193
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCConstants::LCT_CENTRAL_BX
Definition: CSCConstants.h:148
CSCTFMuonSorter::m_maxBX
int m_maxBX
Definition: CSCTFMuonSorter.h:18
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
mps_fire.end
end
Definition: mps_fire.py:242
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
CSCTFMuonSorter::m_minBX
int m_minBX
Definition: CSCTFMuonSorter.h:18
CSCTFMuonSorter::decodeRank
void decodeRank(const unsigned &rank, unsigned &quality, unsigned &pt) const
Definition: CSCTFMuonSorter.cc:58
mps_fire.result
result
Definition: mps_fire.py:311
L1MuRegionalCand::PT_LENGTH
Definition: L1MuRegionalCand.h:189
cuy.ii
ii
Definition: cuy.py:589
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27