3 #include <Math/CylindricalEta3D.h> 4 #include <Math/Polar3D.h> 5 #include <Math/Cartesian3D.h> 6 #include <Math/DisplacementVector3D.h> 7 #include <Math/Functions.h> 32 map<string, Parametrization>::const_iterator itP = parMaps.find(
name);
33 if (itP == parMaps.end()) {
34 throw cms::Exception(
"StringResolutionProvider") <<
"Bad parametrization '" <<
name.c_str() <<
"'";
66 return "EScaledMomDev";
79 ROOT::Math::CylindricalEta3D<double>
converter;
97 ret.SetM(initialP4.mass());
133 ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> >
p = initialP4.Vect(), uz(0, 0, 1), uph, uth;
134 uph = uz.Cross(
p).Unit();
135 uth =
p.Cross(uph).Unit();
139 ret.SetCoordinates(
p.Rho(),
p.Eta(),
p.Phi(), initialP4.mass() *
parameters[3]);
142 ret.SetCoordinates(
p.Rho(),
p.Eta(),
p.Phi(), (
m2 > 0 ?
sqrt(
m2) : 0.0));
145 ret.SetCoordinates(
p.Rho(),
p.Eta(),
p.Phi(), (
m2 > 0 ?
sqrt(
m2) : 0.0));
147 ret.SetCoordinates(
p.Rho(),
p.Eta(),
p.Phi(), initialP4.mass());
156 <<
"getResolEta not yet implemented for parametrization " <<
parametrization;
190 ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> >
p = initialP4.Vect(), uz(0, 0, 1), uph, uth;
191 uph = uz.Cross(
p).Unit();
192 uth =
p.Cross(uph).Unit();
198 ret.SetCoordinates(
p.X(),
p.Y(),
p.Z(),
parameters[3] * initialP4.energy());
200 ret.SetCoordinates(
p.X(),
p.Y(),
p.Z(),
p.R() * initialP4.E() / initialP4.P());
202 ret.SetCoordinates(
p.X(),
p.Y(),
p.Z(),
sqrt(
p.Mag2() + initialP4.mass() * initialP4.mass()));
213 template <
typename T>
234 ret[3] = p4.energy();
253 ret[3] = p4.energy();
256 ret[0] = 1.0 / p4.P();
292 ret[3] = p4.E() / p4.P();
299 <<
"getResolEta not yet implemented for parametrization " <<
parametrization;
361 <<
"diffToParameters not yet implemented for parametrization " <<
parametrization;
393 typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> > V3Cart;
394 V3Cart
p1 = p4ini.Vect(),
p2 = p4fin.Vect();
395 V3Cart ur =
p1.Unit();
397 V3Cart uph = uz.Cross(ur).Unit();
398 V3Cart uth = ur.Cross(uph).Unit();
399 ret[0] =
p2.Dot(ur) /
p1.R() - 1.0;
403 ret[3] = p4fin.mass() / p4ini.mass() - 1.0;
405 ret[3] = p4fin.energy() / p4ini.energy() - 1.0;
412 <<
"diffToParameters not yet implemented for parametrization " <<
parametrization;
438 <<
"isAlwaysMassless not yet implemented for parametrization " <<
parametrization;
463 <<
"isAlwaysMassless not yet implemented for parametrization " <<
parametrization;
488 <<
"isAlwaysMassless not yet implemented for parametrization " <<
parametrization;
539 ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> >
p = initialP4.Vect(), uz(0, 0, 1), uph, uth;
540 uph = uz.Cross(
p).Unit();
541 uth =
p.Cross(uph).Unit();
564 <<
"getResolEta not yet implemented for parametrization " <<
parametrization;
AlgebraicVector4 parametersFromP4(pat::CandKinResolution::Parametrization parametrization, const math::XYZTLorentzVector &p4)
Returns a vector of coordinates values given a coordinate frame and a 4-vector.
const char * name(pat::CandKinResolution::Parametrization param)
Convert a number into a string.
ret
prodAgent to be discontinued
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
parametrization
specify parametrization (see SWGuidePATKinematicResolutions for more details)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void setParametersFromP4(pat::CandKinResolution::Parametrization parametrization, AlgebraicVector4 &pars, const math::XYZTLorentzVector &p4)
Set the values of the parameters for a given 4-momentum.
ROOT::Math::SVector< double, 4 > AlgebraicVector4
bool isAlwaysMassive(pat::CandKinResolution::Parametrization parametrization)
Is this parametrization usable only with massive objects?
math::PtEtaPhiMLorentzVector polarP4fromParameters(pat::CandKinResolution::Parametrization parametrization, const AlgebraicVector4 ¶meters, const math::PtEtaPhiMLorentzVector &initialP4)
AlgebraicVector4 diffToParameters(pat::CandKinResolution::Parametrization parametrization, const math::XYZTLorentzVector &p4ini, const math::XYZTLorentzVector &p4fin)
Expresses the difference between two 4-momentum vectors as a shift in coordinates in a given frame...
bool isPhysical(pat::CandKinResolution::Parametrization parametrization, const AlgebraicVector4 &v4, const math::PtEtaPhiMLorentzVector &initialP4)
math::XYZTLorentzVector p4fromParameters(pat::CandKinResolution::Parametrization parametrization, const AlgebraicVector4 ¶meters, const math::XYZTLorentzVector &initialP4)
void setParametersFromAnyVector(pat::CandKinResolution::Parametrization parametrization, AlgebraicVector4 &pars, const T &p4)
For internal use only, so we provide only the interface. Use the 'setParametersFromP4'.
pat::CandKinResolution::Parametrization fromString(const std::string &name)
Convert a name into a parametrization code.
bool isAlwaysMassless(pat::CandKinResolution::Parametrization parametrization)
Is this parametrization usable only with massless objects?
bool isMassConstrained(pat::CandKinResolution::Parametrization parametrization)
If this parametrization has a mass constraint (including the 'isAlwaysMassless' case) ...