rivet is hosted by Hepforge, IPPP Durham
D0_1996_S3324664.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/BinnedHistogram.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief D0 azimuthal correlation of jets widely separated in rapidity
00011   class D0_1996_S3324664 : public Analysis {
00012   public:
00013 
00014     /// @name Constructors etc.
00015     //@{
00016 
00017     /// Constructor
00018     D0_1996_S3324664() : Analysis("D0_1996_S3324664")
00019     {    }
00020 
00021 
00022     /// @name Analysis methods
00023     //@{
00024 
00025     void init() {
00026       const FinalState fs;
00027       addProjection(fs, "FS");
00028       /// @todo Use correct jet algorithm
00029       addProjection(FastJets(fs, FastJets::D0ILCONE, 0.7), "ConeJets");
00030 
00031       _h_deta = bookHisto1D(1, 1, 1);
00032       _h_dphi.addHistogram(0.0, 2.0, bookHisto1D(2, 1, 1));
00033       _h_dphi.addHistogram(2.0, 4.0, bookHisto1D(2, 1, 2));
00034       _h_dphi.addHistogram(4.0, 6.0, bookHisto1D(2, 1, 3));
00035       _h_cosdphi_deta = bookProfile1D(3, 1, 1);
00036     }
00037 
00038 
00039     void analyze(const Event& event) {
00040       const double weight = event.weight();
00041 
00042       Jets jets;
00043       foreach (const Jet& jet, applyProjection<FastJets>(event, "ConeJets").jets(Cuts::pT > 20*GeV)) {
00044         if (jet.abseta() < 3.0) jets.push_back(jet);
00045       }
00046 
00047       if (jets.size() < 2) vetoEvent;
00048 
00049       FourMomentum minjet = jets[0].momentum();
00050       FourMomentum maxjet = jets[1].momentum();
00051       double mineta = minjet.eta();
00052       double maxeta = maxjet.eta();
00053 
00054       foreach (const Jet& jet, jets) {
00055         double eta = jet.eta();
00056         if (eta < mineta) {
00057           minjet = jet.momentum();
00058           mineta = eta;
00059         } else if (eta > maxeta) {
00060           maxjet = jet.momentum();
00061           maxeta = eta;
00062         }
00063       }
00064 
00065       if (minjet.Et() < 50*GeV && maxjet.Et() < 50.0*GeV) vetoEvent;
00066 
00067       double deta = maxjet.eta()-minjet.eta();
00068       double dphi = mapAngle0To2Pi(maxjet.phi()-minjet.phi());
00069 
00070       _h_deta->fill(deta, weight);
00071       _h_dphi.fill(deta, 1.0-dphi/M_PI, weight);
00072       _h_cosdphi_deta->fill(deta, cos(M_PI-dphi), weight);
00073     }
00074 
00075 
00076     void finalize() {
00077       // Normalised to #events
00078       normalize(_h_deta, 8830.0); // fixed norm OK
00079 
00080       // I have no idea what this is normalised to... in the paper it says unity!
00081       /// @todo Understand this!
00082       foreach (Histo1DPtr histo, _h_dphi.getHistograms()) {
00083         /// @todo Prefer to scale rather than normalize, if possible
00084         normalize(histo, 0.0798);
00085       }
00086 
00087     }
00088 
00089     //@}
00090 
00091 
00092   private:
00093 
00094     /// @name Histograms
00095     //@{
00096     Histo1DPtr _h_deta;
00097     BinnedHistogram<double> _h_dphi;
00098     Profile1DPtr _h_cosdphi_deta;
00099     //@}
00100 
00101   };
00102 
00103 
00104 
00105   // The hook for the plugin system
00106   DECLARE_RIVET_PLUGIN(D0_1996_S3324664);
00107 
00108 }