CMS 3D CMS Logo

VBuilders.h
Go to the documentation of this file.
1 //=========================================================================
2 // VBuilders.h
3 //
4 // Functors for building various quantities from grid points. They are
5 // intended for use with "KernelRecombinationAlg" or similar templated
6 // classes.
7 //
8 // I. Volobouev
9 // March 2010
10 //=========================================================================
11 
12 #ifndef RecoJets_FFTJetAlgorithms_VBuilders_h
13 #define RecoJets_FFTJetAlgorithms_VBuilders_h
14 
15 #include <cmath>
16 
18 
19 namespace fftjetcms {
20  struct PtEtaP4Builder {
21  inline math::XYZTLorentzVector operator()(const double pt, const double eta, const double phi) const {
22  const double px = pt * cos(phi);
23  const double py = pt * sin(phi);
24  const double pz = pt * sinh(eta);
25  const double e = sqrt(px * px + py * py + pz * pz);
26  return math::XYZTLorentzVector(px, py, pz, e);
27  }
28  };
29 
31  inline math::XYZTLorentzVector operator()(const double e, const double eta, const double phi) const {
32  // There is no mass associated with this energy... We will
33  // assume that the mass is 0 and proceed as if the energy
34  // is the momentum.
35  const double pt = e / cosh(eta);
36  return math::XYZTLorentzVector(pt * cos(phi), pt * sin(phi), pt * sinh(eta), e);
37  }
38  };
39 } // namespace fftjetcms
40 
41 #endif // RecoJets_FFTJetAlgorithms_VBuilders_h
fftjetcms
Definition: AbsPileupCalculator.h:15
fftjetcms::PtEtaP4Builder
Definition: VBuilders.h:20
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
fftjetcms::EnergyEtaP4Builder::operator()
math::XYZTLorentzVector operator()(const double e, const double eta, const double phi) const
Definition: VBuilders.h:31
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
PVValHelper::eta
Definition: PVValidationHelpers.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
fftjetcms::EnergyEtaP4Builder
Definition: VBuilders.h:30
LorentzVector.h
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
fftjetcms::PtEtaP4Builder::operator()
math::XYZTLorentzVector operator()(const double pt, const double eta, const double phi) const
Definition: VBuilders.h:21
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37