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       FinalState fs;
00024       ZFinder hfinder(fs, -3.5, 3.5, 25.0*GeV, PID::TAU, 115.0*GeV, 125.0*GeV, 0.0, false, false);
00025       addProjection(hfinder, "Hfinder");
00026 
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()));
00029       _h_H_pT_peak = bookHisto1D("H_pT_peak", 25, 0.0, 25.0);
00030       _h_H_y = bookHisto1D("H_y", 40, -4.0, 4.0);
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()));
00033       _h_lepton_eta = bookHisto1D("lepton_eta", 40, -4.0, 4.0);
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       _h_H_mass->fill(hmom.mass(),weight);
00048       _h_H_pT->fill(hmom.pT(),weight);
00049       _h_H_pT_peak->fill(hmom.pT(),weight);
00050       _h_H_y->fill(hmom.rapidity(),weight);
00051       _h_H_phi->fill(hmom.azimuthalAngle(),weight);
00052       foreach (const Particle& l, hfinder.constituents()) {
00053         _h_lepton_pT->fill(l.pT(), weight);
00054         _h_lepton_eta->fill(l.eta(), weight);
00055       }
00056     }
00057 
00058 
00059     /// Finalize
00060     void finalize() {
00061       scale(_h_H_mass, crossSection()/sumOfWeights());
00062       scale(_h_H_pT, crossSection()/sumOfWeights());
00063       scale(_h_H_pT_peak, crossSection()/sumOfWeights());
00064       scale(_h_H_y, crossSection()/sumOfWeights());
00065       scale(_h_H_phi, crossSection()/sumOfWeights());
00066       scale(_h_lepton_pT, crossSection()/sumOfWeights());
00067       scale(_h_lepton_eta, crossSection()/sumOfWeights());
00068     }
00069 
00070     //@}
00071 
00072 
00073   private:
00074 
00075     /// @name Histograms
00076     //@{
00077     Histo1DPtr _h_H_mass;
00078     Histo1DPtr _h_H_pT;
00079     Histo1DPtr _h_H_pT_peak;
00080     Histo1DPtr _h_H_y;
00081     Histo1DPtr _h_H_phi;
00082     Histo1DPtr _h_lepton_pT;
00083     Histo1DPtr _h_lepton_eta;
00084     //@}
00085 
00086   };
00087 
00088 
00089 
00090   // The hook for the plugin system
00091   DECLARE_RIVET_PLUGIN(MC_HINC);
00092 
00093 }