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

TMBJet.hpp

Go to the documentation of this file.
00001 #ifndef TMB_TREE_TMBJETS_HPP__
00002 #define TMB_TREE_TMBJETS_HPP__
00003 
00004 #include "tmb_tree/TMBLorentzVector.hpp"
00005 
00006 #ifndef ROOT_TRef
00007 #include "TRef.h"
00008 #endif
00009 
00010 #ifndef ROOT_TRefArray
00011 #include "TRefArray.h"
00012 #endif
00013 
00014 #include "TString.h"
00015 #include "tmb_tree/TMBBTag.hpp"
00016 #include <map>
00017 
00018 class TMBTrack;
00019 class TMBVertex;
00020 
00028 class TMBJet : public TMBLorentzVector  {
00029 
00030 public:
00031 
00033   enum Type {
00034     kUnCorrected    = 0,
00035     kJESCorrected   = 1,
00036     kJESCorrectedShiftedPlus  = 2,
00037     kJESCorrectedShiftedMinus = 3,
00038     kJESMUCorrected = 4,
00039     kJESMUCorrectedShiftedPlus  = 5,
00040     kJESMUCorrectedShiftedMinus = 6,
00041     kSmeared        = 7,
00042     kSmearedMU      = 8
00043   };
00044 
00045 
00046 private:
00047   
00048     Float_t          _q;                
00049     Float_t          _dphi;             
00050     Float_t          _deta;             
00051     Float_t          _emf;              
00052     Float_t          _em1f;             
00053     Float_t          _em2f;             
00054     Float_t          _em3f;             
00055     Float_t          _ccmg;             
00056     Float_t          _icdf;             
00057     Float_t          _ecmg;             
00058     Float_t          _icrf;             
00059     Float_t          _fh1f;             
00060     Float_t          _fh2f;             
00061     Float_t          _fh3f;             
00062     Float_t          _chf;              
00063     Float_t          _emcc;             
00064     Float_t          _hadcc;            
00065     Float_t          _emec;             
00066     Float_t          _hadec;            
00067     Float_t          _hot;              
00068     Float_t          _mxET;             
00069     Float_t          _cpsE;             
00070     Float_t          _etaW;             
00071     Float_t          _phiW;             
00072     Float_t          _sET;              
00073     Float_t          _vPT;              
00074     Float_t          _iPT;              
00075     Float_t          _seedET;           
00076     Float_t          _pxCH;             
00077     Float_t          _pyCH;             
00078     Float_t          _pzCH;             
00079 
00080     Float_t _l1set;                     
00081     Float_t _l1pt;                      
00082     Float_t _l1em;                      
00083     Float_t _smear_coeff;               
00084     Float_t _smear_coeffMU;             
00085     Float_t _jes_C;                     
00086     Float_t _jes_dC_stat;               
00087     Float_t _jes_dC_sys;                
00088     Float_t _jes_metC;                  
00089     Float_t _jes_metdC_stat;            
00090     Float_t _jes_metdC_sys;             
00091     Float_t _jes_dC_stat_up;            
00092     Float_t _jes_dC_sys_up;             
00093     Float_t _jes_dC_stat_down;          
00094     Float_t _jes_dC_sys_down;           
00095     Float_t _jesMU_C;                   
00096     Float_t _jesMU_dC_stat;             
00097     Float_t _jesMU_dC_sys;              
00098     Float_t _jesMU_dC_stat_up;          
00099     Float_t _jesMU_dC_sys_up;           
00100     Float_t _jesMU_dC_stat_down;        
00101     Float_t _jesMU_dC_sys_down;         
00102     Float_t _jesMU_metC;                
00103     Float_t _jesMU_metdC_stat;          
00104     Float_t _jesMU_metdC_sys;           
00105 
00106     Int_t            _ntrk;             
00107     Int_t            _nps;              
00108     Int_t            _Nitems;           
00109     Int_t            _n90;              
00110     Int_t            _split_merge_word; 
00111     TString           _algoname;        
00112     TRefArray        _tracks;           
00113     TRef             _vtxref;           
00114 
00115     std::map< TString, TRef >  _btagdict; 
00116     std::map< TString, int > _btagdictcheck; 
00117 
00118     std::vector<std::pair<Char_t, UChar_t> > _jetTowers;  
00119     std::vector<Float_t> _jetShapes;     
00120 
00121     Int_t       _isGood; 
00122     Int_t       _isL1Conf; 
00123     Int_t       _isBad; 
00124     Int_t       _isNoise; 
00125     Int_t       _isEM; 
00126     Int_t       _hasMU; 
00127     Int_t       _isSmeared; 
00128     Int_t       _isSmearedMU; 
00129     
00130     mutable Int_t _actas; 
00131 
00132     TMBLorentzVector _uncorrected;
00133 
00134     Float_t     _cpf0;              
00135     Float_t     _cpf;               
00136     Int_t       _ntrkMultiplicity0; 
00137     Int_t       _ntrkMultiplicity;  
00138     TRef        _cpfvtxref;         
00139 
00140 public:
00141 
00142     TMBJet();
00143     TMBJet              (Float_t E, Float_t pT,   Float_t phi,  Float_t eta);
00144 
00145     void Set0           (Float_t E, Float_t pT,   Float_t phi,  Float_t eta);
00146 
00147     void Set1           (Float_t q, Float_t dphi, Float_t deta, 
00148                          Float_t emf,  Float_t em1f, Float_t em2f, Float_t em3f,
00149                          Float_t ccmg, Float_t icdf, Float_t ecmg, Float_t icrf,
00150                          Float_t fh1f, Float_t fh2f, Float_t fh3f, Float_t chf,
00151                          Float_t emcc, Float_t hadcc,Float_t emec, Float_t hadec,
00152                          Float_t hot,  Float_t mxET,
00153                          Float_t cpsE, Float_t etaW, Float_t phiW, 
00154                          Float_t sET,  Float_t vPT,  Float_t iPT,  Float_t seedET, 
00155                          Float_t pxCH, Float_t pyCH, Float_t pzCH);
00156 
00157     void Set2           (Int_t ntrk, Int_t nps,  Int_t Nitems, 
00158                          Int_t n90,  Int_t split_merge_word, 
00159                          const char *algoname, const TRefArray *tracks, TRef vtxref);
00160 
00161     void SetJetShapes(const std::vector<std::pair<Char_t, UChar_t> >& jetTowers, 
00162                       const std::vector<Float_t>& jetShapes);
00163 
00164     void SetL1(Float_t l1set, Float_t l1pt, Float_t l1em);
00165 
00166     void SetCorr (Float_t jes_C, Float_t jes_dC_stat, Float_t jes_dC_sys,
00167                   Float_t jes_metC, Float_t jes_metdC_stat, Float_t jes_metdC_sys);
00168     void SetCorrMU(Float_t jesMU_C, Float_t jesMU_dC_stat, Float_t jesMU_dC_sys,
00169                   Float_t jesMU_metC, Float_t jesMU_metdC_stat, Float_t jesMU_metdC_sys); 
00170     void SetCorr (Float_t jes_C, Float_t jes_dC_stat_up, Float_t jes_dC_sys_up,
00171                   Float_t jes_dC_stat_down, Float_t jes_dC_sys_down,
00172                   Float_t jes_metC, Float_t jes_metdC_stat, Float_t jes_metdC_sys);
00173     void SetCorrMU(Float_t jesMU_C, Float_t jesMU_dC_stat_up, Float_t jesMU_dC_sys_up, 
00174                   Float_t jesMU_dC_stat_down, Float_t jesMU_dC_sys_down,
00175                   Float_t jesMU_metC, Float_t jesMU_metdC_stat, Float_t jesMU_metdC_sys);
00176     void SetFlag(Int_t isGood, Int_t isL1Conf, Int_t isBad, Int_t isNoise, Int_t isEM, Int_t hasMU, Int_t isSmeared, Int_t isSmearedMU);
00177 
00178     void SetUnCorr(Float_t p, Float_t eta, Float_t phi, Float_t E);
00179 
00180     void SetSmearCoeff(Float_t coeff, Float_t coeffMU);
00181 
00182     void SetJetID(Float_t cpf0, Float_t cpf, Int_t ntrkMultiplicity0,
00183                   Int_t ntrkMultiplicity, TRef cpfvtxref);
00184 
00185     Float_t       charge()  const        {return _q;}
00186     Float_t       dphi()    const        {return _dphi;} 
00187     Float_t       detPhi()  const        {return _dphi;} 
00188     Float_t       deta()    const        {return _deta;} 
00189     Float_t       detEta()  const        {return _deta;} 
00190     Float_t       emf()     const        {return _emf;} 
00191     Float_t       emETfraction()  const  {return _emf;} 
00192     Float_t       em1f()    const        {return _em1f;} 
00193     Float_t       em2f()    const        {return _em2f;} 
00194     Float_t       em3f()    const        {return _em3f;}
00195     Float_t       ccmg()    const        {return _ccmg;}
00196     Float_t       icdf()    const        {return _icdf;} 
00197     Float_t       ecmg()    const        {return _ecmg;}
00198     Float_t       icrf()    const        {return _icrf;} 
00199     Float_t       fh1f()    const        {return _fh1f;} 
00200     Float_t       fh2f()    const        {return _fh2f;} 
00201     Float_t       fh3f()    const        {return _fh3f;} 
00202     Float_t       chf()     const        {return _chf;} 
00203     Float_t       chETfraction()  const  {return _chf;} 
00204     Float_t       emcc()    const        {return _emcc;}
00205     Float_t       hadcc()   const        {return _hadcc;}
00206     Float_t       emec()    const        {return _emec;}
00207     Float_t       hadec()   const        {return _hadec;}
00208     Float_t       hot()     const        {return _hot;} 
00209     Float_t       hotcellratio() const   {return _hot;} 
00210     Float_t       mxET()    const        {return _mxET;} 
00211     Float_t       cpsE()    const        {return _cpsE;} 
00212     Float_t       etaW()    const        {return _etaW;} 
00213     Float_t       phiW()    const        {return _phiW;} 
00214     Float_t       sET()     const        {return _sET;} 
00215     Float_t       vPT()     const        {return _vPT;} 
00216     Float_t       iPT()     const        {return _iPT;} 
00217     Float_t       seedET()  const        {return _seedET;}
00218     Int_t         ntrk()    const        {return _ntrk;} 
00219     Int_t         nps()     const        {return _nps;} 
00220     Int_t         Nitems()  const        {return _Nitems;} 
00221     Int_t         nItems()  const        {return _Nitems;} 
00222     Int_t         n90()     const        {return _n90;}
00223     Int_t         split_merge_word()const{return _split_merge_word;}
00224     const char *  algoname()  const      {return _algoname;}              
00225     Int_t         Ntr()     const        {return _tracks.GetLast()+1;}
00226     const TMBTrack*  GetChargedTrack(Int_t itrack) const {return (const TMBTrack*)_tracks.At(itrack);}
00227     const TMBVertex* GetVertex() const        {return _vtxref.IsValid() ? (const TMBVertex*)_vtxref.GetObject() : 0;}
00228     const TRef&      GetVertexRef() const     {return _vtxref;}
00229     Float_t       em4f()const            {return emf()-(em1f()+em2f()+em3f());}
00230     Float_t       mgf() const            {return ccmg()+ecmg();}
00231     Float_t     pxCH() const {return _pxCH;}
00232     Float_t     pyCH() const {return _pyCH;}
00233     Float_t     pzCH() const {return _pzCH;} 
00234  
00235   // @name b-tag Related Methods
00237   //@brief The tag check index for a tag type (for debugging, really)
00238   int btagdictcheck(const char* t) const;
00239   //@brief Returns the number of BTags associated with the jet (taggers * operating points)
00240   int btag_ntags() const {return _btagdict.size();}
00241   //@brief Returns the Tag Info for particular tag (or null if the tag doesn't exist).
00242   const TMBBTag* GetBTag(const TString &type, const TString &cut) const;
00243   const TMBBTag* GetBTag(const char *type, const char *cut) const;
00244   const TMBBTag* GetBTag(const TString &typecut) const;
00245   //@brief Get the first BTag object available (useful when you don't care about the algorithm itself, like for taggability or mc_flavor...
00246   const TMBBTag* GetFirstBTag() const;
00247   //@brief Print the list of associated tags
00248   bool btag_print() const;
00249   //@brief Associates a tag object (already in another branch) to the jet. "Erases" any previous association for this tag/cut.
00250   void AddBTag(const TString &type, const TString &cut, TMBBTag* btag);
00251   //@brief Clears all btag associations for this jet.
00252   void ClearAllBTags();
00253   //@brief Clears a particular btag association. No error if it doesn't exist.
00254   void ClearBTag (const TString &type, const TString &cut);
00255   //@breif returns 1 if the jet is taggable, 0 if not, -1 if not run (because isEM or isBAD)
00256   int taggable() const;
00257   //@brief returns the MC flavor of the jet (b,c,light, gluon, etc.) or -1 if not run (because isEM or isBAD)
00258   int mc_flavor() const;
00259   //@brief returns 1 if the jet is SVT LOOSE tagged, 0 if it's not, and -1 if the tagging was not run
00260   int btag_svt_loose() const { if (const TMBBTag *tag=GetBTag("SVT","LOOSE")) return tag->is_tagged(); else return -1;}
00261   //@brief returns 1 if the jet is JLIP LOOSE tagged, 0 if it's not, and -1 if the tagging was not run
00262   int btag_jlip_loose() const { if (const TMBBTag *tag=GetBTag("JLIP","LOOSE")) return tag->is_tagged(); else return -1;}
00263   //@brief returns 1 if the jet is NN LOOSE tagged, 0 if it's not, and -1 if the tagging was not run
00264   int btag_nn_loose() const { if (const TMBBTag *tag=GetBTag("NN","LOOSE")) return tag->is_tagged(); else return -1;}
00266   
00267     Float_t L1_energy() const  {return _l1set;};
00268     Float_t L1_pT() const {return _l1pt;}; 
00269     Float_t L1_em() const {return _l1em;};
00271     Float_t SmearingFactor() const {return _smear_coeff;}
00273     Float_t SmearingFactorMU() const {return _smear_coeffMU;}
00275     Float_t JES_C()       const{return _jes_C;}
00276     Float_t JESMU_C()       const{return _jesMU_C;}
00278     Float_t JES_dC_stat() const{return _jes_dC_stat;}
00280     Float_t JESMU_dC_stat() const{return _jesMU_dC_stat;}
00282     Float_t JES_dC_sys()  const{return _jes_dC_sys;}
00284     Float_t JESMU_dC_sys()  const{return _jesMU_dC_sys;}
00286     Float_t JES_metC()       const{return _jes_metC;}
00288     Float_t JESMU_metC()       const{return _jesMU_metC;}
00290     Float_t JES_metdC_stat() const{return _jes_metdC_stat;}
00292     Float_t JESMU_metdC_stat() const{return _jesMU_metdC_stat;}
00294     Float_t JES_metdC_sys()  const{return _jes_metdC_sys;}
00296     Float_t JESMU_metdC_sys()  const{return _jesMU_metdC_sys;}
00298     Float_t JES_dC_stat_up() const {return _jes_dC_stat_up;}
00300     Float_t JES_dC_sys_up() const {return _jes_dC_sys_up;}
00302     Float_t JES_dC_stat_down() const {return _jes_dC_stat_down;}
00304     Float_t JES_dC_sys_down() const {return _jes_dC_sys_down;}
00306     Float_t JESMU_dC_stat_up() const {return _jesMU_dC_stat_up;}
00308     Float_t JESMU_dC_sys_up() const {return _jesMU_dC_sys_up;}
00310     Float_t JESMU_dC_stat_down() const {return _jesMU_dC_stat_down;}
00312     Float_t JESMU_dC_sys_down() const {return _jesMU_dC_sys_down;}
00313 
00315 
00316 
00318     Int_t isGood()    const {return _isGood;}
00319 
00321     Int_t isL1Conf()  const {return _isL1Conf;}
00322 
00324     Int_t isBad()     const {return _isBad;}
00325 
00327     Int_t isNoise()   const {return _isNoise;}
00328 
00330     Int_t isEM()      const {return _isEM;}
00331 
00333     Int_t hasMU()     const {return _hasMU;}
00334 
00336     Int_t isSmeared() const {return _isSmeared;}
00337 
00339     Int_t isSmearedMU() const {return _isSmearedMU;}
00340 
00342 
00343     Int_t  CurrentlyActAs() const {return _actas;}
00344 
00346 
00347 
00348     void ActAsUnCorrected() const;
00350     void ActAsJESCorrected() const;
00352     void ActAsJESCorrectedShiftedPlus() const;
00354     void ActAsJESCorrectedShiftedMinus() const;
00356     void ActAsJESMUCorrected() const;
00358     void ActAsJESMUCorrectedShiftedPlus() const;
00360     void ActAsJESMUCorrectedShiftedMinus() const;
00362     void ActAsSmeared() const;
00364     void ActAsSmearedMU() const;
00366 
00369     std::vector<std::pair<Char_t, UChar_t> > jetTowers() const {return _jetTowers;}
00370     std::vector<Float_t> jetShapes() const {return _jetShapes;}
00371 
00373 
00374 
00376     Float_t cpf0()               const { return _cpf0; }
00377 
00379     Float_t cpf()                const { return _cpf; }
00380 
00382     Int_t   ntrkMultiplicity0()  const { return _ntrkMultiplicity0; }
00383 
00385     Int_t   ntrkMultiplicity()   const { return _ntrkMultiplicity; }
00386 
00388     const TMBVertex* cpfVertex() const { return _cpfvtxref.IsValid() ? (const TMBVertex*)_cpfvtxref.GetObject() : 0; }
00390     const TRef&      cpfVertexRef() const { return _cpfvtxref; }
00392 
00393     //Destructor
00394     ~TMBJet();
00395 
00396     ClassDef(TMBJet, 9);
00397 };
00398 
00399 #endif // TMB_TREE_TMBJETS_HPP__
00400 

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