Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

TMBBTag.hpp

Go to the documentation of this file.
00001 #ifndef TMB_TREE_TMBBTAG_HPP__
00002 #define TMB_TREE_TMBBTAG_HPP__
00003 
00004 #include "TRef.h"
00005 #include "TRefArray.h"
00006 
00007 class TMBJet;
00008 class TMBMuon;
00009 class TMBTrack;
00010 
00011 //          Base class for b-tagging branches.  There is one instance
00012 //          of this class (and its subclass, if any), for each 
00013 //          reconstructed jet.  This class can exist in several branches,
00014 //          with different branches having differences with respect to
00015 //          any of the following:
00016 //
00017 //          a) Jet reconstruction algorithm (JCCA, JCCB, etc.)
00018 //          b) Jet correction algorithm (uncorrected, JES, muon, etc.)
00019 //          c) B-tagging algorithm (SVT, JLIP, CSIP, etc.).
00020 //          d) B-tagging operating point (LOOSE, MEDIUM, TIGHT, etc.).
00021 //
00022 //          It is expected that specific b-tagging algorithms will
00023 //          derive subclasses with this class as a base class, for the
00024 //          purpose of adding attributes or overriding the TRF
00025 //          methods.  However, this is not required.  It is
00026 //          permissible to instantiate TMBBTag concretely and save it
00027 //          in a tree branch by itself.
00028 //
00029 // Created: 25-Jan-2005   H. Greenlee
00030 //
00031 // \ingroup bid
00032 
00033 class TMBBTag : public TObject {
00034 
00035  private:
00036   
00037   Bool_t _taggable;      // Taggable flag.
00038   Bool_t _tagged;        // Tag decision (positive).
00039   Bool_t _neg_tagged;    // Tag decision (negative).
00040 
00041   // The MC info
00042   Double_t _trf_data;    // The prob of tagging this guy in data.
00043   Double_t _trf_data_err;// The abosolute error on the above.
00044   Double_t _trf_mc;      // The prob of tagging this guy in MC.
00045   Double_t _trf_sf;      // The scale factor to re-weight this tag from MC to data.
00046   Int_t _mc_flavor;      // Jet flavor: -1 = Unknown (data). 0 = Light. 4 = C. 5 = B.
00047 
00048   // Associations.
00049   TRef _jet;             // Reconstructed jet (TMBJet).
00050   TRef _muon;            // Associated muon (TMBMuon).
00051   int _num_tracks;       // Number of positive-tag tracks.
00052   int _num_neg_tracks;   // Number of negative-tag tracks.
00053   TRefArray _tracks;     // Tracks used by b-tagging algorithm.
00054   TRefArray _neg_tracks; // Tracks used by negative b-tagging algorithm.
00055 
00056   // A cross-check
00057   TString _algo;
00058   TString _trackbranch, _muonbranch, _jetbranch;
00059   int _id;
00060 
00061  public:
00062   
00063   // Constructors, destructor.
00064   TMBBTag();
00065   //TMBBTag(const TMBBTag& btag);
00066   TMBBTag(Bool_t taggable,
00067           Bool_t tagged,
00068           Bool_t neg_tagged,
00069           Int_t mc_flavor,
00070           const TMBJet* jet,
00071           const TMBMuon* muon,
00072           const TRefArray* tracks,
00073           const TRefArray* neg_tracks);
00074   
00075   virtual ~TMBBTag();
00076 
00077   Bool_t is_taggable() const {return _taggable;}
00078   Bool_t is_tagged() const {return _tagged;}
00079   Bool_t is_neg_tagged() const {return _neg_tagged;}
00080   Int_t mc_flavor() const {return _mc_flavor;}
00081   bool print() const;
00082   TString GetAlgo() const {return _algo;}
00083   void SetAlgo(const char* algo){_algo=algo;}
00084   void SetBranches(const char* jet, const char* muon, const char* track){
00085     _jetbranch=jet; _muonbranch=muon; _trackbranch=track;
00086   }
00087   int GetId() const {return _id;}
00088   void SetId(int id) {_id=id;}
00089 
00090   const TMBJet* GetJet() const;
00091   //const TRef& GetJetRef() const {return _jet;}
00092 
00093   const TMBMuon* GetMuon() const;
00094   //const TRef& GetMuonRef() const {return _muon;}
00095 
00096   int num_tracks() const {return _num_tracks;}
00097   int num_neg_tracks() const {return _num_neg_tracks;}
00098   //const TRefArray& tracks() const {return _tracks;}
00099   //const TRefArray& neg_tracks() const {return _neg_tracks;}
00100 
00101   const TMBTrack *track(int i) const { return (const TMBTrack *)_tracks.At(i); }
00102   const TMBTrack *neg_track(int i) const { return (const TMBTrack *)_neg_tracks.At(i); }
00103 
00104   //TRF methods. For data (or when not filled) these will return zero.
00105   inline Double_t data_trf() const {return _trf_data;}
00106   inline Double_t mc_trf() const {return _trf_mc;}
00107   inline Double_t scale_factor() const {return _trf_sf;}
00108 
00109   //Methods used to set various TRF related values after the object has been created.
00110   inline void set_data_trf (double val, double err);
00111   inline void set_mc_flavor (int value);
00112   
00113   ClassDef(TMBBTag, 5);
00114 };
00115 
00116 void TMBBTag::set_data_trf (double val, double err)
00117 {
00118   _trf_data = val;
00119   _trf_data_err = err;
00120 }
00121 
00122 void TMBBTag::set_mc_flavor (int value)
00123 {
00124   _mc_flavor = value;
00125 }
00126 #endif

Generated on Tue Mar 28 10:13:04 2006 for CAF by doxygen 1.3.4