rivet is hosted by Hepforge, IPPP Durham
MC_MET.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/MissingMomentum.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009 
00010   /// @brief MC validation analysis for truth-MET measurement
00011   /// @todo Add plots for MET based on prompt invisibles
00012   class MC_MET : public Analysis {
00013   public:
00014 
00015     MC_MET()
00016       : Analysis("MC_MET")
00017     {    }
00018 
00019 
00020     void init() {
00021       FinalState inclfs;
00022       FinalState calofs(Cuts::abseta < 5);
00023       declare(MissingMomentum(inclfs), "InclMET");
00024       declare(MissingMomentum(calofs), "CaloMET");
00025 
00026       _h_met_incl = bookHisto1D("met_incl", logspace(30, 1, 150));
00027       _h_met_calo = bookHisto1D("met_calo", logspace(30, 1, 150));
00028       _h_set_incl = bookHisto1D("set_incl", logspace(30, 1, sqrtS()/GeV/2));
00029       _h_set_calo = bookHisto1D("set_calo", logspace(30, 1, sqrtS()/GeV/2));
00030     }
00031 
00032 
00033     void analyze(const Event& event) {
00034       const double weight = event.weight();
00035 
00036       const MissingMomentum& mmincl = apply<MissingMomentum>(event, "InclMET");
00037       _h_met_incl->fill(mmincl.met()/GeV, weight);
00038       _h_set_incl->fill(mmincl.set()/GeV, weight);
00039 
00040       const MissingMomentum& mmcalo = apply<MissingMomentum>(event, "CaloMET");
00041       _h_met_calo->fill(mmcalo.met()/GeV, weight);
00042       _h_set_calo->fill(mmcalo.set()/GeV, weight);
00043 
00044     }
00045 
00046 
00047     void finalize() {
00048       normalize({_h_met_incl, _h_set_incl});
00049       normalize({_h_met_calo, _h_set_calo});
00050     }
00051 
00052 
00053   private:
00054 
00055     Histo1DPtr _h_met_incl, _h_set_incl;
00056     Histo1DPtr _h_met_calo, _h_set_calo;
00057 
00058   };
00059 
00060 
00061 
00062   // The hook for the plugin system
00063   DECLARE_RIVET_PLUGIN(MC_MET);
00064 
00065 
00066 }