2 #ifndef RIVET_MomentumSmearingFunctions_HH 3 #define RIVET_MomentumSmearingFunctions_HH 5 #include "Rivet/Math/Vector4.hh" 6 #include "Rivet/Tools/Random.hh" 18 typedef std::function<FourMomentum(const FourMomentum&)>
P4SmearFn;
21 typedef std::function<double(const FourMomentum&)>
P4EffFn;
37 double operator () (
const FourMomentum& )
const {
return _x; }
50 const double mass = p.
mass2() > 0 ? p.
mass() : 0;
51 const double smeared_E =
max(
randnorm(p.
E(), resolution), mass);
57 const double smeared_pt =
max(
randnorm(p.
pT(), resolution), 0.);
58 const double mass = p.
mass2() > 0 ? p.
mass() : 0;
88 double operator () (
const Vector3& )
const {
return _x; }
100 const double smeared_mod =
max(
randnorm(p.
mod(), resolution), 0.);
101 return smeared_mod * p.
unit();
Definition: MC_Cent_pPb.hh:10
double pT() const
Calculate the transverse momentum .
Definition: Vector4.hh:628
Take a Vector3 and return a constant number.
Definition: MomentumSmearingFunctions.hh:86
double eta() const
Synonym for pseudorapidity.
Definition: Vector4.hh:152
double P3_EFF_ONE(const Vector3 &p)
Take a Vector3 and return 1.
Definition: MomentumSmearingFunctions.hh:81
FourMomentum P4_SMEAR_PERFECT(const FourMomentum &p)
Alias for P4_SMEAR_IDENTITY.
Definition: MomentumSmearingFunctions.hh:45
double P4_FN1(const FourMomentum &)
Definition: MomentumSmearingFunctions.hh:32
static FourMomentum mkEtaPhiMPt(double eta, double phi, double mass, double pt)
Make a vector from (eta,phi,pT) coordinates and the mass.
Definition: Vector4.hh:783
static FourMomentum mkEtaPhiME(double eta, double phi, double mass, double E)
Make a vector from (eta,phi,energy) coordinates and the mass.
Definition: Vector4.hh:778
double mass2() const
Get the squared mass (the Lorentz self-invariant).
Definition: Vector4.hh:572
Take a FourMomentum and return a constant number.
Definition: MomentumSmearingFunctions.hh:35
double P4_EFF_ZERO(const FourMomentum &)
Take a FourMomentum and return 0.
Definition: MomentumSmearingFunctions.hh:25
FourMomentum P4_SMEAR_MASS_GAUSS(const FourMomentum &p, double resolution)
Smear a FourMomentum's mass using a Gaussian of absolute width resolution.
Definition: MomentumSmearingFunctions.hh:63
Vector3 P3_SMEAR_IDENTITY(const Vector3 &p)
Take a Vector3 and return it unmodified.
Definition: MomentumSmearingFunctions.hh:94
double P3_EFF_ZERO(const Vector3 &p)
Take a Vector3 and return 0.
Definition: MomentumSmearingFunctions.hh:76
double P4_FN0(const FourMomentum &)
Definition: MomentumSmearingFunctions.hh:27
FourMomentum P4_SMEAR_E_GAUSS(const FourMomentum &p, double resolution)
Definition: MomentumSmearingFunctions.hh:49
double mass() const
Get the mass (the Lorentz self-invariant).
Definition: Vector4.hh:561
FourMomentum P4_SMEAR_PT_GAUSS(const FourMomentum &p, double resolution)
Smear a FourMomentum's transverse momentum using a Gaussian of absolute width resolution.
Definition: MomentumSmearingFunctions.hh:56
std::function< double(const FourMomentum &)> P4EffFn
Typedef for FourMomentum efficiency functions/functors.
Definition: MomentumSmearingFunctions.hh:21
double E() const
Get energy (time component of momentum).
Definition: Vector4.hh:538
double P3_FN0(const Vector3 &p)
Definition: MomentumSmearingFunctions.hh:78
double max(const vector< double > &in, double errval=DBL_NAN)
Find the maximum value in the vector.
Definition: Utils.hh:612
Vector3 unit() const
Synonym for unitVec.
Definition: Vector3.hh:105
double P4_EFF_ONE(const FourMomentum &)
Take a FourMomentum and return 1.
Definition: MomentumSmearingFunctions.hh:30
FourMomentum P4_SMEAR_IDENTITY(const FourMomentum &p)
Take a FourMomentum and return it unmodified.
Definition: MomentumSmearingFunctions.hh:43
Vector3 P3_SMEAR_LEN_GAUSS(const Vector3 &p, double resolution)
Smear a Vector3's length using a Gaussian of absolute width resolution.
Definition: MomentumSmearingFunctions.hh:99
double phi(const PhiMapping mapping=ZERO_2PI) const
Synonym for azimuthalAngle.
Definition: Vector4.hh:134
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26
Vector3 P3_SMEAR_PERFECT(const Vector3 &p)
Alias for P3_SMEAR_IDENTITY.
Definition: MomentumSmearingFunctions.hh:96
double P3_FN1(const Vector3 &p)
Definition: MomentumSmearingFunctions.hh:83
Specialized version of the FourVector with momentum/energy functionality.
Definition: Vector4.hh:301
double mod() const
Calculate the modulus of a vector. .
Definition: VectorN.hh:95
std::function< FourMomentum(const FourMomentum &)> P4SmearFn
Typedef for FourMomentum smearing functions/functors.
Definition: MomentumSmearingFunctions.hh:18
double randnorm(double loc, double scale)
Return a random number sampled from a Gaussian/normal distribution.