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 ( const edm::ParameterSet pset)

Definition at line 5 of file CSCTFMuonSorter.cc.

References edm::ParameterSet::getParameter(), m_maxBX, and m_minBX.

6 {
7  m_minBX = pset.getParameter<int>("MinBX");
8  m_maxBX = pset.getParameter<int>("MaxBX");
9 }
T getParameter(std::string const &) const

Member Function Documentation

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

Definition at line 61 of file CSCTFMuonSorter.cc.

References L1MuRegionalCand::PT_LENGTH.

Referenced by run().

63 {
64  if(rank == 0)
65  {
66  quality = 0;
67  pt = 0;
68  }
69  else
70  {
72  pt = rank & ( (1<<L1MuRegionalCand::PT_LENGTH) - 1);
73  }
74 }
std::vector< L1MuRegionalCand > CSCTFMuonSorter::run ( const CSCTriggerContainer< csc::L1Track > &  tracks) const

Definition at line 11 of file CSCTFMuonSorter.cc.

References decodeRank(), end, L1MuRegionalCand::ETA_LENGTH, CSCTriggerContainer< T >::get(), cuy::ii, CSCConstants::LCT_CENTRAL_BX, LogDebug, m_maxBX, m_minBX, EnergyCorrector::pt, jets_cff::quality, and mps_fire::result.

Referenced by CSCTFCandidateBuilder::buildCandidates().

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

Member Data Documentation

int CSCTFMuonSorter::m_maxBX
private

Definition at line 19 of file CSCTFMuonSorter.h.

Referenced by CSCTFMuonSorter(), and run().

int CSCTFMuonSorter::m_minBX
private

Definition at line 19 of file CSCTFMuonSorter.h.

Referenced by CSCTFMuonSorter(), and run().