CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
MakeRegionalCand.h File Reference
#include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
#include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"

Go to the source code of this file.

Functions

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

Function Documentation

int GetPackedEta ( float  theta,
int  sector 
)

Definition at line 14 of file MakeRegionalCand.h.

References eta, dqm-mbProfile::log, pileupReCalc_HLTpaths::scale, and funct::tan().

Referenced by MakeRegionalCand().

14  {
15 
16  float scale = 1/0.010875;
17 
18  float theta_angle = (theta*0.2851562 + 8.5)*(3.14159265359/180);
19  float eta = (-1)*log(tan(theta_angle/2));
20  if(sector > 5)
21  eta *= -1;
22 
23  int PackedEta = eta*scale;
24  if(eta < 0)
25  PackedEta -= 1;
26 
27  if(PackedEta > 239)
28  PackedEta = 239;
29 
30  if(PackedEta < -240)
31  PackedEta = -240;
32 
33  //if(PackedEta < 0)
34  // PackedEta = 512 + PackedEta;
35 
36  return PackedEta;
37 
38 }
Geom::Theta< T > theta() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
int GetPackedPhi ( int  phi)

Definition at line 40 of file MakeRegionalCand.h.

Referenced by MakeRegionalCand().

40  {
41 
42  float phiDeg = (phi*0.0166666);
43  phiDeg -= 2.0;
44 
45 
46  int PackedPhi = phiDeg/0.625;
47 
48  //if(PackedPhi < 0)
49  // PackedPhi = 256 + PackedPhi;
50 
51  return PackedPhi;
52 
53 }
Geom::Phi< T > phi() const
l1t::RegionalMuonCand MakeRegionalCand ( float  pt,
int  phi,
int  theta,
int  sign,
int  quality,
int  trackaddress,
int  sector 
)

Definition at line 56 of file MakeRegionalCand.h.

References l1t::emtf_neg, l1t::emtf_pos, GetPackedEta(), GetPackedPhi(), HLT_FULL_cff::quality, 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 = quality;
80 
81  Cand.setHwPt(iPt);
82  Cand.setHwEta(iEta);
83  Cand.setHwPhi(iPhi);
84  Cand.setHwSign(1);
85  Cand.setHwSignValid(0);
86  Cand.setHwQual(iQual);
87  // jl: FIXME this has to be adapted to the new schema of saving track addresses
88  //Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME12, trackaddress&0xf);
89  //Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME22, trackaddress>>4);
90  Cand.setTFIdentifiers(sector,TFtype);
91 
92 
93  return Cand;
94 
95 }
int GetPackedEta(float theta, int sector)
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.
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)
Geom::Phi< T > phi() const
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))