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   
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       FinalState fs;
00029       Cut cuts = (Cuts::abseta < 1.1 || Cuts::absetaIn( 1.5,  3.0)) && Cuts::pT > 20*GeV;
00030       ZFinder zfinder_ee(fs, cuts, PID::ELECTRON, 70*GeV, 110*GeV, 0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK);
00031       addProjection(zfinder_ee, "zfinder_ee");
00032       ZFinder zfinder_mm(fs, Cuts::abseta < 2 && Cuts::pT > 15*GeV, PID::MUON, 70*GeV, 110*GeV, 0.0, ZFinder::NOCLUSTER, ZFinder::NOTRACK);
00033       addProjection(zfinder_mm, "zfinder_mm");
00034 
00035       /// Book histograms here
00036       _h_phistar_ee.addHistogram(0.0, 1.0, bookHisto1D(1, 1, 1));
00037       _h_phistar_ee.addHistogram(1.0, 2.0, bookHisto1D(1, 1, 2));
00038       _h_phistar_ee.addHistogram(2.0, 10.0, bookHisto1D(1, 1, 3));
00039       _h_phistar_mm.addHistogram(0.0, 1.0, bookHisto1D(2, 1, 1));
00040       _h_phistar_mm.addHistogram(1.0, 2.0, bookHisto1D(2, 1, 2));
00041     }
00042 
00043 
00044     /// Perform the per-event analysis
00045     void analyze(const Event& event) {
00046       const double weight = event.weight();
00047 
00048       const ZFinder& zfinder_ee = applyProjection<ZFinder>(event, "zfinder_ee");
00049       if (zfinder_ee.bosons().size() == 1) {
00050         Particles ee = zfinder_ee.constituents();
00051         std::sort(ee.begin(), ee.end(), cmpMomByPt);
00052         const FourMomentum& eminus = PID::threeCharge(ee[0].pid()) < 0 ? ee[0].momentum() : ee[1].momentum();
00053         const FourMomentum& eplus  = PID::threeCharge(ee[0].pid()) < 0 ? ee[1].momentum() : ee[0].momentum();
00054         double phi_acop = M_PI - mapAngle0ToPi(eminus.phi() - eplus.phi());
00055         double costhetastar = tanh((eminus.eta() - eplus.eta())/2);
00056         double sin2thetastar = 1 - sqr(costhetastar);
00057         if (sin2thetastar < 0) sin2thetastar = 0;
00058         const double phistar = tan(phi_acop/2) * sqrt(sin2thetastar);
00059         const FourMomentum& zmom = zfinder_ee.bosons()[0].momentum();
00060         _h_phistar_ee.fill(zmom.rapidity(), phistar, weight);
00061       }
00062 
00063       const ZFinder& zfinder_mm = applyProjection<ZFinder>(event, "zfinder_mm");
00064       if (zfinder_mm.bosons().size() == 1) {
00065         Particles mm = zfinder_mm.constituents();
00066         std::sort(mm.begin(), mm.end(), cmpMomByPt);
00067         const FourMomentum& mminus = PID::threeCharge(mm[0].pid()) < 0 ? mm[0].momentum() : mm[1].momentum();
00068         const FourMomentum& mplus  = PID::threeCharge(mm[0].pid()) < 0 ? mm[1].momentum() : mm[0].momentum();
00069         double phi_acop = M_PI - mapAngle0ToPi(mminus.phi() - mplus.phi());
00070         double costhetastar = tanh((mminus.eta() - mplus.eta())/2);
00071         double sin2thetastar = 1 - sqr(costhetastar);
00072         if (sin2thetastar < 0) sin2thetastar = 0;
00073         const double phistar = tan(phi_acop/2) * sqrt(sin2thetastar);
00074         const FourMomentum& zmom = zfinder_mm.bosons()[0].momentum();
00075         _h_phistar_mm.fill(zmom.rapidity(), phistar, weight);
00076       }
00077     }
00078 
00079 
00080     /// Normalise histograms etc., after the run
00081     void finalize() {
00082       foreach (Histo1DPtr hist, _h_phistar_ee.getHistograms()) normalize(hist);
00083       foreach (Histo1DPtr hist, _h_phistar_mm.getHistograms()) normalize(hist);
00084     }
00085 
00086     //@}
00087 
00088 
00089   private:
00090 
00091     /// @name Histograms
00092     //@{
00093     BinnedHistogram<double> _h_phistar_ee;
00094     BinnedHistogram<double> _h_phistar_mm;
00095     //@}
00096 
00097 
00098   };
00099 
00100 
00101 
00102   // The hook for the plugin system
00103   DECLARE_RIVET_PLUGIN(D0_2010_S8821313);
00104 
00105 }