|
[Rivet-svn] r3240 - in branches/2011-07-aida2yoda: . src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgFri Jul 22 11:34:49 BST 2011
Author: hoeth Date: Fri Jul 22 11:34:49 2011 New Revision: 3240 Log: merged r3225-3226 from trunk Modified: branches/2011-07-aida2yoda/ChangeLog branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc Modified: branches/2011-07-aida2yoda/ChangeLog ============================================================================== --- branches/2011-07-aida2yoda/ChangeLog Fri Jul 22 10:37:02 2011 (r3239) +++ branches/2011-07-aida2yoda/ChangeLog Fri Jul 22 11:34:49 2011 (r3240) @@ -1,3 +1,7 @@ +2011-07-18 David Mallows <dave.mallows at gmail.com> + + * Replaced MC_TTBAR: Added t,tbar reconstruction. Not yet working. + 2011-07-18 Andy Buckley <andy at insectnation.org> * bin/rivet-buildplugin.in: Pass the AM_CXXFLAGS Modified: branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc Fri Jul 22 10:37:02 2011 (r3239) +++ branches/2011-07-aida2yoda/src/Analyses/MC_TTBAR.cc Fri Jul 22 11:34:49 2011 (r3240) @@ -1,89 +1,159 @@ -// -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/RivetYODA.hh" -#include "Rivet/Tools/Logging.hh" +#include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" - -namespace Rivet { +#include "Rivet/Projections/ChargedLeptons.hh" +#include "Rivet/Projections/FastJets.hh" +#include "Rivet/AnalysisLoader.hh" +#include "Rivet/RivetYODA.hh" - /// @brief MC validation analysis for Z + jets events - /// @todo More! This analysis just checks the \f$ \eta \f$ distribution at the moment. +namespace Rivet { + class MC_TTBAR : public Analysis { - public: - /// @name Constructors etc. - //@{ + public: - /// Constructor MC_TTBAR() : Analysis("MC_TTBAR") - { - //setNeedsCrossSection(false); - } - - //@} - - - public: - + { } + /// @name Analysis methods //@{ - - /// Book histograms and initialise projections before the run void init() { + addProjection(ChargedFinalState(-3.5, 3.5, 0.5*GeV), "CFS"); + addProjection(ChargedLeptons(ChargedFinalState(-3.5, 3.5, 30*GeV)), "LFS"); + addProjection(FastJets(FinalState(-2.5, 2.5, 0*GeV), FastJets::KT, 0.5), "JETS"); + + _h_jet_0_pT = bookHisto1D("jet_0_pT", 50, 0, 250); + _h_jet_1_pT = bookHisto1D("jet_1_pT", 50, 0, 250); + _h_jet_2_pT = bookHisto1D("jet_2_pT", 50, 0, 250); + _h_jet_3_pT = bookHisto1D("jet_3_pT", 50, 0, 250); + + _h_bjet_0_pT = bookHisto1D("bjet_0_pT", 50, 0, 250); + _h_bjet_1_pT = bookHisto1D("bjet_1_pT", 50, 0, 250); + + _h_ljet_0_pT = bookHisto1D("ljet_0_pT", 50, 0, 250); + _h_ljet_1_pT = bookHisto1D("ljet_1_pT", 50, 0, 250); + + _h_W_mass = bookHisto1D("W_mass", 75, 30, 180); + _h_t_mass = bookHisto1D("t_mass", 150, 130, 430); + _h_t_mass_W_cut = bookHisto1D("t_mass_W_cut", 150, 130, 430); + _h_W_comb_mass = bookHisto1D("W_comb_mass", 75, 30, 180); + _h_t_comb_mass = bookHisto1D("t_comb_mass", 150, 130, 430); + } + + void analyze(const Event& event) { + double weight = event.weight(); - const ChargedFinalState cfs(-5.0, 5.0); - addProjection(cfs, "CFS"); + const FinalState& cfs = applyProjection<FinalState>(event, "CFS"); + getLog() << Log::DEBUG << "Total charged multiplicity = " + << cfs.size() << endl; + + const ChargedLeptons& lfs = applyProjection<ChargedLeptons>(event, "LFS"); + getLog() << Log::DEBUG << "Charged lepton multiplicity = " + << lfs.chargedLeptons().size() << endl; + if (lfs.chargedLeptons().size() != 1) { + MSG_DEBUG("Event failed lepton cut"); + vetoEvent; + } + foreach (Particle lepton, lfs.chargedLeptons()) { + getLog() << Log::DEBUG << "lepton pT = " << lepton.momentum().pT() << endl; + } - /// @todo Book histograms here, e.g.: - _hist_nch_eta = bookHisto1D("nch-eta", 20, -5.0, 5.0); - _hist_nch_pt = bookHisto1D("nch-pt", 100, 0.0, 200.0); - _hist_nch_phi = bookHisto1D("nch-phi", 100, 0.0, TWOPI); + const FastJets& jetpro = applyProjection<FastJets>(event, "JETS"); + const Jets jets = jetpro.jetsByPt(); + getLog() << Log::DEBUG << "jet multiplicity = " << jets.size() << endl; + + if (jets.size() < 4) { + getLog() << Log::DEBUG << "Event failed jet cut" << endl; + vetoEvent; + } - } + _h_jet_0_pT->fill(jets[0].momentum().pT(), weight); + _h_jet_1_pT->fill(jets[1].momentum().pT(), weight); + _h_jet_2_pT->fill(jets[2].momentum().pT(), weight); + _h_jet_3_pT->fill(jets[3].momentum().pT(), weight); + + if (jets[3].momentum().pT() < 35) { + getLog() << Log::DEBUG << "Event failed jet cut" << endl; + vetoEvent; + } + foreach (Jet jet, jets) { + getLog() << Log::DEBUG << "jet pT = " << jet.momentum().pT() << endl; + } - /// Perform the per-event analysis - void analyze(const Event& event) { - const double weight = event.weight(); - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); + Jets bjets, ljets; + foreach (Jet jet, jets) { + if (jet.momentum().pT() < 35*GeV) continue; + if (jet.containsBottom()) + bjets.push_back(jet); + else + ljets.push_back(jet); + } - foreach (const Particle& p, cfs.particles()) { - double eta = p.momentum().pseudorapidity(); - double pT = p.momentum().perp(); - double phi = p.momentum().phi(); - _hist_nch_eta->fill(eta, weight); - _hist_nch_pt->fill(pT, weight); - _hist_nch_phi->fill(phi, weight); + if (bjets.size() !=2) { + getLog() << Log::DEBUG << "Event failed b-tagging cut" << endl; + vetoEvent; } - } + _h_bjet_0_pT->fill(bjets[0].momentum().pT(), weight); + _h_bjet_1_pT->fill(bjets[1].momentum().pT(), weight); + _h_ljet_0_pT->fill(ljets[0].momentum().pT(), weight); + _h_ljet_1_pT->fill(ljets[1].momentum().pT(), weight); - /// Normalise histograms etc., after the run + FourMomentum W = ljets[0].momentum() + ljets[1].momentum(); + FourMomentum t1 = W + bjets[0].momentum(); + FourMomentum t2 = W + bjets[1].momentum(); + + _h_W_mass->fill(mass(W), weight); + _h_t_mass->fill(mass(t1), weight); + _h_t_mass->fill(mass(t2), weight); + if (mass(W) > 70 && mass(W) < 90) { + getLog() << Log::INFO << "W found with mass " << W.mass() << endl; + _h_t_mass_W_cut->fill(mass(t1), weight); + _h_t_mass_W_cut->fill(mass(t2), weight); + } + + _h_W_comb_mass->fill(mass(jets[0].momentum() + jets[1].momentum()), weight); + _h_W_comb_mass->fill(mass(jets[0].momentum() + jets[2].momentum()), weight); + _h_W_comb_mass->fill(mass(jets[0].momentum() + jets[3].momentum()), weight); + _h_W_comb_mass->fill(mass(jets[1].momentum() + jets[2].momentum()), weight); + _h_W_comb_mass->fill(mass(jets[1].momentum() + jets[3].momentum()), weight); + _h_W_comb_mass->fill(mass(jets[2].momentum() + jets[3].momentum()), weight); + + _h_t_comb_mass->fill(mass(jets[0].momentum() + jets[1].momentum() + jets[2].momentum()), weight); + _h_t_comb_mass->fill(mass(jets[0].momentum() + jets[1].momentum() + jets[3].momentum()), weight); + _h_t_comb_mass->fill(mass(jets[0].momentum() + jets[2].momentum() + jets[3].momentum()), weight); + _h_t_comb_mass->fill(mass(jets[1].momentum() + jets[2].momentum() + jets[3].momentum()), weight); + } + void finalize() { - scale(_hist_nch_eta, 1.0/sumOfWeights()); - scale(_hist_nch_pt, 1.0/sumOfWeights()); - scale(_hist_nch_phi, 1.0/sumOfWeights()); + // No histos, so nothing to do! } - - - private: - - /// @name Histograms - //@{ - Histo1DPtr _hist_nch_eta; - Histo1DPtr _hist_nch_pt; - Histo1DPtr _hist_nch_phi; //@} + private: + Histo1DPtr _h_jet_0_pT; + Histo1DPtr _h_jet_1_pT; + Histo1DPtr _h_jet_2_pT; + Histo1DPtr _h_jet_3_pT; + + Histo1DPtr _h_bjet_0_pT; + Histo1DPtr _h_bjet_1_pT; + + Histo1DPtr _h_ljet_0_pT; + Histo1DPtr _h_ljet_1_pT; + + Histo1DPtr _h_W_mass; + Histo1DPtr _h_t_mass; + Histo1DPtr _h_W_comb_mass; + Histo1DPtr _h_t_comb_mass; + Histo1DPtr _h_t_mass_W_cut; }; - - // This global object acts as a hook for the plugin system AnalysisBuilder<MC_TTBAR> plugin_MC_TTBAR; - }
More information about the Rivet-svn mailing list |