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

Generated on Thu Apr 3 04:14:23 2008 for CAF by doxygen 1.3.4