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/RivetYODA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Tools/BinnedHistogram.hh"
00006 #include "Rivet/Tools/ParticleIdUtils.hh"
00007 #include "Rivet/Projections/FinalState.hh"
00008 #include "Rivet/Projections/ZFinder.hh"
00009 
00010 
00011 namespace Rivet {
00012 
00013 
00014   class D0_2010_S8821313 : public Analysis {
00015   public:
00016 
00017     /// @name Constructors etc.
00018     //@{
00019 
00020     /// Constructor
00021     D0_2010_S8821313()
00022       : Analysis("D0_2010_S8821313")
00023     {    }
00024 
00025     //@}
00026 
00027 
00028   public:
00029 
00030     /// @name Analysis methods
00031     //@{
00032 
00033     /// Book histograms and initialise projections before the run
00034     void init() {
00035 
00036       /// Initialise and register projections
00037       FinalState fs;
00038       vector<pair<double, double> > etaRanges_ee;
00039       etaRanges_ee.push_back(make_pair(-3.0, -1.5));
00040       etaRanges_ee.push_back(make_pair(-1.1, 1.1));
00041       etaRanges_ee.push_back(make_pair(1.5, 3.0));
00042       ZFinder zfinder_ee(fs, etaRanges_ee, 20.0*GeV, ELECTRON, 70.0*GeV, 110.0*GeV, 0.2, true, true);
00043       addProjection(zfinder_ee, "zfinder_ee");
00044 
00045       ZFinder zfinder_mm(fs, -2.0, 2.0, 15.0*GeV, MUON, 70.0*GeV, 110.0*GeV, 0.0, false, false);
00046       addProjection(zfinder_mm, "zfinder_mm");
00047 
00048       /// Book histograms here
00049       _h_phistar_ee.addHistogram(0.0, 1.0, bookHisto1D(1, 1, 1));
00050       _h_phistar_ee.addHistogram(1.0, 2.0, bookHisto1D(1, 1, 2));
00051       _h_phistar_ee.addHistogram(2.0, 10.0, bookHisto1D(1, 1, 3));
00052 
00053       _h_phistar_mm.addHistogram(0.0, 1.0, bookHisto1D(2, 1, 1));
00054       _h_phistar_mm.addHistogram(1.0, 2.0, bookHisto1D(2, 1, 2));
00055     }
00056 
00057 
00058     /// Perform the per-event analysis
00059     void analyze(const Event& event) {
00060       const double weight = event.weight();
00061 
00062       const ZFinder& zfinder_ee = applyProjection<ZFinder>(event, "zfinder_ee");
00063       if (zfinder_ee.bosons().size()==1) {
00064         ParticleVector ee=zfinder_ee.constituents();
00065         std::sort(ee.begin(), ee.end(), cmpParticleByPt);
00066         FourMomentum eminus=PID::threeCharge(ee[0].pdgId())<0.0?ee[0].momentum():ee[1].momentum();
00067         FourMomentum eplus=PID::threeCharge(ee[0].pdgId())<0.0?ee[1].momentum():ee[0].momentum();
00068         double phi_acop=M_PI-mapAngle0ToPi(eminus.phi()-eplus.phi());
00069         double costhetastar=tanh((eminus.eta()-eplus.eta())/2.0);
00070         double sin2thetastar=1.0-sqr(costhetastar);
00071         if (sin2thetastar<0.0) sin2thetastar=0.0;
00072         double phistar=tan(phi_acop/2.0)*sqrt(sin2thetastar);
00073 
00074         FourMomentum Zmom=zfinder_ee.bosons()[0].momentum();
00075         _h_phistar_ee.fill(Zmom.rapidity(), phistar, weight);
00076       }
00077 
00078       const ZFinder& zfinder_mm = applyProjection<ZFinder>(event, "zfinder_mm");
00079       if (zfinder_mm.bosons().size()==1) {
00080         ParticleVector mm=zfinder_mm.constituents();
00081         std::sort(mm.begin(), mm.end(), cmpParticleByPt);
00082         FourMomentum mminus=PID::threeCharge(mm[0].pdgId())<0.0?mm[0].momentum():mm[1].momentum();
00083         FourMomentum mplus=PID::threeCharge(mm[0].pdgId())<0.0?mm[1].momentum():mm[0].momentum();
00084         double phi_acop=M_PI-mapAngle0ToPi(mminus.phi()-mplus.phi());
00085         double costhetastar=tanh((mminus.eta()-mplus.eta())/2.0);
00086         double sin2thetastar=1.0-sqr(costhetastar);
00087         if (sin2thetastar<0.0) sin2thetastar=0.0;
00088         double phistar=tan(phi_acop/2.0)*sqrt(sin2thetastar);
00089 
00090         FourMomentum Zmom=zfinder_mm.bosons()[0].momentum();
00091         _h_phistar_mm.fill(Zmom.rapidity(), phistar, weight);
00092       }
00093     }
00094 
00095 
00096     /// Normalise histograms etc., after the run
00097     void finalize() {
00098       foreach (Histo1DPtr hist, _h_phistar_ee.getHistograms()) {
00099         normalize(hist, 1.0);
00100       }
00101       foreach (Histo1DPtr hist, _h_phistar_mm.getHistograms()) {
00102         normalize(hist, 1.0);
00103       }
00104     }
00105 
00106     //@}
00107 
00108 
00109   private:
00110 
00111     // Data members like post-cuts event weight counters go here
00112 
00113 
00114   private:
00115 
00116     /// @name Histograms
00117     //@{
00118 
00119     BinnedHistogram<double> _h_phistar_ee;
00120     BinnedHistogram<double> _h_phistar_mm;
00121     //@}
00122 
00123 
00124   };
00125 
00126 
00127 
00128   // The hook for the plugin system
00129   DECLARE_RIVET_PLUGIN(D0_2010_S8821313);
00130 
00131 }