CMS 3D CMS Logo

Lepjets_Event_Lep.cc
Go to the documentation of this file.
1 //
2 //
3 // File: src/Lepjets_Event_Lep.cc
4 // Purpose: Represent a `lepton' in a Lepjets_Event.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // CMSSW File : src/Lepjets_Event_Lep.cc
8 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
9 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
10 //
11 
35 
36 namespace hitfit {
37 
39  //
40  // Purpose: Constructor.
41  //
42  // Inputs:
43  // p - The 4-momentum.
44  // type - The type code.
45  // res - The resolution.
46  //
47  : _p(p), _type(type), _res(res) {}
48 
50  //
51  // Purpose: Access the 4-momentum.
52  //
53  // Returns:
54  // The 4-momentum.
55  //
56  {
57  return _p;
58  }
59 
61  //
62  // Purpose: Access the 4-momentum.
63  //
64  // Returns:
65  // The 4-momentum.
66  //
67  {
68  return _p;
69  }
70 
72  //
73  // Purpose: Access the type code.
74  //
75  // Returns:
76  // The type code.
77  //
78  {
79  return _type;
80  }
81 
83  //
84  // Purpose: Access the type code.
85  //
86  // Returns:
87  // The type code.
88  //
89  {
90  return _type;
91  }
92 
94  //
95  // Purpose: Access the resolutions.
96  //
97  // Returns:
98  // The resolutions.
99  //
100  {
101  return _res;
102  }
103 
105  //
106  // Purpose: Access the resolutions.
107  //
108  // Returns:
109  // The resolutions.
110  //
111  {
112  return _res;
113  }
114 
116  //
117  // Purpose: Return the momentum (or 1/p) resolution for this object.
118  //
119  // Returns:
120  // The momentum (or 1/p) resolution for this object.
121  //
122  {
123  return _res.p_sigma(_p);
124  }
125 
127  //
128  // Purpose: Return the eta resolution for this object.
129  //
130  // Returns:
131  // The eta resolution for this object.
132  //
133  {
134  return _res.eta_sigma(_p);
135  }
136 
138  //
139  // Purpose: Return the phi resolution for this object.
140  //
141  // Returns:
142  // The phi resolution for this object.
143  //
144  {
145  return _res.phi_sigma(_p);
146  }
147 
148  void Lepjets_Event_Lep::smear(CLHEP::HepRandomEngine& engine, bool smear_dir /*= false*/)
149  //
150  // Purpose: Smear this object according to its resolutions.
151  //
152  // Inputs:
153  // engine - The underlying RNG.
154  // smear_dir - If false, smear the momentum only.
155  //
156  {
157  _res.smear(_p, engine, smear_dir);
158  }
159 
160  std::ostream& Lepjets_Event_Lep::dump(std::ostream& s, bool full /*= false*/) const
161  //
162  // Purpose: Dump out this object.
163  //
164  // Inputs:
165  // s - The stream to which to write.
166  // full - If true, dump the resolutions too.
167  //
168  // Returns:
169  // The stream S.
170  //
171  {
172  s << "[" << _type << "] " << _p << "; pt: " << _p.perp() << ", eta: " << _p.eta() << ", phi: " << _p.phi();
173  if (full) {
174  s << "\n " << _res;
175  }
176  return s;
177  }
178 
187  std::ostream& operator<<(std::ostream& s, const Lepjets_Event_Lep& l)
188  //
189  // Purpose: Dump out this object.
190  //
191  // Inputs:
192  // s - The stream to which to write.
193  // l - The object to dump.
194  //
195  // Returns:
196  // The stream S.
197  //
198  {
199  return l.dump(s);
200  }
201 
203  //
204  // Purpose: Sort objects by pt.
205  //
206  // Retruns:
207  // True if this object's pt is less than that of x.
208  {
209  return p().perp2() < x.p().perp2();
210  }
211 
212 } // namespace hitfit
hitfit::Lepjets_Event_Lep::eta_sigma
double eta_sigma() const
Return the uncertainty in pseudorapidity .
Definition: Lepjets_Event_Lep.cc:126
hitfit
Definition: Base_Constrainer.h:43
hitfit::Fourvec
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:55
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
hitfit::Lepjets_Event_Lep::smear
void smear(CLHEP::HepRandomEngine &engine, bool smear_dir=false)
Smear this object.
Definition: Lepjets_Event_Lep.cc:148
hitfit::Lepjets_Event_Lep::phi_sigma
double phi_sigma() const
Return the uncertainty in azimuthal angle .
Definition: Lepjets_Event_Lep.cc:137
full
Definition: GenABIO.cc:168
watchdog.const
const
Definition: watchdog.py:83
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
hitfit::Lepjets_Event_Lep::operator<
bool operator<(const Lepjets_Event_Lep &x) const
Comparison operator for sorting purpose, based on $p_{T}$.
Definition: Lepjets_Event_Lep.cc:202
alignCSCRings.s
s
Definition: alignCSCRings.py:92
hitfit::operator<<
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream.
Definition: Constraint_Intermed.cc:268
hitfit::Lepjets_Event_Lep::Lepjets_Event_Lep
Lepjets_Event_Lep(const Fourvec &p, int type, const Vector_Resolution &res)
Constructor, create a new instance of Lepjets_Event_Lep.
Definition: Lepjets_Event_Lep.cc:38
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
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
hitfit::Lepjets_Event_Lep::p
Fourvec & p()
Return a reference to the four-momentum.
Definition: Lepjets_Event_Lep.cc:49
hitfit::Lepjets_Event_Lep::_p
Fourvec _p
Definition: Lepjets_Event_Lep.h:172
hitfit::Lepjets_Event_Lep::type
int & type()
Return a reference to the type code.
Definition: Lepjets_Event_Lep.cc:71
res
Definition: Electron.h:6
hitfit::Lepjets_Event_Lep::_type
int _type
Definition: Lepjets_Event_Lep.h:177
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
hitfit::Lepjets_Event_Lep::res
const Vector_Resolution & res() const
Return a constant reference to the resolution.
Definition: Lepjets_Event_Lep.cc:93
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::Lepjets_Event_Lep::p_sigma
double p_sigma() const
Return the uncertainty in momentum or ( or if the lepton is a tracking object).
Definition: Lepjets_Event_Lep.cc:115
hitfit::Lepjets_Event_Lep::dump
std::ostream & dump(std::ostream &s, bool full=false) const
Print the content of this object.
Definition: Lepjets_Event_Lep.cc:160
Lepjets_Event_Lep.h
Represent a lepton in an instance of Lepjets_Event class.
hitfit::Lepjets_Event_Lep::_res
Vector_Resolution _res
Definition: Lepjets_Event_Lep.h:182
hitfit::Lepjets_Event_Lep
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information:
Definition: Lepjets_Event_Lep.h:64