CMS 3D CMS Logo

Functions | Variables
MakeRegionalCand.h File Reference
#include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
#include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
#include <cmath>

Go to the source code of this file.

Functions

float GetGlobalEta (int theta, int sector)
 
int GetPackedEta (int theta, int sector)
 
int GetPackedPhi (int phi)
 
l1t::RegionalMuonCand MakeRegionalCand (float pt, int phi, int theta, int sign, int mode, int trackaddress, int sector)
 

Variables

int GMT_eta_from_theta [128]
 

Function Documentation

float GetGlobalEta ( int  theta,
int  sector 
)

Definition at line 36 of file MakeRegionalCand.h.

References GetPackedEta().

Referenced by MakeRegionalCand().

36  { // Should use calc_eta to compute - AWB 07.05.16
37 
38  // Underlying calculation:
39  // float theta_angle = (theta*0.2851562 + 8.5)*(pi/180);
40  // float eta = (-1)*log(tan(theta_angle/2));
41 
42  return 0.010875 * GetPackedEta(theta, sector);
43 }
Geom::Theta< T > theta() const
int GetPackedEta(int theta, int sector)
int GetPackedEta ( int  theta,
int  sector 
)

Definition at line 23 of file MakeRegionalCand.h.

References GMT_eta_from_theta, and theta().

Referenced by GetGlobalEta(), and MakeRegionalCand().

23  {
24 
25  if (theta < 0) return 0;
26  if (sector > 5) {
27  if (theta > 127) return -240;
28  else return -1*GMT_eta_from_theta[theta] - 1;
29  }
30  else {
31  if (theta > 127) return 239;
32  else return GMT_eta_from_theta[theta];
33  }
34 }
Geom::Theta< T > theta() const
int GMT_eta_from_theta[128]
int GetPackedPhi ( int  phi)

Definition at line 45 of file MakeRegionalCand.h.

Referenced by MakeRegionalCand().

45  {
46 
47  // Experimentally, this factor must be between 0.979752 and 0.979758 - AWB 11.05.16
48  float phiDeg = (phi / (0.625 * 60)) * 0.979755;
49  int PackedPhi = floor( phiDeg - 35 );
50 
51  return PackedPhi;
52 
53 }
l1t::RegionalMuonCand MakeRegionalCand ( float  pt,
int  phi,
int  theta,
int  sign,
int  mode,
int  trackaddress,
int  sector 
)

Definition at line 56 of file MakeRegionalCand.h.

References l1t::emtf_neg, l1t::emtf_pos, stringResolutionProvider_cfi::eta, GetGlobalEta(), GetPackedEta(), GetPackedPhi(), l1t::RegionalMuonCand::setHwEta(), l1t::RegionalMuonCand::setHwPhi(), l1t::RegionalMuonCand::setHwPt(), l1t::RegionalMuonCand::setHwQual(), l1t::RegionalMuonCand::setHwSign(), l1t::RegionalMuonCand::setHwSignValid(), and l1t::RegionalMuonCand::setTFIdentifiers().

Referenced by L1TMuonEndCapTrackProducer::produce().

58  {
59 
61 
62  int iEta = GetPackedEta(theta,sector);
63  int iPhi = GetPackedPhi(phi);
64 
66  if(sector > 5){
67  TFtype = l1t::tftype::emtf_neg;
68  sector -= 6;
69  }
70 
71  // compressed pt = pt*2 (scale) + 1 (iPt = 0 is empty candidate)
72  int iPt = pt*2 + 1;
73  if(iPt > 511)
74  iPt = 511;
75 
76  if(iPt < 0)
77  iPt = 0;
78 
79  int iQual = -999;
80 
81  int LSB = mode & 3;
82 
83  float eta = GetGlobalEta(theta,sector);
84 
85  if(eta < 1.2){
86 
87  switch(mode){
88  case(15): iQual = 8;break;
89  case(14): iQual = 4;break;
90  case(13): iQual = 4;break;
91  case(12): iQual = 4;break;
92  case(11): iQual = 4;break;
93  default: iQual = 4;break;
94  }
95 
96  }
97  else{
98 
99  switch(mode){
100  case(15): iQual = 12;break;
101  case(14): iQual = 12;break;
102  case(13): iQual = 12;break;
103  case(12): iQual = 8;break;
104  case(11): iQual = 12;break;
105  case(10): iQual = 8;break;
106  case(7): iQual = 8;break;
107  default: iQual = 4;break;
108  }
109 
110  }
111  iQual |= LSB;
112 
113  Cand.setHwPt(iPt);
114  Cand.setHwEta(iEta);
115  Cand.setHwPhi(iPhi);
116  Cand.setHwSign(sign);
117  Cand.setHwSignValid(1);
118  Cand.setHwQual(iQual);
119  // jl: FIXME this has to be adapted to the new schema of saving track addresses
120  //Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME12, trackaddress&0xf);
121  //Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME22, trackaddress>>4);
122  Cand.setTFIdentifiers(sector,TFtype);
123 
124  return Cand;
125 
126 }
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
Geom::Theta< T > theta() const
int GetPackedPhi(int phi)
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
float GetGlobalEta(int theta, int sector)
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
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)
int GetPackedEta(int theta, int sector)
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))

Variable Documentation

int GMT_eta_from_theta[128]
Initial value:
= {239, 235, 233, 230, 227, 224, 222, 219, 217, 214, 212, 210, 207, 205, 203, 201,
199, 197, 195, 193, 191, 189, 187, 186, 184, 182, 180, 179, 177, 176, 174, 172,
171, 169, 168, 166, 165, 164, 162, 161, 160, 158, 157, 156, 154, 153, 152, 151,
149, 148, 147, 146, 145, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133,
132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117,
116, 116, 115, 114, 113, 112, 111, 110, 110, 109, 108, 107, 106, 106, 105, 104,
103, 102, 102, 101, 100, 99, 99, 98, 97, 96, 96, 95, 94, 93, 93, 92,
91, 91, 90, 89, 89, 88, 87, 87, 86, 85, 84, 84, 83, 83, 82, 81}

Definition at line 14 of file MakeRegionalCand.h.

Referenced by GetPackedEta().