CMS 3D CMS Logo

HOTPDigiTwinMux.cc
Go to the documentation of this file.
2 #include <cstdio>
3 #include <iostream>
4 
5 using namespace std;
6 
7 HOTPDigiTwinMux::HOTPDigiTwinMux(int ieta, int iphi, int bx, int mip, int validbit, int wheel, int sector, int index, int link) {
8 
9  if((ieta > 15) || (ieta < -15)) printf("HOTwinMuxDigi: ieta out of range");
10  if ((mip < 0) || (mip > 1)) printf("HOTwinMuxDigi: mip value out of range");
11 
12  theTP_HO=(std::abs(ieta)&0xF) | ((ieta<0)?(0x10) : (0x00)) |
13  ((iphi&0x7F)<<5) |
14  ((std::abs(bx)&0x1)<<12) | ((bx<0)?(0x2000) : (0x00)) |
15  ((mip&0x1)<<14) |
16  ((validbit&0x1)<<15) |
17  ((std::abs(wheel)&0x3)<<16) | ((wheel<0)?(0x40000) : (0x00)) |
18  ((sector&0xF)<<19) |
19  ((index &0x1F)<<23) | ((link&0x3)<<28);
20 }
21 
22 std::ostream& operator<<(std::ostream& s, const HOTPDigiTwinMux& HOtp) {
23  s << "HO TP digi in TwinMUX "<<HOtp.ieta() <<", " << HOtp.iphi() << ", " << HOtp.mip();
24  s << "(wh, sec, index, link)" <<HOtp.wheel()<<", " << HOtp.sector() <<", "<< HOtp.index() << ", " << HOtp.link();
25  s << "validbit is : "<< HOtp.validbit();
26  return s;
27 }
int ieta() const
get the signed ieta value
HOTPDigiTwinMux()
For the sorted collection.
int link() const
get the link value
int mip() const
get the mip value
int index() const
get the index
int iphi() const
get the raw iphi value
int wheel() const
get the signed wheel value
int sector() const
get the sector value
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::ostream & operator<<(std::ostream &out, const std::tuple< Types... > &value)
Definition: Utilities.h:38
int validbit() const
get the valid bit