rivet is hosted by Hepforge, IPPP Durham
MC_HINC.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 
00005 namespace Rivet {
00006 
00007 
00008   /// @brief MC validation analysis for higgs [-> tau tau] events
00009   class MC_HINC : public Analysis {
00010   public:
00011 
00012     /// Default constructor
00013     MC_HINC()
00014       : Analysis("MC_HINC")
00015     {    }
00016 
00017 
00018     /// @name Analysis methods
00019     //@{
00020 
00021     /// Book histograms
00022     void init() {
00023       /// @todo Urk, abuse! Need explicit HiggsFinder (and TauFinder?)
00024       Cut cut = EtaIn(-3.5,3.5) & (Cuts::pT >= 25.0*GeV);
00025       ZFinder hfinder(FinalState(), cut, PID::TAU, 115*GeV, 125*GeV, 0.0, ZFinder::NOCLUSTER);
00026       addProjection(hfinder, "Hfinder");
00027       _h_H_mass = bookHisto1D("H_mass", 50, 119.7, 120.3);
00028       _h_H_pT = bookHisto1D("H_pT", logspace(100, 1.0, 0.5*sqrtS()/GeV));
00029       _h_H_pT_peak = bookHisto1D("H_pT_peak", 25, 0.0, 25.0);
00030       _h_H_y = bookHisto1D("H_y", 40, -4, 4);
00031       _h_H_phi = bookHisto1D("H_phi", 25, 0.0, TWOPI);
00032       _h_lepton_pT = bookHisto1D("lepton_pT", logspace(100, 10.0, 0.25*sqrtS()/GeV));
00033       _h_lepton_eta = bookHisto1D("lepton_eta", 40, -4, 4);
00034     }
00035 
00036 
00037     /// Do the analysis
00038     void analyze(const Event & e) {
00039       const ZFinder& hfinder = applyProjection<ZFinder>(e, "Hfinder");
00040       if (hfinder.bosons().size() != 1) vetoEvent;
00041       const double weight = e.weight();
00042 
00043       FourMomentum hmom(hfinder.bosons()[0].momentum());
00044       _h_H_mass->fill(hmom.mass()/GeV, weight);
00045       _h_H_pT->fill(hmom.pT()/GeV, weight);
00046       _h_H_pT_peak->fill(hmom.pT()/GeV, weight);
00047       _h_H_y->fill(hmom.rapidity(), weight);
00048       _h_H_phi->fill(hmom.azimuthalAngle(), weight);
00049       foreach (const Particle& l, hfinder.constituents()) {
00050         _h_lepton_pT->fill(l.pT()/GeV, weight);
00051         _h_lepton_eta->fill(l.eta(), weight);
00052       }
00053     }
00054 
00055 
00056     /// Finalize
00057     void finalize() {
00058       const double xsec = crossSection()/picobarn;
00059       normalize(_h_H_mass, xsec);
00060       normalize(_h_H_pT, xsec);
00061       normalize(_h_H_pT_peak, xsec);
00062       normalize(_h_H_y, xsec);
00063       normalize(_h_H_phi, xsec);
00064       normalize(_h_lepton_pT, xsec);
00065       normalize(_h_lepton_eta, xsec);
00066     }
00067 
00068     //@}
00069 
00070 
00071   private:
00072 
00073     /// @name Histograms
00074     //@{
00075     Histo1DPtr _h_H_mass;
00076     Histo1DPtr _h_H_pT;
00077     Histo1DPtr _h_H_pT_peak;
00078     Histo1DPtr _h_H_y;
00079     Histo1DPtr _h_H_phi;
00080     Histo1DPtr _h_lepton_pT;
00081     Histo1DPtr _h_lepton_eta;
00082     //@}
00083 
00084   };
00085 
00086 
00087 
00088   // The hook for the plugin system
00089   DECLARE_RIVET_PLUGIN(MC_HINC);
00090 
00091 }