CMS 3D CMS Logo

conversion.h
Go to the documentation of this file.
1 #ifndef L1TriggerScouting_Utilities_conversion_h
2 #define L1TriggerScouting_Utilities_conversion_h
3 
5 #include <cmath>
6 
7 namespace l1ScoutingRun3 {
8 
9  inline float _setPhiRange(float phi) {
10  phi = phi >= M_PI ? phi - 2. * M_PI : phi;
11  return phi;
12  }
13 
14  namespace ugmt {
15 
16  inline float fPt(int hwPt) { return scales::pt_scale * (hwPt - 1); };
17  inline float fEta(int hwEta) { return scales::eta_scale * hwEta; };
18  inline float fPhi(int hwPhi) { return _setPhiRange(scales::phi_scale * hwPhi); };
19  inline float fPtUnconstrained(int hwPtUnconstrained) {
21  };
22  inline float fEtaAtVtx(int hwEtaAtVtx) { return scales::eta_scale * hwEtaAtVtx; };
23  inline float fPhiAtVtx(int hwPhiAtVtx) { return _setPhiRange(scales::phi_scale * hwPhiAtVtx); };
24 
25  } // namespace ugmt
26 
27  namespace demux {
28 
29  inline float fEt(int hwEt) { return scales::et_scale * hwEt; };
30  inline float fEta(int hwEta) { return scales::eta_scale * hwEta; };
31  inline float fPhi(int hwPhi) { return _setPhiRange(scales::phi_scale * hwPhi); };
32 
33  } // namespace demux
34 
35 } // namespace l1ScoutingRun3
36 
37 #endif
static constexpr float eta_scale
Definition: scales.h:24
float _setPhiRange(float phi)
Definition: conversion.h:9
static constexpr float pt_scale
Definition: scales.h:13
static constexpr float et_scale
Definition: scales.h:25
float fEta(int hwEta)
Definition: conversion.h:30
float fEt(int hwEt)
Definition: conversion.h:29
float fPtUnconstrained(int hwPtUnconstrained)
Definition: conversion.h:19
float fEtaAtVtx(int hwEtaAtVtx)
Definition: conversion.h:22
static constexpr float ptunconstrained_scale
Definition: scales.h:14
static constexpr float phi_scale
Definition: scales.h:15
float fPhiAtVtx(int hwPhiAtVtx)
Definition: conversion.h:23
float fPhi(int hwPhi)
Definition: conversion.h:18
#define M_PI
float fPhi(int hwPhi)
Definition: conversion.h:31
float fPt(int hwPt)
Definition: conversion.h:16
static constexpr float phi_scale
Definition: scales.h:23
static constexpr float eta_scale
Definition: scales.h:16
float fEta(int hwEta)
Definition: conversion.h:17