Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:47

0001 #include <L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h>
0002 #include <iostream>
0003 
0004 local_phi_address& local_phi_address::operator=(const unsigned& u) {
0005   this->strip = ((1 << 8) - 1) & u;
0006   this->clct_pattern = ((1 << 3) - 1) & (u >> 8);
0007   this->pattern_type = 1 & (u >> 11);
0008   this->quality = ((1 << 4) - 1) & (u >> 12);
0009   this->lr = 1 & (u >> 16);
0010 
0011   return *this;
0012 }
0013 
0014 global_phi_address& global_phi_address::operator=(const unsigned& u) {
0015   this->phi_local = ((1 << 10) - 1) & u;
0016   this->wire_group = ((1 << 5) - 1) & (u >> 10);
0017   this->cscid = ((1 << 4) - 1) & (u >> 15);
0018 
0019   return *this;
0020 }
0021 
0022 global_eta_address& global_eta_address::operator=(const unsigned& u) {
0023   this->phi_bend = ((1 << 6) - 1) & u;
0024   this->phi_local = ((1 << 2) - 1) & (u >> 6);
0025   this->wire_group = ((1 << 7) - 1) & (u >> 8);
0026   this->cscid = ((1 << 4) - 1) & (u >> 15);
0027 
0028   return *this;
0029 }
0030 
0031 pt_address& pt_address::operator=(const unsigned& u) {
0032   this->delta_phi_12 = ((1 << 8) - 1) & u;
0033   this->delta_phi_23 = ((1 << 4) - 1) & (u >> 8);
0034   this->track_eta = ((1 << 4) - 1) & (u >> 12);
0035   this->track_mode = ((1 << 4) - 1) & (u >> 16);
0036   this->delta_phi_sign = ((1 << 1) - 1) & (u >> 20);
0037   this->track_fr = ((1 << 1) - 1) & (u >> 21);
0038 
0039   return *this;
0040 }
0041 
0042 local_phi_data& local_phi_data::operator=(const unsigned short& us) {
0043   this->phi_local = ((1 << 10) - 1) & us;
0044   this->phi_bend_local = ((1 << 6) - 1) & (us >> 10);
0045 
0046   return *this;
0047 }
0048 
0049 global_phi_data& global_phi_data::operator=(const unsigned short& us) {
0050   this->global_phi = ((1 << 12) - 1) & us;
0051 
0052   return *this;
0053 }
0054 
0055 global_eta_data& global_eta_data::operator=(const unsigned short& us) {
0056   this->global_eta = ((1 << 7) - 1) & us;
0057   this->global_bend = ((1 << 5) - 1) & (us >> 7);
0058 
0059   return *this;
0060 }
0061 
0062 pt_data& pt_data::operator=(const unsigned short& us) {
0063   this->front_rank = ((1 << 7) - 1) & us;
0064   this->charge_valid_front = ((1 << 1) - 1) & (us >> 7);
0065   this->rear_rank = ((1 << 7) - 1) & (us >> 8);
0066   this->charge_valid_rear = ((1 << 1) - 1) & (us >> 15);
0067 
0068   return *this;
0069 }
0070 
0071 unsigned short local_phi_data::toint() const {
0072   unsigned short us = 0;
0073   us = (phi_local | (phi_bend_local << 10));
0074   return us;
0075 }
0076 
0077 unsigned short global_eta_data::toint() const {
0078   unsigned short us = 0;
0079   us = (global_eta | (global_bend << 7));
0080   return us;
0081 }
0082 
0083 unsigned short global_phi_data::toint() const {
0084   unsigned short us = 0;
0085   us = global_phi;
0086   return us;
0087 }
0088 
0089 unsigned short pt_data::toint() const {
0090   unsigned short us = 0;
0091   us = front_rank | (charge_valid_front << 7) | (rear_rank << 8) | (charge_valid_rear << 15);
0092   return us;
0093 }
0094 
0095 unsigned local_phi_address::toint() const {
0096   unsigned u = 0;
0097   u = strip | (clct_pattern << 8) | (pattern_type << 11) | (quality << 12) | (lr << 16);
0098   return u;
0099 }
0100 
0101 unsigned global_eta_address::toint() const {
0102   unsigned u = 0;
0103   u = phi_bend | (phi_local << 6) | (wire_group << 8) | (cscid << 15);
0104   return u;
0105 }
0106 
0107 unsigned global_phi_address::toint() const {
0108   unsigned u = 0;
0109   u = phi_local | (wire_group << 10) | (cscid << 15);
0110   return u;
0111 }
0112 
0113 unsigned pt_address::toint() const {
0114   unsigned u = 0;
0115   u = delta_phi_12 | (delta_phi_23 << 8) | (track_eta << 12) | (track_mode << 16) | (delta_phi_sign << 20) |
0116       (track_fr << 21);
0117   return u;
0118 }
0119 
0120 unsigned pt_address::delta_phi() const { return (delta_phi_12 | (delta_phi_23 << 8)); }