rivet is hosted by Hepforge, IPPP Durham
D0_2009_S8349509.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetYODA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/ZFinder.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief D0 Z+jets angular distributions
00013   class D0_2009_S8349509 : public Analysis {
00014   public:
00015 
00016     /// @name Constructors etc.
00017     //@{
00018 
00019     /// Constructor
00020     D0_2009_S8349509() : Analysis("D0_2009_S8349509"),
00021                          _inclusive_Z_sumofweights(0.0)
00022     {    }
00023 
00024     //@}
00025 
00026 
00027     /// @name Analysis methods
00028     //@{
00029 
00030     /// Book histograms
00031     void init() {
00032       FinalState fs;
00033       ZFinder zfinder(fs, -1.7, 1.7, 15.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2, false, true);
00034       addProjection(zfinder, "ZFinder");
00035 
00036       FastJets conefinder(zfinder.remainingFinalState(), FastJets::D0ILCONE, 0.5);
00037       addProjection(conefinder, "ConeFinder");
00038 
00039       _h_dphi_jet_Z25 = bookHisto1D(1, 1, 1);
00040       _h_dphi_jet_Z45 = bookHisto1D(2, 1, 1);
00041 
00042       _h_dy_jet_Z25 = bookHisto1D(3, 1, 1);
00043       _h_dy_jet_Z45 = bookHisto1D(4, 1, 1);
00044 
00045       _h_yboost_jet_Z25 = bookHisto1D(5, 1, 1);
00046       _h_yboost_jet_Z45 = bookHisto1D(6, 1, 1);
00047 
00048       _h_dphi_jet_Z25_xs = bookHisto1D(1, 1, 2);
00049       _h_dphi_jet_Z45_xs = bookHisto1D(2, 1, 2);
00050 
00051       _h_dy_jet_Z25_xs = bookHisto1D(3, 1, 2);
00052       _h_dy_jet_Z45_xs = bookHisto1D(4, 1, 2);
00053 
00054       _h_yboost_jet_Z25_xs = bookHisto1D(5, 1, 2);
00055       _h_yboost_jet_Z45_xs = bookHisto1D(6, 1, 2);
00056 
00057       _inclusive_Z_sumofweights = 0.0;
00058     }
00059 
00060 
00061     void analyze(const Event& event) {
00062       const double weight = event.weight();
00063 
00064       const ZFinder& zfinder = applyProjection<ZFinder>(event, "ZFinder");
00065       if (zfinder.bosons().size()==1) {
00066         // count inclusive sum of weights for histogram normalisation
00067         _inclusive_Z_sumofweights += weight;
00068 
00069         const FourMomentum Zmom = zfinder.bosons()[0].momentum();
00070         if (Zmom.pT()<25.0*GeV) {
00071           vetoEvent;
00072         }
00073 
00074         Jets jets;
00075         foreach (const Jet& j, applyProjection<JetAlg>(event, "ConeFinder").jetsByPt(20.0*GeV)) {
00076           if (fabs(j.momentum().pseudorapidity()) < 2.8) {
00077             jets.push_back(j);
00078             break;
00079           }
00080         }
00081 
00082         // Return if there are no jets:
00083         if (jets.size() < 1) {
00084           MSG_DEBUG("Skipping event " << event.genEvent().event_number()
00085                     << " because no jets pass cuts ");
00086           vetoEvent;
00087         }
00088 
00089         const FourMomentum jetmom = jets[0].momentum();
00090         double yZ = Zmom.rapidity();
00091         double yjet = jetmom.rapidity();
00092         double dphi = deltaPhi(Zmom.phi(), jetmom.phi());
00093         double dy = fabs(yZ-yjet);
00094         double yboost = fabs(yZ+yjet)/2.0;
00095 
00096         if (Zmom.pT() > 25.0*GeV) {
00097           _h_dphi_jet_Z25->fill(dphi,weight);
00098           _h_dy_jet_Z25->fill(dy, weight);
00099           _h_yboost_jet_Z25->fill(yboost, weight);
00100           _h_dphi_jet_Z25_xs->fill(dphi,weight);
00101           _h_dy_jet_Z25_xs->fill(dy, weight);
00102           _h_yboost_jet_Z25_xs->fill(yboost, weight);
00103         }
00104         if (Zmom.pT() > 45.0*GeV) {
00105           _h_dphi_jet_Z45->fill(dphi,weight);
00106           _h_dy_jet_Z45->fill(dy, weight);
00107           _h_yboost_jet_Z45->fill(yboost, weight);
00108           _h_dphi_jet_Z45_xs->fill(dphi,weight);
00109           _h_dy_jet_Z45_xs->fill(dy, weight);
00110           _h_yboost_jet_Z45_xs->fill(yboost, weight);
00111         }
00112       }
00113 
00114     }
00115 
00116 
00117     void finalize() {
00118       if (_inclusive_Z_sumofweights == 0.0) return;
00119       scale(_h_dphi_jet_Z25, 1.0/_inclusive_Z_sumofweights);
00120       scale(_h_dphi_jet_Z45, 1.0/_inclusive_Z_sumofweights);
00121       scale(_h_dy_jet_Z25, 1.0/_inclusive_Z_sumofweights);
00122       scale(_h_dy_jet_Z45, 1.0/_inclusive_Z_sumofweights);
00123       scale(_h_yboost_jet_Z25, 1.0/_inclusive_Z_sumofweights);
00124       scale(_h_yboost_jet_Z45, 1.0/_inclusive_Z_sumofweights);
00125 
00126       scale(_h_dphi_jet_Z25_xs, crossSectionPerEvent());
00127       scale(_h_dphi_jet_Z45_xs, crossSectionPerEvent());
00128       scale(_h_dy_jet_Z25_xs, crossSectionPerEvent());
00129       scale(_h_dy_jet_Z45_xs, crossSectionPerEvent());
00130       scale(_h_yboost_jet_Z25_xs, crossSectionPerEvent());
00131       scale(_h_yboost_jet_Z45_xs, crossSectionPerEvent());
00132     }
00133 
00134     //@}
00135 
00136   private:
00137 
00138     // Data members like post-cuts event weight counters go here
00139 
00140   private:
00141 
00142     /// @name Histograms (normalised)
00143     //@{
00144     Histo1DPtr _h_dphi_jet_Z25;
00145     Histo1DPtr _h_dphi_jet_Z45;
00146 
00147     Histo1DPtr _h_dy_jet_Z25;
00148     Histo1DPtr _h_dy_jet_Z45;
00149 
00150     Histo1DPtr _h_yboost_jet_Z25;
00151     Histo1DPtr _h_yboost_jet_Z45;
00152     //@}
00153 
00154     /// @name Histograms (absolute cross sections)
00155     //@{
00156     Histo1DPtr _h_dphi_jet_Z25_xs;
00157     Histo1DPtr _h_dphi_jet_Z45_xs;
00158 
00159     Histo1DPtr _h_dy_jet_Z25_xs;
00160     Histo1DPtr _h_dy_jet_Z45_xs;
00161 
00162     Histo1DPtr _h_yboost_jet_Z25_xs;
00163     Histo1DPtr _h_yboost_jet_Z45_xs;
00164     //@}
00165 
00166     double _inclusive_Z_sumofweights;
00167 
00168   };
00169 
00170 
00171 
00172   // The hook for the plugin system
00173   DECLARE_RIVET_PLUGIN(D0_2009_S8349509);
00174 
00175 }