Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:39

0001 // Class to store the 96-bit TkJet word for L1 Track Trigger.
0002 // Author: Benjamin Radburn-Smith (September 2022)
0003 
0004 #include "DataFormats/L1Trigger/interface/TkJetWord.h"
0005 
0006 namespace l1t {
0007   TkJetWord::TkJetWord(pt_t pt,
0008                        glbeta_t eta,
0009                        glbphi_t phi,
0010                        z0_t z0,
0011                        nt_t nt,
0012                        nx_t nx,
0013                        dispflag_t dispflag,
0014                        tkjetunassigned_t unassigned) {
0015     setTkJetWord(pt, eta, phi, z0, nt, nx, dispflag, unassigned);
0016   }
0017 
0018   void TkJetWord::setTkJetWord(pt_t pt,
0019                                glbeta_t eta,
0020                                glbphi_t phi,
0021                                z0_t z0,
0022                                nt_t nt,
0023                                nx_t nx,
0024                                dispflag_t dispflag,
0025                                tkjetunassigned_t unassigned) {
0026     // pack the TkJet word
0027     unsigned int offset = 0;
0028     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kPtSize); b++) {
0029       tkJetWord_.set(b, pt[b - offset]);
0030     }
0031     offset += TkJetBitWidths::kPtSize;
0032     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kGlbPhiSize); b++) {
0033       tkJetWord_.set(b, phi[b - offset]);
0034     }
0035     offset += TkJetBitWidths::kGlbPhiSize;
0036     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kGlbEtaSize); b++) {
0037       tkJetWord_.set(b, eta[b - offset]);
0038     }
0039     offset += TkJetBitWidths::kGlbEtaSize;
0040     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kZ0Size); b++) {
0041       tkJetWord_.set(b, z0[b - offset]);
0042     }
0043     offset += TkJetBitWidths::kZ0Size;
0044     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kNtSize); b++) {
0045       tkJetWord_.set(b, nt[b - offset]);
0046     }
0047     offset += TkJetBitWidths::kNtSize;
0048     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kXtSize); b++) {
0049       tkJetWord_.set(b, nx[b - offset]);
0050     }
0051     offset += TkJetBitWidths::kXtSize;
0052     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kDispFlagSize); b++) {
0053       tkJetWord_.set(b, nx[b - offset]);
0054     }
0055     offset += TkJetBitWidths::kDispFlagSize;
0056     for (unsigned int b = offset; b < (offset + TkJetBitWidths::kUnassignedSize); b++) {
0057       tkJetWord_.set(b, unassigned[b - offset]);
0058     }
0059   }
0060 
0061 }  //namespace l1t