rivet is hosted by Hepforge, IPPP Durham
MC_HJETS.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analyses/MC_JetAnalysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief MC validation analysis for higgs [-> tau tau] + jets events
00010   class MC_HJETS : public MC_JetAnalysis {
00011   public:
00012 
00013     /// Default constructor
00014     MC_HJETS()
00015       : MC_JetAnalysis("MC_HJETS", 4, "Jets")
00016     {    }
00017 
00018 
00019     /// @name Analysis methods
00020     //@{
00021 
00022     /// Book histograms
00023     void init() {
00024       FinalState fs;
00025       ZFinder hfinder(fs, -3.5, 3.5, 25.0*GeV, PID::TAU, 115.0*GeV, 125.0*GeV, 0.0, false, false);
00026       addProjection(hfinder, "Hfinder");
00027       FastJets jetpro(hfinder.remainingFinalState(), FastJets::ANTIKT, 0.4);
00028       addProjection(jetpro, "Jets");
00029 
00030       _h_H_jet1_deta = bookHisto1D("H_jet1_deta", 50, -5.0, 5.0);
00031       _h_H_jet1_dR = bookHisto1D("H_jet1_dR", 25, 0.5, 7.0);
00032 
00033       MC_JetAnalysis::init();
00034     }
00035 
00036 
00037 
00038     /// Do the analysis
00039     void analyze(const Event & e) {
00040       const ZFinder& hfinder = applyProjection<ZFinder>(e, "Hfinder");
00041       if (hfinder.bosons().size()!=1) {
00042         vetoEvent;
00043       }
00044       const double weight = e.weight();
00045 
00046       FourMomentum hmom(hfinder.bosons()[0].momentum());
00047       const Jets& jets = applyProjection<FastJets>(e, "Jets").jetsByPt(m_jetptcut);
00048       if (jets.size() > 0) {
00049         _h_H_jet1_deta->fill(hmom.eta()-jets[0].eta(), weight);
00050         _h_H_jet1_dR->fill(deltaR(hmom, jets[0].momentum()), weight);
00051       }
00052 
00053       MC_JetAnalysis::analyze(e);
00054     }
00055 
00056 
00057     /// Finalize
00058     void finalize() {
00059       scale(_h_H_jet1_deta, crossSection()/sumOfWeights());
00060       scale(_h_H_jet1_dR, crossSection()/sumOfWeights());
00061 
00062       MC_JetAnalysis::finalize();
00063     }
00064 
00065     //@}
00066 
00067 
00068   private:
00069 
00070     /// @name Histograms
00071     //@{
00072     Histo1DPtr _h_H_jet1_deta;
00073     Histo1DPtr _h_H_jet1_dR;
00074     //@}
00075 
00076   };
00077 
00078 
00079 
00080   // The hook for the plugin system
00081   DECLARE_RIVET_PLUGIN(MC_HJETS);
00082 
00083 }