CMS 3D CMS Logo

Vector_Resolution.h
Go to the documentation of this file.
1 //
2 //
3 // File: hitfit/Vector_Resolution.h
4 // Purpose: Calculate resolutions in p, phi, eta.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // These objects hold three Resolution objects, one each for p, phi, eta.
8 // In addition, we have a use_et flag; if set, then the p resolution
9 // is really in pt.
10 //
11 // We can initialize these objects from a string; the format is
12 //
13 // <p-res>/<eta-res>/<phi-res>[/et]
14 //
15 // where the resolution formats are as given in Resolution.h.
16 //
17 // CMSSW File : interface/Vector_Resolution.h
18 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
19 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
20 //
21 
45 #ifndef HITFIT_VECTOR_RESOLUTION_H
46 #define HITFIT_VECTOR_RESOLUTION_H
47 
48 #include <string>
49 #include <iosfwd>
52 
53 namespace hitfit {
54 
90  //
91  // Purpose: Calculate resolutions in p, phi, eta.
92  //
93  {
94  public:
95  // Constructor. Create a vector resolution object with infinite precision
101 
102  // Constructor. Parse a string as described above.
110 
111  // Constructor from individual resolution objects.
126  const Resolution& eta_res,
127  const Resolution& phi_res,
128  bool use_et = false);
129 
130  // Get back the individual resolution objects.
134  const Resolution& p_res() const;
135 
139  const Resolution& eta_res() const;
140 
144  const Resolution& phi_res() const;
145 
146  // Return the use_et flag.
150  bool use_et() const;
151 
152  // Calculate resolutions from a 4-momentum.
158  double p_sigma(const Fourvec& v) const;
159 
165  double eta_sigma(const Fourvec& v) const;
166 
172  double phi_sigma(const Fourvec& v) const;
173 
174  // Smear a 4-vector V according to the resolutions.
175  // If DO_SMEAR_DIR is false, only smear the total energy.
186  void smear(Fourvec& v, CLHEP::HepRandomEngine& engine, bool do_smear_dir = false) const;
187 
188  // Dump this object, for debugging.
189  friend std::ostream& operator<<(std::ostream& s, const Vector_Resolution& r);
190 
191  private:
192  // State for this object.
197 
202 
207 
211  bool _use_et;
212 
213  // Helper.
221  void smear_dir(Fourvec& v, CLHEP::HepRandomEngine& engine) const;
222  };
223 
224 } // namespace hitfit
225 
226 #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:98
const Resolution & p_res() const
Return a constant reference to the momentum resolution.
double eta_sigma(const Fourvec &v) const
Calculate the pseudorapidity resolution of a four-momentum.
const Resolution & phi_res() const
Return a constant reference to the azimuthal angle resolution.
void smear(Fourvec &v, CLHEP::HepRandomEngine &engine, bool do_smear_dir=false) const
Smear a four-momentum according to the resolutions.
Vector_Resolution()
Constructor, instantiate an instance of Vector_Resolution with infinite precision.
double phi_sigma(const Fourvec &v) const
Calculate the azimuthal angle resolution of a four-momentum.
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:55
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...
bool use_et() const
Return the use_et flag.
void smear_dir(Fourvec &v, CLHEP::HepRandomEngine &engine) const
Helper function to smear direction.
Calculate and represent resolution for a physical quantity.
Calculate and represent resolution for a vector of , pseudorapidity , and azimuthal angle ...
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.