test
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 //
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 
22 
46 #ifndef HITFIT_VECTOR_RESOLUTION_H
47 #define HITFIT_VECTOR_RESOLUTION_H
48 
49 
50 #include <string>
51 #include <iosfwd>
54 
55 
56 namespace hitfit {
57 
58 
94 //
95 // Purpose: Calculate resolutions in p, phi, eta.
96 //
97 {
98 public:
99  // Constructor. Create a vector resolution object with infinite precision
105 
106  // Constructor. Parse a string as described above.
114 
115  // Constructor from individual resolution objects.
130  const Resolution& eta_res,
131  const Resolution& phi_res,
132  bool use_et = false);
133 
134  // Get back the individual resolution objects.
138  const Resolution& p_res () const;
139 
143  const Resolution& eta_res () const;
144 
148  const Resolution& phi_res () const;
149 
150  // Return the use_et flag.
154  bool use_et () const;
155 
156  // Calculate resolutions from a 4-momentum.
162  double p_sigma (const Fourvec& v) const;
163 
169  double eta_sigma (const Fourvec& v) const;
170 
176  double phi_sigma (const Fourvec& v) const;
177 
178  // Smear a 4-vector V according to the resolutions.
179  // If DO_SMEAR_DIR is false, only smear the total energy.
190  void smear (Fourvec& v,
191  CLHEP::HepRandomEngine& engine,
192  bool do_smear_dir = false) const;
193 
194  // Dump this object, for debugging.
195  friend std::ostream& operator<< (std::ostream& s,
196  const Vector_Resolution& r);
197 
198 private:
199  // State for this object.
204 
209 
214 
218  bool _use_et;
219 
220  // Helper.
228  void smear_dir (Fourvec& v, CLHEP::HepRandomEngine& engine) const;
229 };
230 
231 
232 } // namespace hitfit
233 
234 
235 #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:102
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:57
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 ...