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
hitfit
Definition: Base_Constrainer.h:43
hitfit::Fourvec
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:55
hitfit::Vector_Resolution::smear_dir
void smear_dir(Fourvec &v, CLHEP::HepRandomEngine &engine) const
Helper function to smear direction.
hitfit::Vector_Resolution
Definition: Vector_Resolution.h:89
hitfit::Vector_Resolution::smear
void smear(Fourvec &v, CLHEP::HepRandomEngine &engine, bool do_smear_dir=false) const
Smear a four-momentum according to the resolutions.
Definition: Vector_Resolution.cc:316
Resolution.h
Calculate and represent resolution for a physical quantity.
findQualityFiles.v
v
Definition: findQualityFiles.py:179
hitfit::Vector_Resolution::phi_sigma
double phi_sigma(const Fourvec &v) const
Calculate the azimuthal angle resolution of a four-momentum.
Definition: Vector_Resolution.cc:240
alignCSCRings.s
s
Definition: alignCSCRings.py:92
hitfit::Vector_Resolution::p_res
const Resolution & p_res() const
Return a constant reference to the momentum resolution.
Definition: Vector_Resolution.cc:128
hitfit::Vector_Resolution::operator<<
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.
Definition: Vector_Resolution.cc:346
hitfit::Vector_Resolution::_eta_res
Resolution _eta_res
Definition: Vector_Resolution.h:201
hitfit::Vector_Resolution::_p_res
Resolution _p_res
Definition: Vector_Resolution.h:196
hitfit::Vector_Resolution::phi_res
const Resolution & phi_res() const
Return a constant reference to the azimuthal angle resolution.
Definition: Vector_Resolution.cc:150
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hitfit::Vector_Resolution::p_sigma
double p_sigma(const Fourvec &v) const
Calculate the momentum resolution of a four-momentum.
Definition: Vector_Resolution.cc:204
hitfit::Vector_Resolution::eta_res
const Resolution & eta_res() const
Return a constant reference to the pseudorapidity resolution.
Definition: Vector_Resolution.cc:139
hitfit::Resolution
Definition: Resolution.h:98
alignCSCRings.r
r
Definition: alignCSCRings.py:93
hitfit::Vector_Resolution::_phi_res
Resolution _phi_res
Definition: Vector_Resolution.h:206
hitfit::Vector_Resolution::use_et
bool use_et() const
Return the use_et flag.
Definition: Vector_Resolution.cc:161
fourvec.h
Define three-vector and four-vector classes for the HitFit package, and supply a few additional opera...
hitfit::Vector_Resolution::eta_sigma
double eta_sigma(const Fourvec &v) const
Calculate the pseudorapidity resolution of a four-momentum.
Definition: Vector_Resolution.cc:226
hitfit::Vector_Resolution::_use_et
bool _use_et
Definition: Vector_Resolution.h:211
hitfit::Vector_Resolution::Vector_Resolution
Vector_Resolution()
Constructor, instantiate an instance of Vector_Resolution with infinite precision.
Definition: Vector_Resolution.cc:91