CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/AnalysisDataFormats/TopObjects/interface/TopGenEvent.h

Go to the documentation of this file.
00001 #ifndef TopObjects_TopGenEvent_h
00002 #define TopObjects_TopGenEvent_h
00003 
00004 #include "DataFormats/Candidate/interface/Candidate.h"
00005 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00006 
00007 
00008 namespace TopDecayID{
00011   static const int stable = 2;
00012   static const int unfrag = 3;
00013   static const int tID    = 6;
00014   static const int bID    = 5;
00015   static const int glueID = 21;
00016   static const int photID = 22;
00017   static const int ZID    = 23;
00018   static const int WID    = 24;
00019   static const int elecID = 11;
00020   static const int muonID = 13;
00021   static const int tauID  = 15;
00022 }
00023 
00024 namespace WDecay{
00028   enum LeptonType {kNone, kElec, kMuon, kTau};
00029 }
00030 
00041 class TopGenEvent {
00042 
00043  public:
00044 
00046   TopGenEvent(){};
00048   TopGenEvent(reco::GenParticleRefProd& decaySubset, reco::GenParticleRefProd& iniSubset);
00050   virtual ~TopGenEvent(){};
00051 
00053   const reco::GenParticleCollection& particles() const { return *parts_; }
00055   const reco::GenParticleCollection& initialPartons() const { return *initPartons_;}
00057   std::vector<const reco::GenParticle*> radiatedGluons(int pdgId) const;
00059   std::vector<const reco::GenParticle*> lightQuarks(bool includingBQuarks=false) const;
00061   int numberOfLeptons(bool fromWBoson=true) const;
00063   int numberOfLeptons(WDecay::LeptonType type, bool fromWBoson=true) const;
00065   int numberOfBQuarks(bool fromTopQuark=true) const;
00067   std::vector<const reco::GenParticle*> topSisters() const;
00069   const reco::GenParticle* daughterQuarkOfTop(bool invertCharge=false) const;
00071   const reco::GenParticle* daughterQuarkOfTopBar() const { return daughterQuarkOfTop(true); };
00073   const reco::GenParticle* daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const;
00075   const reco::GenParticle* daughterQuarkOfWMinus() const { return daughterQuarkOfWPlus(false, true); };
00077   const reco::GenParticle* daughterQuarkBarOfWPlus() const { return daughterQuarkOfWPlus(true, false); };
00079   const reco::GenParticle* daughterQuarkBarOfWMinus() const { return daughterQuarkOfWPlus(true, true); };
00080 
00082   const reco::GenParticle* candidate(int id, unsigned int parentId=0) const;
00084   const reco::GenParticle* eMinus() const   { return candidate( TopDecayID::elecID, TopDecayID::WID );}
00086   const reco::GenParticle* ePlus() const    { return candidate(-TopDecayID::elecID, TopDecayID::WID );}
00088   const reco::GenParticle* muMinus() const  { return candidate( TopDecayID::muonID, TopDecayID::WID );}
00090   const reco::GenParticle* muPlus() const   { return candidate(-TopDecayID::muonID, TopDecayID::WID );}
00092   const reco::GenParticle* tauMinus() const { return candidate( TopDecayID::tauID, TopDecayID::WID  );}
00094   const reco::GenParticle* tauPlus() const  { return candidate(-TopDecayID::tauID, TopDecayID::WID  );}
00096   const reco::GenParticle* wMinus() const   { return candidate(-TopDecayID::WID, TopDecayID::tID    );}
00098   const reco::GenParticle* wPlus() const    { return candidate( TopDecayID::WID, TopDecayID::tID    );}
00100   const reco::GenParticle* b() const        { return candidate( TopDecayID::bID, TopDecayID::tID    );}
00102   const reco::GenParticle* bBar() const     { return candidate(-TopDecayID::bID, TopDecayID::tID    );}
00104   const reco::GenParticle* top() const      { return candidate( TopDecayID::tID    );}
00106   const reco::GenParticle* topBar() const   { return candidate(-TopDecayID::tID    );}
00107 
00110   void print() const;
00111 
00112  protected:
00113 
00115   reco::GenParticleRefProd parts_;       
00117   reco::GenParticleRefProd initPartons_; 
00118 };
00119 
00120 #endif