Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:59

0001 #include "DataFormats/L1Trigger/interface/HOTPDigiTwinMux.h"
0002 #include <cstdio>
0003 #include <iostream>
0004 
0005 using namespace std;
0006 
0007 HOTPDigiTwinMux::HOTPDigiTwinMux(
0008     int ieta, int iphi, int bx, int mip, int validbit, int wheel, int sector, int index, int link) {
0009   if ((ieta > 15) || (ieta < -15))
0010     printf("HOTwinMuxDigi:  ieta out of range");
0011   if ((mip < 0) || (mip > 1))
0012     printf("HOTwinMuxDigi: mip value out of range");
0013 
0014   theTP_HO = (std::abs(ieta) & 0xF) | ((ieta < 0) ? (0x10) : (0x00)) | ((iphi & 0x7F) << 5) |
0015              ((std::abs(bx) & 0x1) << 12) | ((bx < 0) ? (0x2000) : (0x00)) | ((mip & 0x1) << 14) |
0016              ((validbit & 0x1) << 15) | ((std::abs(wheel) & 0x3) << 16) | ((wheel < 0) ? (0x40000) : (0x00)) |
0017              ((sector & 0xF) << 19) | ((index & 0x1F) << 23) | ((link & 0x3) << 28);
0018 }
0019 
0020 std::ostream& operator<<(std::ostream& s, const HOTPDigiTwinMux& HOtp) {
0021   s << "HO TP digi in TwinMUX " << HOtp.ieta() << ", " << HOtp.iphi() << ", " << HOtp.mip();
0022   s << "(wh, sec, index, link)" << HOtp.wheel() << ", " << HOtp.sector() << ", " << HOtp.index() << ", " << HOtp.link();
0023   s << "validbit is : " << HOtp.validbit();
0024   return s;
0025 }