rivet is hosted by Hepforge, IPPP Durham
D0_2010_S8821313.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/FinalState.hh"
00005 #include "Rivet/Projections/ZFinder.hh"
00006 
00007 namespace Rivet {
00008 
00009   using namespace Cuts;
00010 
00011 
00012   class D0_2010_S8821313 : public Analysis {
00013   public:
00014 
00015     /// Constructor
00016     D0_2010_S8821313()
00017       : Analysis("D0_2010_S8821313")
00018     {    }
00019 
00020 
00021     /// @name Analysis methods
00022     //@{
00023 
00024     /// Book histograms and initialise projections before the run
00025     void init() {
00026 
00027       /// Initialise and register projections
00028       Cut cuts = (   etaIn(-3.0, -1.5)
00029            | etaIn(-1.1,  1.1)
00030            | etaIn( 1.5,  3.0) )
00031     & (pT >= 20.0*GeV);
00032       FinalState fs; //< @todo Should the eta cuts be on the electrons or the resulting Z? I'd have thought the electrons
00033       ZFinder zfinder_ee(fs, cuts, PID::ELECTRON, 70*GeV, 110*GeV, 0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00034       addProjection(zfinder_ee, "zfinder_ee");
00035       ZFinder zfinder_mm(fs, 
00036              etaIn(-2.0, 2.0) & (pT >= 15.0*GeV),
00037              PID::MUON, 70*GeV, 110*GeV, 0.0, ZFinder::NOCLUSTER, ZFinder::NOTRACK);
00038       addProjection(zfinder_mm, "zfinder_mm");
00039 
00040       /// Book histograms here
00041       _h_phistar_ee.addHistogram(0.0, 1.0, bookHisto1D(1, 1, 1));
00042       _h_phistar_ee.addHistogram(1.0, 2.0, bookHisto1D(1, 1, 2));
00043       _h_phistar_ee.addHistogram(2.0, 10.0, bookHisto1D(1, 1, 3));
00044       _h_phistar_mm.addHistogram(0.0, 1.0, bookHisto1D(2, 1, 1));
00045       _h_phistar_mm.addHistogram(1.0, 2.0, bookHisto1D(2, 1, 2));
00046     }
00047 
00048 
00049     /// Perform the per-event analysis
00050     void analyze(const Event& event) {
00051       const double weight = event.weight();
00052 
00053       const ZFinder& zfinder_ee = applyProjection<ZFinder>(event, "zfinder_ee");
00054       if (zfinder_ee.bosons().size() == 1) {
00055         Particles ee = zfinder_ee.constituents();
00056         std::sort(ee.begin(), ee.end(), cmpMomByPt);
00057         const FourMomentum& eminus = PID::threeCharge(ee[0].pid()) < 0 ? ee[0].momentum() : ee[1].momentum();
00058         const FourMomentum& eplus  = PID::threeCharge(ee[0].pid()) < 0 ? ee[1].momentum() : ee[0].momentum();
00059         double phi_acop = M_PI - mapAngle0ToPi(eminus.phi() - eplus.phi());
00060         double costhetastar = tanh((eminus.eta() - eplus.eta())/2);
00061         double sin2thetastar = 1 - sqr(costhetastar);
00062         if (sin2thetastar < 0) sin2thetastar = 0;
00063         const double phistar = tan(phi_acop/2) * sqrt(sin2thetastar);
00064         const FourMomentum& zmom = zfinder_ee.bosons()[0].momentum();
00065         _h_phistar_ee.fill(zmom.rapidity(), phistar, weight);
00066       }
00067 
00068       const ZFinder& zfinder_mm = applyProjection<ZFinder>(event, "zfinder_mm");
00069       if (zfinder_mm.bosons().size() == 1) {
00070         Particles mm = zfinder_mm.constituents();
00071         std::sort(mm.begin(), mm.end(), cmpMomByPt);
00072         const FourMomentum& mminus = PID::threeCharge(mm[0].pid()) < 0 ? mm[0].momentum() : mm[1].momentum();
00073         const FourMomentum& mplus  = PID::threeCharge(mm[0].pid()) < 0 ? mm[1].momentum() : mm[0].momentum();
00074         double phi_acop = M_PI - mapAngle0ToPi(mminus.phi() - mplus.phi());
00075         double costhetastar = tanh((mminus.eta() - mplus.eta())/2);
00076         double sin2thetastar = 1 - sqr(costhetastar);
00077         if (sin2thetastar < 0) sin2thetastar = 0;
00078         const double phistar = tan(phi_acop/2) * sqrt(sin2thetastar);
00079         const FourMomentum& zmom = zfinder_mm.bosons()[0].momentum();
00080         _h_phistar_mm.fill(zmom.rapidity(), phistar, weight);
00081       }
00082     }
00083 
00084 
00085     /// Normalise histograms etc., after the run
00086     void finalize() {
00087       foreach (Histo1DPtr hist, _h_phistar_ee.getHistograms()) normalize(hist);
00088       foreach (Histo1DPtr hist, _h_phistar_mm.getHistograms()) normalize(hist);
00089     }
00090 
00091     //@}
00092 
00093 
00094   private:
00095 
00096     /// @name Histograms
00097     //@{
00098     BinnedHistogram<double> _h_phistar_ee;
00099     BinnedHistogram<double> _h_phistar_mm;
00100     //@}
00101 
00102 
00103   };
00104 
00105 
00106 
00107   // The hook for the plugin system
00108   DECLARE_RIVET_PLUGIN(D0_2010_S8821313);
00109 
00110 }