rivet is hosted by Hepforge, IPPP Durham
MC_MUONS.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analyses/MC_ParticleAnalysis.hh"
00003 #include "Rivet/Projections/IdentifiedFinalState.hh"
00004 
00005 namespace Rivet {
00006 
00007 
00008   /// @brief MC validation analysis for muons
00009   class MC_MUONS : public MC_ParticleAnalysis {
00010   public:
00011 
00012     MC_MUONS()
00013       : MC_ParticleAnalysis("MC_MUONS", 2, "muon")
00014     {    }
00015 
00016 
00017   public:
00018 
00019     void init() {
00020       IdentifiedFinalState muons;
00021       muons.acceptIdPair(PID::MUON);
00022       addProjection(muons, "Muons");
00023 
00024       MC_ParticleAnalysis::init();
00025     }
00026 
00027 
00028     void analyze(const Event& event) {
00029       const Particles mus = applyProjection<FinalState>(event, "Muons").particlesByPt(Cuts::pT > 0.5*GeV);
00030       MC_ParticleAnalysis::_analyze(event, mus);
00031     }
00032 
00033 
00034     void finalize() {
00035       MC_ParticleAnalysis::finalize();
00036     }
00037 
00038   };
00039 
00040 
00041   // The hook for the plugin system
00042   DECLARE_RIVET_PLUGIN(MC_MUONS);
00043 
00044 }