MC_TTBAR.cc

Go to the documentation of this file.
00001 #include "Rivet/Analysis.hh"
00002 #include "Rivet/Projections/FinalState.hh"
00003 #include "Rivet/Projections/ChargedLeptons.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 #include "Rivet/AnalysisLoader.hh"
00006 #include "Rivet/RivetAIDA.hh"
00007 
00008 
00009 namespace Rivet {
00010 
00011   class MC_TTBAR : public Analysis {
00012 
00013   public:
00014 
00015     MC_TTBAR()
00016       : Analysis("MC_TTBAR")
00017     {   }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     void init() {
00024       addProjection(ChargedLeptons(FinalState(-4.2, 4.2, 30*GeV)), "LFS");
00025       addProjection(FastJets(FinalState(-4.2, 4.2, 0*GeV), FastJets::ANTIKT, 0.4), "Jets");
00026 
00027       _h_jet_1_pT = bookHistogram1D("jet_1_pT", 50, 0, 500);
00028       _h_jet_2_pT = bookHistogram1D("jet_2_pT", 50, 0, 400);
00029       _h_jet_3_pT = bookHistogram1D("jet_3_pT", 50, 0, 300);
00030       _h_jet_4_pT = bookHistogram1D("jet_4_pT", 50, 0, 200);
00031 
00032       _h_bjet_1_pT = bookHistogram1D("jetb_1_pT", 50, 0, 250);
00033       _h_bjet_2_pT = bookHistogram1D("jetb_2_pT", 50, 0, 250);
00034 
00035       _h_ljet_1_pT = bookHistogram1D("jetl_1_pT", 50, 0, 250);
00036       _h_ljet_2_pT = bookHistogram1D("jetl_2_pT", 50, 0, 250);
00037 
00038       _h_W_mass = bookHistogram1D("W_mass", 75, 30, 180);
00039       _h_t_mass = bookHistogram1D("t_mass", 150, 130, 430);
00040       _h_t_mass_W_cut = bookHistogram1D("t_mass_W_cut", 150, 130, 430);
00041       _h_W_comb_mass = bookHistogram1D("W_comb_mass", 75, 30, 180);
00042       _h_t_comb_mass = bookHistogram1D("t_comb_mass", 150, 130, 430);
00043     }
00044 
00045 
00046     void analyze(const Event& event) {
00047       const double weight = event.weight();
00048 
00049       const ChargedLeptons& lfs = applyProjection<ChargedLeptons>(event, "LFS");
00050       MSG_DEBUG("Charged lepton multiplicity = " << lfs.chargedLeptons().size());
00051       foreach (Particle lepton, lfs.chargedLeptons()) {
00052         MSG_DEBUG("Lepton pT = " << lepton.momentum().pT());
00053       }
00054       if (lfs.chargedLeptons().empty()) {
00055         MSG_DEBUG("Event failed lepton multiplicity cut");
00056         vetoEvent;
00057       }
00058 
00059       const FastJets& jetpro = applyProjection<FastJets>(event, "Jets");
00060       const Jets alljets = jetpro.jetsByPt();
00061       if (alljets.size() < 4) {
00062         MSG_DEBUG("Event failed jet multiplicity cut");
00063         vetoEvent;
00064       }
00065       _h_jet_1_pT->fill(alljets[0].momentum().pT(), weight);
00066       _h_jet_2_pT->fill(alljets[1].momentum().pT(), weight);
00067       _h_jet_3_pT->fill(alljets[2].momentum().pT(), weight);
00068       _h_jet_4_pT->fill(alljets[3].momentum().pT(), weight);
00069 
00070       const Jets jets = jetpro.jetsByPt(35*GeV);
00071       foreach (const Jet& jet, jets) {
00072         MSG_DEBUG("Jet pT = " << jet.momentum().pT()/GeV << " GeV");
00073       }
00074       if (jets.size() < 4) {
00075         MSG_DEBUG("Event failed jet pT cut");
00076         vetoEvent;
00077       }
00078 
00079       Jets bjets, ljets;
00080       foreach (const Jet& jet, jets) {
00081         if (jet.containsBottom()) {
00082           bjets.push_back(jet);
00083         } else {
00084           ljets.push_back(jet);
00085         }
00086       }
00087       MSG_DEBUG("Number of b-jets = " << bjets.size());
00088       if (bjets.size() != 2) {
00089         MSG_DEBUG("Event failed b-tagging cut");
00090         vetoEvent;
00091       }
00092       _h_bjet_1_pT->fill(bjets[0].momentum().pT(), weight);
00093       _h_bjet_2_pT->fill(bjets[1].momentum().pT(), weight);
00094       _h_ljet_1_pT->fill(ljets[0].momentum().pT(), weight);
00095       _h_ljet_2_pT->fill(ljets[1].momentum().pT(), weight);
00096 
00097       const FourMomentum W  = ljets[0].momentum() + ljets[1].momentum();
00098       const FourMomentum t1 = W + bjets[0].momentum();
00099       const FourMomentum t2 = W + bjets[1].momentum();
00100 
00101       _h_W_mass->fill(W.mass(), weight);
00102       _h_t_mass->fill(t1.mass(), weight);
00103       _h_t_mass->fill(t2.mass(), weight);
00104       if (inRange(W.mass()/GeV, 70, 90)) {
00105         MSG_DEBUG("W found with mass " << W.mass()/GeV << " GeV");
00106         _h_t_mass_W_cut->fill(t1.mass(), weight);
00107         _h_t_mass_W_cut->fill(t2.mass(), weight);
00108       }
00109 
00110       // All combinatoric 2-jet masses
00111       _h_W_comb_mass->fill(mass(jets[0].momentum() + jets[1].momentum()), weight);
00112       _h_W_comb_mass->fill(mass(jets[0].momentum() + jets[2].momentum()), weight);
00113       _h_W_comb_mass->fill(mass(jets[0].momentum() + jets[3].momentum()), weight);
00114       _h_W_comb_mass->fill(mass(jets[1].momentum() + jets[2].momentum()), weight);
00115       _h_W_comb_mass->fill(mass(jets[1].momentum() + jets[3].momentum()), weight);
00116       _h_W_comb_mass->fill(mass(jets[2].momentum() + jets[3].momentum()), weight);
00117 
00118       // All combinatoric 3-jet masses
00119       _h_t_comb_mass->fill(mass(jets[0].momentum() + jets[1].momentum() + jets[2].momentum()), weight);
00120       _h_t_comb_mass->fill(mass(jets[0].momentum() + jets[1].momentum() + jets[3].momentum()), weight);
00121       _h_t_comb_mass->fill(mass(jets[0].momentum() + jets[2].momentum() + jets[3].momentum()), weight);
00122       _h_t_comb_mass->fill(mass(jets[1].momentum() + jets[2].momentum() + jets[3].momentum()), weight);
00123 
00124       /// @todo Add reconstruction of the other top from the leptonically decaying W, using WFinder
00125     }
00126 
00127 
00128     void finalize() {
00129       // No histos, so nothing to do!
00130     }
00131 
00132     //@}
00133 
00134 
00135   private:
00136 
00137     AIDA::IHistogram1D *_h_jet_1_pT, *_h_jet_2_pT, *_h_jet_3_pT, *_h_jet_4_pT;
00138     AIDA::IHistogram1D *_h_bjet_1_pT, *_h_bjet_2_pT;
00139     AIDA::IHistogram1D *_h_ljet_1_pT, *_h_ljet_2_pT;
00140     AIDA::IHistogram1D *_h_W_mass;
00141     AIDA::IHistogram1D *_h_t_mass;
00142     AIDA::IHistogram1D *_h_W_comb_mass;
00143     AIDA::IHistogram1D *_h_t_comb_mass;
00144     AIDA::IHistogram1D *_h_t_mass_W_cut;
00145 
00146   };
00147 
00148 
00149   // This global object acts as a hook for the plugin system
00150   AnalysisBuilder<MC_TTBAR> plugin_MC_TTBAR;
00151 
00152 }