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.

References m_maxBX, m_minBX, and muonDTDigis_cfi::pset.

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

Member Function Documentation

◆ decodeRank()

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

Definition at line 58 of file CSCTFMuonSorter.cc.

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

Referenced by run().

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

◆ run()

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

Definition at line 10 of file CSCTFMuonSorter.cc.

References simKBmtfDigis_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 pwdgSkimBPark_cfi::tracks.

Referenced by CSCTFCandidateBuilder::buildCandidates().

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 }
string quality
void decodeRank(const unsigned &rank, unsigned &quality, unsigned &pt) const
ii
Definition: cuy.py:589
#define LogDebug(id)

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().