CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Vector_Resolution.h
Go to the documentation of this file.
1 //
2 // $Id: Vector_Resolution.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
3 //
4 // File: hitfit/Vector_Resolution.h
5 // Purpose: Calculate resolutions in p, phi, eta.
6 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
7 //
8 // These objects hold three Resolution objects, one each for p, phi, eta.
9 // In addition, we have a use_et flag; if set, then the p resolution
10 // is really in pt.
11 //
12 // We can initialize these objects from a string; the format is
13 //
14 // <p-res>/<eta-res>/<phi-res>[/et]
15 //
16 // where the resolution formats are as given in Resolution.h.
17 //
18 // CMSSW File : interface/Vector_Resolution.h
19 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
20 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
21 //
22 
23 
47 #ifndef HITFIT_VECTOR_RESOLUTION_H
48 #define HITFIT_VECTOR_RESOLUTION_H
49 
50 
51 #include <string>
52 #include <iosfwd>
55 
56 
57 namespace hitfit {
58 
59 
95 //
96 // Purpose: Calculate resolutions in p, phi, eta.
97 //
98 {
99 public:
100  // Constructor. Create a vector resolution object with infinite precision
106 
107  // Constructor. Parse a string as described above.
114  Vector_Resolution (std::string s);
115 
116  // Constructor from individual resolution objects.
131  const Resolution& eta_res,
132  const Resolution& phi_res,
133  bool use_et = false);
134 
135  // Get back the individual resolution objects.
139  const Resolution& p_res () const;
140 
144  const Resolution& eta_res () const;
145 
149  const Resolution& phi_res () const;
150 
151  // Return the use_et flag.
155  bool use_et () const;
156 
157  // Calculate resolutions from a 4-momentum.
163  double p_sigma (const Fourvec& v) const;
164 
170  double eta_sigma (const Fourvec& v) const;
171 
177  double phi_sigma (const Fourvec& v) const;
178 
179  // Smear a 4-vector V according to the resolutions.
180  // If DO_SMEAR_DIR is false, only smear the total energy.
191  void smear (Fourvec& v,
192  CLHEP::HepRandomEngine& engine,
193  bool do_smear_dir = false) const;
194 
195  // Dump this object, for debugging.
196  friend std::ostream& operator<< (std::ostream& s,
197  const Vector_Resolution& r);
198 
199 private:
200  // State for this object.
205 
210 
215 
219  bool _use_et;
220 
221  // Helper.
229  void smear_dir (Fourvec& v, CLHEP::HepRandomEngine& engine) const;
230 };
231 
232 
233 } // namespace hitfit
234 
235 
236 #endif // not HITFIT_VECTOR_RESOLUTION_H
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.
Definition: Resolution.h:103
void smear_dir(Fourvec &v, CLHEP::HepRandomEngine &engine) const
Helper function to smear direction.
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.
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.
Definition: fourvec.h:58
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.
friend std::ostream & operator<<(std::ostream &s, const Vector_Resolution &r)
Output stream operator, print the content of this Vector_Resolution object to an output stream...
Calculate and represent resolution for a physical quantity.
Calculate and represent resolution for a vector of , pseudorapidity , and azimuthal angle ...
mathSSE::Vec4< T > v