File indexing completed on 2024-04-06 12:25:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef RecoJets_FFTJetAlgorithms_VBuilders_h
0013 #define RecoJets_FFTJetAlgorithms_VBuilders_h
0014
0015 #include <cmath>
0016
0017 #include "DataFormats/Math/interface/LorentzVector.h"
0018
0019 namespace fftjetcms {
0020 struct PtEtaP4Builder {
0021 inline math::XYZTLorentzVector operator()(const double pt, const double eta, const double phi) const {
0022 const double px = pt * cos(phi);
0023 const double py = pt * sin(phi);
0024 const double pz = pt * sinh(eta);
0025 const double e = sqrt(px * px + py * py + pz * pz);
0026 return math::XYZTLorentzVector(px, py, pz, e);
0027 }
0028 };
0029
0030 struct EnergyEtaP4Builder {
0031 inline math::XYZTLorentzVector operator()(const double e, const double eta, const double phi) const {
0032
0033
0034
0035 const double pt = e / cosh(eta);
0036 return math::XYZTLorentzVector(pt * cos(phi), pt * sin(phi), pt * sinh(eta), e);
0037 }
0038 };
0039 }
0040
0041 #endif