CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/TopQuarkAnalysis/TopHitFit/interface/Lepjets_Event_Jet.h

Go to the documentation of this file.
00001 //
00002 // $Id: Lepjets_Event_Jet.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
00003 //
00004 // File: hitfit/Lepjets_Event_Jet.h
00005 // Purpose: Represent a `jet' in a Lepjets_Event.
00006 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
00007 //
00008 // This is like Lepjets_Event_Jet, except that we store some
00009 // additional information:
00010 //
00011 //   - svx tag flag
00012 //   - slt tag flag
00013 //   -   slt lepton 4-vector
00014 //   -   slt lepton energy deposition
00015 //
00016 // CMSSW File      : interface/Lepjets_Event_Jet.h
00017 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
00018 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
00019 //
00020 
00021 
00043 #ifndef HITFIT_LEPJETS_EVENT_JET_H
00044 #define HITFIT_LEPJETS_EVENT_JET_H
00045 
00046 
00047 #include "TopQuarkAnalysis/TopHitFit/interface/fourvec.h"
00048 #include "TopQuarkAnalysis/TopHitFit/interface/Vector_Resolution.h"
00049 #include "TopQuarkAnalysis/TopHitFit/interface/Lepjets_Event_Lep.h"
00050 #include <iosfwd>
00051 
00052 
00053 namespace hitfit {
00054 
00055 
00059 enum Jet_Labels {
00060   isr_label = 0,
00061   lepb_label = 11,
00062   hadb_label = 12,
00063   hadw1_label = 13,
00064   hadw2_label = 14,
00065   higgs_label = 15,
00066   unknown_label = 20
00067 };
00068 
00069 
00082 class Lepjets_Event_Jet
00083   : public Lepjets_Event_Lep
00084 //
00085 // Purpose: Represent a `jet' in a Lepjets_Event.
00086 //
00087 {
00088 public:
00089   // Constructor.
00107   Lepjets_Event_Jet (const Fourvec& p,
00108                      int type,
00109                      const Vector_Resolution& res,
00110                      bool svx_tag = false,
00111                      bool slt_tag = false,
00112                      const Fourvec& tag_lep = Fourvec(),
00113                      double slt_edep = 0);
00114 
00115   // Access the svx tag flag.
00119   bool svx_tag () const;
00120 
00124   bool& svx_tag ();
00125 
00126   // Access the slt tag flag.
00131   bool slt_tag () const;
00135   bool& slt_tag ();
00136 
00137   // Access the tag lepton four-momentum.
00141   Fourvec& tag_lep ();
00142 
00146   const Fourvec& tag_lep () const;
00147 
00148   // Access the tag lepton energy deposition.
00152   double slt_edep () const;
00156   double& slt_edep ();
00157 
00158   // Access the uncorrected jet energy.
00162   double e0 () const;
00163 
00167   double& e0 ();
00168 
00169   // Print the content of this object.
00180   std::ostream& dump (std::ostream& s, bool full = false) const;
00181 
00182 
00183 private:
00184   // The object state.
00188   bool _svx_tag;
00189 
00193   bool _slt_tag;
00194 
00198   Fourvec _tag_lep;
00199 
00203   double _slt_edep;
00204 
00208   double _e0;
00209 };
00210 
00211 
00212 // Print this object.
00213 std::ostream& operator<< (std::ostream& s, const Lepjets_Event_Jet& ev);
00214 
00215 // Helper function to translate jet type from integer to char/string
00228 char jetTypeChar(int type);
00229 
00242 std::string jetTypeString(int type);
00243 
00256 template<class T>
00257 std::string
00258 jetTypeString(std::vector<T> jet_types)
00259 {
00260 
00261 
00262     std::ostringstream ret;
00263 
00264     for (size_t j = 0 ; j != jet_types.size() ; ++j) {
00265         ret << jetTypeChar((int) (jet_types[j]));
00266     }
00267 
00268     return ret.str();
00269 }
00270 
00271 
00272 } // namespace hitfit
00273 
00274 
00275 #endif // not HITFIT_LEPJETS_EVENT_JET_H
00276