rivet is hosted by Hepforge, IPPP Durham
D0_2000_I499943.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/FastJets.hh"
00005 #include "Rivet/Projections/HeavyHadrons.hh"
00006 #include "Rivet/Projections/IdentifiedFinalState.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   class D0_2000_I499943 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     D0_2000_I499943()
00016       : Analysis("D0_2000_I499943")
00017     {    }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book histograms and initialise projections before the run
00024     void init() {
00025       FinalState fs;
00026       IdentifiedFinalState muons(Cuts::abseta < 0.8 && Cuts::pT > 4.0*GeV);
00027       muons.acceptIdPair(PID::MUON);
00028       addProjection(muons, "Muons");
00029 
00030       FastJets jetproj(fs, FastJets::D0ILCONE, 0.7);
00031       jetproj.useInvisibles();
00032       addProjection(jetproj, "Jets");
00033 
00034       // Book histograms
00035       _h_pt_leading_mu = bookHisto1D(1, 1, 1);
00036       _h_dphi_mumu = bookHisto1D(3, 1, 1);
00037     }
00038 
00039 
00040     /// Perform the per-event analysis
00041     void analyze(const Event& event) {
00042       const Jets& jets = applyProjection<FastJets>(event, "Jets").jetsByPt(12*GeV);
00043       if (jets.size() < 2) vetoEvent;
00044 
00045       const Particles& muons = applyProjection<IdentifiedFinalState>(event, "Muons").particlesByPt();
00046       if (muons.size() < 2) vetoEvent;
00047 
00048       // Muon selection: require the muons to be *close* to jets, not the usual overlap vetoing!
00049       Particles cand_mu;
00050       foreach (const Particle& mu, muons) {
00051         // Ignore muons in "bad" region 80 < phi < 110 degrees
00052         /// @todo Is this really not corrected for?!
00053         if (inRange(mu.phi(), 1.4, 1.92)) continue;
00054 
00055         // A muon is a good candidate if within R = 0.8 of a jet
00056         foreach (const Jet& jet, jets) {
00057           if (deltaR(mu, jet) < 0.8) {
00058             cand_mu.push_back(mu);
00059             break;
00060           }
00061         }
00062       }
00063 
00064       // Must find at least two jet-matched muons in the event
00065       if (cand_mu.size() < 2) vetoEvent;
00066 
00067       /// @todo Is this cut needed? Does space angle mean dR or 3D opening angle in lab frame?
00068       // Remove muon pairs closer than 165 deg in space angle (cosmic veto)
00069       // double dR_mumu = deltaR(cand_mu[0].momentum(), cand_mu[1].momentum());
00070       // if (dR_mumu < 165*degree) vetoEvent;
00071 
00072       // Selecting muon pairs with 6 < mass < 35 GeV (we use the two with highest pT)
00073       double m_mumu = (cand_mu[0].momentum() + cand_mu[1].momentum()).mass();
00074       if (!inRange(m_mumu, 6*GeV, 35*GeV)) vetoEvent;
00075 
00076       // Get phi angle between muons in degrees
00077       double dphi_mumu = deltaPhi(cand_mu[0], cand_mu[1]) * 180/M_PI;
00078 
00079       // Fill histos
00080       _h_pt_leading_mu->fill(cand_mu[0].pt()/GeV, event.weight());
00081       _h_dphi_mumu->fill(dphi_mumu, event.weight());
00082     }
00083 
00084 
00085     // Normalise histograms to cross-section
00086     void finalize() {
00087       scale(_h_pt_leading_mu, crossSection()/sumOfWeights()/nanobarn);
00088       scale(_h_dphi_mumu, crossSection()/sumOfWeights()/nanobarn);
00089     }
00090 
00091     //@}
00092 
00093 
00094   private:
00095 
00096     /// @name Histograms
00097     //@{
00098     Histo1DPtr _h_pt_leading_mu, _h_dphi_mumu;
00099     //@}
00100 
00101   };
00102 
00103 
00104   // The hook for the plugin system
00105   DECLARE_RIVET_PLUGIN(D0_2000_I499943);
00106 
00107 }