59 string field (
string s,
int i)
73 pos = s.find (
'/', pos);
74 if (pos == string::npos)
81 if (pos2 != string::npos)
84 while (pos < pos2 && isspace (s[pos]))
87 return s.substr (pos, pos2);
119 : _p_res (field (s, 0)),
120 _eta_res (field (s, 1)),
121 _phi_res (field (s, 2)),
122 _use_et (field (s, 3) ==
"et")
223 double ee = use_et ? v.perp() : v.e();
224 return res.
sigma (ee);
242 double sig = find_sigma (v, _p_res, _use_et);
244 if(_p_res.inverse()){
245 sig *= v.perp() / v.e();
247 sig *= v.e() / v.perp();
265 return find_sigma (v, _eta_res, _use_et);
280 return find_sigma (v, _phi_res, _use_et);
299 void smear_eta (
Fourvec& v,
double ee,
300 const Resolution& res, CLHEP::HepRandomEngine& engine)
314 double rot = res.
pick (0, ee, engine);
330 void smear_phi (
Fourvec& v,
double ee,
331 const Resolution& res, CLHEP::HepRandomEngine& engine)
345 double rot = res.pick (0, ee, engine);
354 CLHEP::HepRandomEngine& engine,
355 bool do_smear_dir )
const
368 double ee = _use_et ? v.perp() : v.e();
369 v *= _p_res.pick (ee, ee, engine) / ee;
372 smear_eta (v, ee, _eta_res, engine);
373 smear_phi (v, ee, _phi_res, engine);
Calculate and represent resolution for a vector of momentum , pseudorapidity , and azimuthal angle ...
Define three-vector and four-vector classes for the HitFit package, and supply a few additional opera...
Calculate and represent resolution for a physical quantity.
bool use_et() const
Return the use_et flag.
double phi_sigma(const Fourvec &v) const
Calculate the azimuthal angle resolution of a four-momentum.
void roteta(Fourvec &v, double eta)
Rotate four-vector v through a polar angle such that the four-vector pseudorapidity changes by a desi...
double pick(double x, double p, CLHEP::HepRandomEngine &engine) const
Generate random value from a Gaussian distribution described by this resolution. Given a value ...
Vector_Resolution()
Constructor, instantiate an instance of Vector_Resolution with infinite precision.
double p_sigma(const Fourvec &v) const
Calculate the momentum resolution of a four-momentum.
const Resolution & eta_res() const
Return a constant reference to the pseudorapidity resolution.
double eta_sigma(const Fourvec &v) const
Calculate the pseudorapidity resolution of a four-momentum.
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
double sigma(double p) const
Return the uncertainty for a variable with magnitude p.
void smear(Fourvec &v, CLHEP::HepRandomEngine &engine, bool do_smear_dir=false) const
Smear a four-momentum according to the resolutions.
const Resolution & p_res() const
Return a constant reference to the momentum resolution.
const Resolution & phi_res() const
Return a constant reference to the azimuthal angle resolution.
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
volatile std::atomic< bool > shutdown_flag false
Calculate and represent resolution for a vector of , pseudorapidity , and azimuthal angle ...