CMS 3D CMS Logo

Functions
emtf::phase2::tp Namespace Reference

Functions

float calcPhiGlobDegFromLoc (int, float)
 
float calcPhiGlobRadFromLoc (int, float)
 
int calcPhiInt (int, float)
 
float calcPhiLocDegFromGlob (int, float)
 
float calcPhiLocDegFromInt (int)
 
float calcPhiLocRadFromInt (int)
 
float calcThetaDegFromEta (float)
 
float calcThetaDegFromInt (int)
 
int calcThetaInt (int, float)
 
float calcThetaRadFromEta (float)
 
float calcThetaRadFromInt (int)
 
float degToRad (float deg)
 
float radToDeg (float rad)
 
float wrapPhiDeg (float)
 
float wrapPhiRad (float)
 

Function Documentation

◆ calcPhiGlobDegFromLoc()

float emtf::phase2::tp::calcPhiGlobDegFromLoc ( int  sector,
float  loc 
)

Definition at line 77 of file TPUtils.cc.

References nano_mu_digi_cff::sector.

Referenced by calcPhiGlobRadFromLoc().

77  { // loc in deg, sector [1..6]
78  float glob = loc + 15. + (60. * (sector - 1));
79 
80  glob = (glob >= 180.) ? (glob - 360.) : glob;
81 
82  return glob;
83  }

◆ calcPhiGlobRadFromLoc()

float emtf::phase2::tp::calcPhiGlobRadFromLoc ( int  sector,
float  loc 
)

Definition at line 85 of file TPUtils.cc.

References calcPhiGlobDegFromLoc(), degToRad(), radToDeg(), and nano_mu_digi_cff::sector.

Referenced by Phase2L1TGMTFwdMuonTranslator::ConvertEMTFTrack().

85  { // loc in rad, sector [1..6]
86  float glob = degToRad(calcPhiGlobDegFromLoc(sector, radToDeg(loc)));
87 
88  return glob;
89  }
float calcPhiGlobDegFromLoc(int, float)
Definition: TPUtils.cc:77
float radToDeg(float rad)
Definition: TPUtils.cc:14
float degToRad(float deg)
Definition: TPUtils.cc:9

◆ calcPhiInt()

int emtf::phase2::tp::calcPhiInt ( int  sector,
float  glob 
)

Definition at line 113 of file TPUtils.cc.

References calcPhiLocDegFromGlob(), and nano_mu_digi_cff::sector.

Referenced by emtf::phase2::GE0TPConverter::convert(), emtf::phase2::RPCTPConverter::convert(), emtf::phase2::ME0TPConverter::convert(), emtf::phase2::GEMTPConverter::convert(), and emtf::phase2::CSCTPConverter::convert().

113  { // glob in deg [-180..180], sector [1..6]
114  float loc = calcPhiLocDegFromGlob(sector, glob);
115 
116  loc = ((loc + 22.) < 0.) ? (loc + 360.) : loc;
117  loc = (loc + 22.) * 60.;
118 
119  int phi_int = static_cast<int>(std::round(loc));
120 
121  return phi_int;
122  }
float calcPhiLocDegFromGlob(int, float)
Definition: TPUtils.cc:105

◆ calcPhiLocDegFromGlob()

float emtf::phase2::tp::calcPhiLocDegFromGlob ( int  sector,
float  glob 
)

Definition at line 105 of file TPUtils.cc.

References nano_mu_digi_cff::sector, and wrapPhiDeg().

Referenced by calcPhiInt().

105  { // glob in deg [-180..180], sector [1..6]
106  glob = wrapPhiDeg(glob);
107 
108  float loc = glob - 15. - (60. * (sector - 1));
109 
110  return loc;
111  }
float wrapPhiDeg(float)
Definition: TPUtils.cc:22

◆ calcPhiLocDegFromInt()

float emtf::phase2::tp::calcPhiLocDegFromInt ( int  phi_int)

Definition at line 91 of file TPUtils.cc.

Referenced by calcPhiLocRadFromInt().

91  {
92  float loc = static_cast<float>(phi_int);
93 
94  loc = (loc / 60.) - 22.;
95 
96  return loc;
97  }

◆ calcPhiLocRadFromInt()

float emtf::phase2::tp::calcPhiLocRadFromInt ( int  phi_int)

Definition at line 99 of file TPUtils.cc.

References calcPhiLocDegFromInt(), and degToRad().

Referenced by Phase2L1TGMTFwdMuonTranslator::ConvertEMTFTrack().

99  {
100  float loc = degToRad(calcPhiLocDegFromInt(phi_int));
101 
102  return loc;
103  }
float calcPhiLocDegFromInt(int)
Definition: TPUtils.cc:91
float degToRad(float deg)
Definition: TPUtils.cc:9

◆ calcThetaDegFromEta()

float emtf::phase2::tp::calcThetaDegFromEta ( float  eta)

Definition at line 44 of file TPUtils.cc.

References calcThetaRadFromEta(), PVValHelper::eta, radToDeg(), and theta().

44  {
46 
47  return theta;
48  }
float radToDeg(float rad)
Definition: TPUtils.cc:14
float calcThetaRadFromEta(float)
Definition: TPUtils.cc:38
Geom::Theta< T > theta() const

◆ calcThetaDegFromInt()

float emtf::phase2::tp::calcThetaDegFromInt ( int  theta_int)

Definition at line 56 of file TPUtils.cc.

References theta().

Referenced by calcThetaRadFromInt().

56  {
57  float theta = static_cast<float>(theta_int);
58 
59  theta = theta * (45.0 - 8.5) / 128. + 8.5;
60 
61  return theta;
62  }
Geom::Theta< T > theta() const

◆ calcThetaInt()

int emtf::phase2::tp::calcThetaInt ( int  endcap,
float  theta 
)

Definition at line 64 of file TPUtils.cc.

References makeMuonMisalignmentScenario::endcap, and theta().

Referenced by emtf::phase2::GE0TPConverter::convert(), emtf::phase2::RPCTPConverter::convert(), emtf::phase2::ME0TPConverter::convert(), emtf::phase2::GEMTPConverter::convert(), and emtf::phase2::CSCTPConverter::convert().

64  { // theta in deg [0..180], endcap [-1, +1]
65  theta = (endcap == -1) ? (180. - theta) : theta;
66  theta = (theta - 8.5) * 128. / (45.0 - 8.5);
67 
68  int theta_int = static_cast<int>(std::round(theta));
69 
70  theta_int = (theta_int <= 0) ? 1 : theta_int; // protect against invalid value
71 
72  return theta_int;
73  }
Geom::Theta< T > theta() const

◆ calcThetaRadFromEta()

float emtf::phase2::tp::calcThetaRadFromEta ( float  eta)

Definition at line 38 of file TPUtils.cc.

References PVValHelper::eta, and theta().

Referenced by calcThetaDegFromEta().

38  {
39  float theta = std::atan2(1.0, std::sinh(eta)); // cot(theta) = sinh(eta)
40 
41  return theta;
42  }
Geom::Theta< T > theta() const

◆ calcThetaRadFromInt()

float emtf::phase2::tp::calcThetaRadFromInt ( int  theta_int)

Definition at line 50 of file TPUtils.cc.

References calcThetaDegFromInt(), degToRad(), and theta().

Referenced by Phase2L1TGMTFwdMuonTranslator::ConvertEMTFTrack().

50  {
51  float theta = degToRad(calcThetaDegFromInt(theta_int));
52 
53  return theta;
54  }
float calcThetaDegFromInt(int)
Definition: TPUtils.cc:56
Geom::Theta< T > theta() const
float degToRad(float deg)
Definition: TPUtils.cc:9

◆ degToRad()

float emtf::phase2::tp::degToRad ( float  deg)

◆ radToDeg()

float emtf::phase2::tp::radToDeg ( float  rad)

◆ wrapPhiDeg()

float emtf::phase2::tp::wrapPhiDeg ( float  deg)

Definition at line 22 of file TPUtils.cc.

Referenced by calcPhiLocDegFromGlob().

22  {
23  float twopi = 360.;
24  float recip = 1.0 / twopi;
25 
26  return deg - (std::round(deg * recip) * twopi);
27  }

◆ wrapPhiRad()

float emtf::phase2::tp::wrapPhiRad ( float  rad)

Definition at line 29 of file TPUtils.cc.

References M_PI.

29  {
30  const float twopi = M_PI * 2.;
31  const float recip = 1.0 / twopi;
32 
33  return rad - (std::round(rad * recip) * twopi);
34  }
#define M_PI