CMS 3D CMS Logo

Lepjets_Event_Jet.cc
Go to the documentation of this file.
1 //
2 //
3 // File: src/Lepjets_Event_Jet.cc
4 // Purpose: Represent a `jet' in a Lepjets_Event.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // CMSSW File : src/Lepjets_Event_Jet.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 
12 
36 
37 
38 namespace hitfit {
39 
40 
42  int type,
43  const Vector_Resolution& res,
44  bool svx_tag /*= false*/,
45  bool slt_tag /*= false*/,
46  const Fourvec& tag_lep /*= Fourvec()*/,
47  double slt_edep /*= 0*/)
48 //
49 // Purpose: Constructor.
50 //
51 // Inputs:
52 // p - The 4-momentum.
53 // type - The type code.
54 // res - The resolution.
55 // svx_tag - SVX tag flag.
56 // slt_tag - SLT tag flag.
57 // tag_lep - SLT lepton 4-momentum.
58 // slt_edep - SLT lepton energy deposition.
59 //
60  : Lepjets_Event_Lep (p, type, res),
61  _svx_tag (svx_tag),
62  _slt_tag (slt_tag),
63  _tag_lep (tag_lep),
64  _slt_edep (slt_edep),
65  _e0 (p.e())
66 {
67 }
68 
69 
71 //
72 // Purpose: Access the SVX tag flag.
73 //
74 // Returns:
75 // The SVX tag flag.
76 //
77 {
78  return _svx_tag;
79 }
80 
81 
83 //
84 // Purpose: Access the SVX tag flag.
85 //
86 // Returns:
87 // The SVX tag flag.
88 //
89 {
90  return _svx_tag;
91 }
92 
93 
95 //
96 // Purpose: Access the SLT tag flag.
97 //
98 // Returns:
99 // The SLT tag flag.
100 //
101 {
102  return _slt_tag;
103 }
104 
105 
107 //
108 // Purpose: Access the SLT tag flag.
109 //
110 // Returns:
111 // The SLT tag flag.
112 //
113 {
114  return _slt_tag;
115 }
116 
117 
119 //
120 // Purpose: Access the tag lepton 4-momentum.
121 //
122 // Returns:
123 // The tag lepton 4-momentum.
124 //
125 {
126  return _tag_lep;
127 }
128 
129 
131 //
132 // Purpose: Access the tag lepton 4-momentum.
133 //
134 // Returns:
135 // The tag lepton 4-momentum.
136 //
137 {
138  return _tag_lep;
139 }
140 
141 
143 //
144 // Purpose: Access the tag lepton energy deposition.
145 //
146 // Returns:
147 // The tag lepton energy deposition.
148 //
149 {
150  return _slt_edep;
151 }
152 
153 
155 //
156 // Purpose: Access the tag lepton energy deposition.
157 //
158 // Returns:
159 // The tag lepton energy deposition.
160 //
161 {
162  return _slt_edep;
163 }
164 
165 
166 double Lepjets_Event_Jet::e0 () const
167 //
168 // Purpose: Access the uncorrected jet energy.
169 //
170 // Returns:
171 // The uncorrected jet energy.
172 //
173 {
174  return _e0;
175 }
176 
177 
179 //
180 // Purpose: Access the uncorrected jet energy.
181 //
182 // Returns:
183 // The uncorrected jet energy.
184 //
185 {
186  return _e0;
187 }
188 
189 
190 std::ostream& Lepjets_Event_Jet::dump (std::ostream& s,
191  bool full /*= false*/) const
192 //
193 // Purpose: Dump out this object.
194 //
195 // Inputs:
196 // s - The stream to which to write.
197 // full - If true, dump all information for this object.
198 //
199 // Returns:
200 // The stream S.
201 //
202 {
204  if (_svx_tag)
205  s << " (svx)";
206  if (_slt_tag)
207  s << " (slt)";
208  if (full) {
209  if (_slt_tag) {
210  s << " tag lep: " << _tag_lep;
211  s << " edep: " << _slt_edep;
212  }
213  s << "\n";
214  }
215  return s;
216 }
217 
218 
227 std::ostream& operator<< (std::ostream& s, const Lepjets_Event_Jet& l)
228 //
229 // Purpose: Dump out this object.
230 //
231 // Inputs:
232 // s - The stream to which to write.
233 // l - The object to dump.
234 //
235 // Returns:
236 // The stream S.
237 //
238 {
239  return l.dump (s);
240 }
241 
242 
243 char
245 //
246 // Purpose: Translate numeric jet type into char
247 //
248 // Inputs:
249 // j - jet type in integer
250 //
251 // Returns:
252 // the jet type in char
253 //
254 {
255 
256 
257  switch (j) {
258 
259  case hitfit::isr_label:
260  return 'g';
261  case hitfit::lepb_label:
262  return 'b';
263  case hitfit::hadb_label:
264  return 'B';
265  case hitfit::hadw1_label:
266  return 'W';
267  case hitfit::hadw2_label:
268  return 'W';
269  case hitfit::higgs_label:
270  return 'h';
272  return '?';
273  default:
274  return '?';
275  }
276 
277  return '?';
278 
279 }
280 
283 //
284 // Purpose: Translate numeric jet type into string
285 //
286 // Inputs:
287 // j - jet type in integer
288 //
289 // Returns:
290 // the jet type in string
291 //
292 {
293 
294 
295  switch (j) {
296 
297  case hitfit::isr_label:
298  return std::string("g");
299  case hitfit::lepb_label:
300  return std::string("b");
301  case hitfit::hadb_label:
302  return std::string("B");
303  case hitfit::hadw1_label:
304  return std::string("W");
305  case hitfit::hadw2_label:
306  return std::string("W");
307  case hitfit::higgs_label:
308  return std::string("h");
310  return std::string("?");
311  default:
312  return std::string("?");
313  }
314 
315  return std::string("?");
316 
317 }
318 
319 } // 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: ...
Definition: Electron.h:6
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:168
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:57
A class to represent a jet in an instance of Lepjets_Event class. The class is derived from the Lepje...
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 ...