CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Lepjets_Event_Jet.cc
Go to the documentation of this file.
1 //
2 // $Id: Lepjets_Event_Jet.cc,v 1.1 2011/05/26 09:47:00 mseidel Exp $
3 //
4 // File: src/Lepjets_Event_Jet.cc
5 // Purpose: Represent a `jet' in a Lepjets_Event.
6 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
7 //
8 // CMSSW File : src/Lepjets_Event_Jet.cc
9 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
10 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
11 //
12 
13 
37 
38 
39 namespace hitfit {
40 
41 
43  int type,
44  const Vector_Resolution& res,
45  bool svx_tag /*= false*/,
46  bool slt_tag /*= false*/,
47  const Fourvec& tag_lep /*= Fourvec()*/,
48  double slt_edep /*= 0*/)
49 //
50 // Purpose: Constructor.
51 //
52 // Inputs:
53 // p - The 4-momentum.
54 // type - The type code.
55 // res - The resolution.
56 // svx_tag - SVX tag flag.
57 // slt_tag - SLT tag flag.
58 // tag_lep - SLT lepton 4-momentum.
59 // slt_edep - SLT lepton energy deposition.
60 //
61  : Lepjets_Event_Lep (p, type, res),
62  _svx_tag (svx_tag),
63  _slt_tag (slt_tag),
64  _tag_lep (tag_lep),
65  _slt_edep (slt_edep),
66  _e0 (p.e())
67 {
68 }
69 
70 
72 //
73 // Purpose: Access the SVX tag flag.
74 //
75 // Returns:
76 // The SVX tag flag.
77 //
78 {
79  return _svx_tag;
80 }
81 
82 
84 //
85 // Purpose: Access the SVX tag flag.
86 //
87 // Returns:
88 // The SVX tag flag.
89 //
90 {
91  return _svx_tag;
92 }
93 
94 
96 //
97 // Purpose: Access the SLT tag flag.
98 //
99 // Returns:
100 // The SLT tag flag.
101 //
102 {
103  return _slt_tag;
104 }
105 
106 
108 //
109 // Purpose: Access the SLT tag flag.
110 //
111 // Returns:
112 // The SLT tag flag.
113 //
114 {
115  return _slt_tag;
116 }
117 
118 
120 //
121 // Purpose: Access the tag lepton 4-momentum.
122 //
123 // Returns:
124 // The tag lepton 4-momentum.
125 //
126 {
127  return _tag_lep;
128 }
129 
130 
132 //
133 // Purpose: Access the tag lepton 4-momentum.
134 //
135 // Returns:
136 // The tag lepton 4-momentum.
137 //
138 {
139  return _tag_lep;
140 }
141 
142 
144 //
145 // Purpose: Access the tag lepton energy deposition.
146 //
147 // Returns:
148 // The tag lepton energy deposition.
149 //
150 {
151  return _slt_edep;
152 }
153 
154 
156 //
157 // Purpose: Access the tag lepton energy deposition.
158 //
159 // Returns:
160 // The tag lepton energy deposition.
161 //
162 {
163  return _slt_edep;
164 }
165 
166 
168 //
169 // Purpose: Access the uncorrected jet energy.
170 //
171 // Returns:
172 // The uncorrected jet energy.
173 //
174 {
175  return _e0;
176 }
177 
178 
180 //
181 // Purpose: Access the uncorrected jet energy.
182 //
183 // Returns:
184 // The uncorrected jet energy.
185 //
186 {
187  return _e0;
188 }
189 
190 
191 std::ostream& Lepjets_Event_Jet::dump (std::ostream& s,
192  bool full /*= false*/) const
193 //
194 // Purpose: Dump out this object.
195 //
196 // Inputs:
197 // s - The stream to which to write.
198 // full - If true, dump all information for this object.
199 //
200 // Returns:
201 // The stream S.
202 //
203 {
205  if (_svx_tag)
206  s << " (svx)";
207  if (_slt_tag)
208  s << " (slt)";
209  if (full) {
210  if (_slt_tag) {
211  s << " tag lep: " << _tag_lep;
212  s << " edep: " << _slt_edep;
213  }
214  s << "\n";
215  }
216  return s;
217 }
218 
219 
228 std::ostream& operator<< (std::ostream& s, const Lepjets_Event_Jet& l)
229 //
230 // Purpose: Dump out this object.
231 //
232 // Inputs:
233 // s - The stream to which to write.
234 // l - The object to dump.
235 //
236 // Returns:
237 // The stream S.
238 //
239 {
240  return l.dump (s);
241 }
242 
243 
244 char
245 jetTypeChar(int j)
246 //
247 // Purpose: Translate numeric jet type into char
248 //
249 // Inputs:
250 // j - jet type in integer
251 //
252 // Returns:
253 // the jet type in char
254 //
255 {
256 
257 
258  switch (j) {
259 
260  case hitfit::isr_label:
261  return 'g';
262  case hitfit::lepb_label:
263  return 'b';
264  case hitfit::hadb_label:
265  return 'B';
266  case hitfit::hadw1_label:
267  return 'W';
268  case hitfit::hadw2_label:
269  return 'W';
270  case hitfit::higgs_label:
271  return 'h';
273  return '?';
274  default:
275  return '?';
276  }
277 
278  return '?';
279 
280 }
281 
283 jetTypeString(int j)
284 //
285 // Purpose: Translate numeric jet type into string
286 //
287 // Inputs:
288 // j - jet type in integer
289 //
290 // Returns:
291 // the jet type in string
292 //
293 {
294 
295 
296  switch (j) {
297 
298  case hitfit::isr_label:
299  return std::string("g");
300  case hitfit::lepb_label:
301  return std::string("b");
302  case hitfit::hadb_label:
303  return std::string("B");
304  case hitfit::hadw1_label:
305  return std::string("W");
306  case hitfit::hadw2_label:
307  return std::string("W");
308  case hitfit::higgs_label:
309  return std::string("h");
311  return std::string("?");
312  default:
313  return std::string("?");
314  }
315 
316  return std::string("?");
317 
318 }
319 
320 } // namespace hitfit
type
Definition: HCALResponse.h:21
std::ostream & dump(std::ostream &s, bool full=false) const
Print the content of this object.
std::ostream & dump(std::ostream &s, bool full=false) const
Print the content of this object.
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: ...
Lepjets_Event_Jet(const Fourvec &p, int type, const Vector_Resolution &res, bool svx_tag=false, bool slt_tag=false, const Fourvec &tag_lep=Fourvec(), double slt_edep=0)
Constructor.
Represent a jet in an instance of Lepjets_Event class.
std::string jetTypeString(int type)
Helper function: Translate jet type code from integer to char. The following notation is used for eac...
Definition: GenABIO.cc:193
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:58
int j
Definition: DBlmapReader.cc:9
A class to represent a jet in an instance of Lepjets_Event class. The class is derived from the Lepje...
string const
Definition: compareJSON.py:14
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
char jetTypeChar(int type)
Helper function: Translate jet type code from integer to char. The following notation is used for eac...
Calculate and represent resolution for a vector of , pseudorapidity , and azimuthal angle ...