Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:28

0001 #ifndef L1TriggerScouting_Utilities_conversion_h
0002 #define L1TriggerScouting_Utilities_conversion_h
0003 
0004 #include "L1TriggerScouting/Utilities/interface/scales.h"
0005 #include <cmath>
0006 
0007 namespace l1ScoutingRun3 {
0008 
0009   inline float _setPhiRange(float phi) {
0010     phi = phi >= M_PI ? phi - 2. * M_PI : phi;
0011     return phi;
0012   }
0013 
0014   namespace ugmt {
0015 
0016     inline float fPt(int hwPt) { return scales::pt_scale * (hwPt - 1); };
0017     inline float fEta(int hwEta) { return scales::eta_scale * hwEta; };
0018     inline float fPhi(int hwPhi) { return _setPhiRange(scales::phi_scale * hwPhi); };
0019     inline float fPtUnconstrained(int hwPtUnconstrained) {
0020       return scales::ptunconstrained_scale * (hwPtUnconstrained - 1);
0021     };
0022     inline float fEtaAtVtx(int hwEtaAtVtx) { return scales::eta_scale * hwEtaAtVtx; };
0023     inline float fPhiAtVtx(int hwPhiAtVtx) { return _setPhiRange(scales::phi_scale * hwPhiAtVtx); };
0024 
0025   }  // namespace ugmt
0026 
0027   namespace demux {
0028 
0029     inline float fEt(int hwEt) { return scales::et_scale * hwEt; };
0030     inline float fEta(int hwEta) { return scales::eta_scale * hwEta; };
0031     inline float fPhi(int hwPhi) { return _setPhiRange(scales::phi_scale * hwPhi); };
0032 
0033   }  // namespace demux
0034 
0035 }  // namespace l1ScoutingRun3
0036 
0037 #endif