CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OmtfMuonUnpacker.cc
Go to the documentation of this file.
2 
4 
6 
7 namespace omtf {
8 
9  void MuonUnpacker::unpack(unsigned int fed,
10  unsigned int amc,
11  const MuonDataWord64 &data,
12  l1t::RegionalMuonCandBxCollection *producedMuonDigis) {
13  LogTrace("") << "OMTF->MUON " << std::endl;
14  LogTrace("") << data << std::endl;
16  unsigned int iProcessor = amc - 1; //0-5
18  digi.setHwPt(data.pT());
19  digi.setHwEta(data.eta());
20  digi.setHwPhi(data.phi());
21  digi.setHwSign(data.ch());
22  digi.setHwSignValid(data.vch());
23  digi.setHwQual(data.quality());
24  std::map<int, int> trackAddr;
25  trackAddr[0] = data.layers();
26  trackAddr[1] = 0;
27  trackAddr[2] = data.weight_lowBits();
28  digi.setTrackAddress(trackAddr);
29  digi.setTFIdentifiers(iProcessor, overlap);
30  int bx = data.bxNum() - 3;
31  LogTrace("") << "OMTF Muon, BX=" << bx << ", hwPt=" << digi.hwPt() << ", link: " << digi.link() << std::endl;
32 
33  // add digi to collection, keep fixed ascending link orderi (insert in proper place)
34  l1t::RegionalMuonCandBxCollection::const_iterator itb = producedMuonDigis->begin(bx);
35  l1t::RegionalMuonCandBxCollection::const_iterator ite = producedMuonDigis->end(bx);
36  unsigned int indeks = 0;
37  while (indeks < ite - itb) {
38  if (digi.link() < (itb + indeks)->link())
39  break;
40  indeks++;
41  }
42  producedMuonDigis->insert(bx, indeks, digi);
43  }
44 
45 } // namespace omtf
const_iterator end(int bx) const
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
void insert(int bx, unsigned i, T object)
unsigned int pT() const
unsigned int bxNum() const
unsigned int quality() const
void setTrackAddress(const std::map< int, int > &address)
Set the whole track address.
#define LogTrace(id)
unsigned int layers() const
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
std::vector< RegionalMuonCand >::const_iterator const_iterator
Definition: BXVector.h:18
double amc
Definition: hdecay.h:20
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
const int link() const
Get link on which the MicroGMT receives the candidate.
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
unsigned int weight_lowBits() const
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)
unsigned int ch() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const int hwPt() const
Get compressed pT (returned int * 0.5 = pT (GeV))
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
void unpack(unsigned int fed, unsigned int amc, const MuonDataWord64 &raw, l1t::RegionalMuonCandBxCollection *muColl)
const_iterator begin(int bx) const
unsigned int vch() const
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))