File indexing completed on 2024-09-07 04:35:56
0001 #ifndef DataFormats_PatCandidates_interface_ParametrizationHelper_h
0002 #define DataFormats_PatCandidates_interface_ParametrizationHelper_h
0003
0004 #include "DataFormats/PatCandidates/interface/CandKinResolution.h"
0005 #include <string>
0006
0007 namespace pat {
0008 namespace helper {
0009 namespace ParametrizationHelper {
0010
0011
0012 inline uint32_t dimension(pat::CandKinResolution::Parametrization parametrization) {
0013 return (static_cast<uint32_t>(parametrization) & 0x0F);
0014 }
0015
0016
0017 pat::CandKinResolution::Parametrization fromString(const std::string &name);
0018
0019
0020 const char *name(pat::CandKinResolution::Parametrization param);
0021
0022
0023
0024
0025 math::PtEtaPhiMLorentzVector polarP4fromParameters(pat::CandKinResolution::Parametrization parametrization,
0026 const AlgebraicVector4 ¶meters,
0027 const math::PtEtaPhiMLorentzVector &initialP4);
0028
0029
0030
0031
0032 math::XYZTLorentzVector p4fromParameters(pat::CandKinResolution::Parametrization parametrization,
0033 const AlgebraicVector4 ¶meters,
0034 const math::XYZTLorentzVector &initialP4);
0035
0036
0037 AlgebraicVector4 parametersFromP4(pat::CandKinResolution::Parametrization parametrization,
0038 const math::XYZTLorentzVector &p4);
0039
0040
0041 AlgebraicVector4 parametersFromP4(pat::CandKinResolution::Parametrization parametrization,
0042 const math::PtEtaPhiMLorentzVector &p4);
0043
0044
0045 void setParametersFromP4(pat::CandKinResolution::Parametrization parametrization,
0046 AlgebraicVector4 &pars,
0047 const math::XYZTLorentzVector &p4);
0048
0049
0050 void setParametersFromP4(pat::CandKinResolution::Parametrization parametrization,
0051 AlgebraicVector4 &pars,
0052 const math::PtEtaPhiMLorentzVector &p4);
0053
0054
0055 template <typename T>
0056 void setParametersFromAnyVector(pat::CandKinResolution::Parametrization parametrization,
0057 AlgebraicVector4 &pars,
0058 const T &p4);
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 AlgebraicVector4 diffToParameters(pat::CandKinResolution::Parametrization parametrization,
0070 const math::XYZTLorentzVector &p4ini,
0071 const math::XYZTLorentzVector &p4fin);
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 AlgebraicVector4 diffToParameters(pat::CandKinResolution::Parametrization parametrization,
0083 const math::PtEtaPhiMLorentzVector &p4ini,
0084 const math::PtEtaPhiMLorentzVector &p4fin);
0085
0086
0087 bool isAlwaysMassless(pat::CandKinResolution::Parametrization parametrization);
0088
0089
0090 bool isAlwaysMassive(pat::CandKinResolution::Parametrization parametrization);
0091
0092
0093 bool isMassConstrained(pat::CandKinResolution::Parametrization parametrization);
0094
0095
0096
0097
0098
0099
0100 bool isPhysical(pat::CandKinResolution::Parametrization parametrization,
0101 const AlgebraicVector4 &v4,
0102 const math::PtEtaPhiMLorentzVector &initialP4);
0103 }
0104 }
0105 }
0106
0107 #endif