rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_I1204784.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 #include "Rivet/Tools/BinnedHistogram.hh"
00005 
00006 namespace Rivet {
00007 
00008   
00009 
00010 
00011   /// ATLAS Z phi* measurement
00012   class ATLAS_2012_I1204784 : public Analysis {
00013     public:
00014 
00015       /// Constructor
00016       ATLAS_2012_I1204784()
00017         : Analysis("ATLAS_2012_I1204784")
00018       {      }
00019 
00020 
00021     public:
00022 
00023       /// Book histograms and initialise projections before the run
00024       void init() {
00025         FinalState fs;
00026         Cut cuts = Cuts::abseta < 2.4 && Cuts::pT > 20*GeV;
00027         ZFinder zfinder_dressed_el(fs, cuts, PID::ELECTRON, 66*GeV, 116*GeV, 0.1, ZFinder::CLUSTERNODECAY);
00028         addProjection(zfinder_dressed_el, "ZFinder_dressed_el");
00029         ZFinder zfinder_bare_el(fs, cuts, PID::ELECTRON, 66*GeV, 116*GeV, 0.0, ZFinder::NOCLUSTER);
00030         addProjection(zfinder_bare_el, "ZFinder_bare_el");
00031         ZFinder zfinder_dressed_mu(fs, cuts, PID::MUON, 66*GeV, 116*GeV, 0.1, ZFinder::CLUSTERNODECAY);
00032         addProjection(zfinder_dressed_mu, "ZFinder_dressed_mu");
00033         ZFinder zfinder_bare_mu(fs, cuts, PID::MUON, 66*GeV, 116*GeV, 0.0, ZFinder::NOCLUSTER);
00034         addProjection(zfinder_bare_mu, "ZFinder_bare_mu");
00035 
00036         // Book histograms
00037         // Single-differential plots
00038         _hist_zphistar_el_bare = bookHisto1D(1, 1, 1);
00039         _hist_zphistar_mu_bare = bookHisto1D(1, 1, 2);
00040         _hist_zphistar_el_dressed = bookHisto1D(2, 1, 1);
00041         _hist_zphistar_mu_dressed = bookHisto1D(2, 1, 2);
00042 
00043         // Double-differential plots
00044         _h_phistar_el_bare.addHistogram(0.0, 0.8, bookHisto1D(3, 1, 1));
00045         _h_phistar_el_bare.addHistogram(0.8, 1.6, bookHisto1D(3, 1, 2));
00046         _h_phistar_el_bare.addHistogram(1.6, 10.0, bookHisto1D(3, 1, 3));
00047 
00048         _h_phistar_el_dressed.addHistogram(0.0, 0.8, bookHisto1D(3, 2, 1));
00049         _h_phistar_el_dressed.addHistogram(0.8, 1.6, bookHisto1D(3, 2, 2));
00050         _h_phistar_el_dressed.addHistogram(1.6, 10.0, bookHisto1D(3, 2, 3));
00051 
00052         _h_phistar_mu_bare.addHistogram(0.0, 0.8, bookHisto1D(4, 1, 1));
00053         _h_phistar_mu_bare.addHistogram(0.8, 1.6, bookHisto1D(4, 1, 2));
00054         _h_phistar_mu_bare.addHistogram(1.6, 10.0, bookHisto1D(4, 1, 3));
00055 
00056         _h_phistar_mu_dressed.addHistogram(0.0, 0.8, bookHisto1D(4, 2, 1));
00057         _h_phistar_mu_dressed.addHistogram(0.8, 1.6, bookHisto1D(4, 2, 2));
00058         _h_phistar_mu_dressed.addHistogram(1.6, 10.0, bookHisto1D(4, 2, 3));
00059       }
00060 
00061 
00062       /// Perform the per-event analysis
00063       void analyze(const Event& event) {
00064         const double weight = event.weight();
00065 
00066         const ZFinder& zfinder_dressed_el = applyProjection<ZFinder>(event, "ZFinder_dressed_el");
00067         const ZFinder& zfinder_bare_el = applyProjection<ZFinder>(event, "ZFinder_bare_el");
00068         const ZFinder& zfinder_dressed_mu = applyProjection<ZFinder>(event, "ZFinder_dressed_mu");
00069         const ZFinder& zfinder_bare_mu = applyProjection<ZFinder>(event, "ZFinder_bare_mu");
00070 
00071         fillPlots(zfinder_dressed_el, _hist_zphistar_el_dressed, _h_phistar_el_dressed, weight);
00072         fillPlots(zfinder_bare_el, _hist_zphistar_el_bare, _h_phistar_el_bare, weight);
00073         fillPlots(zfinder_dressed_mu, _hist_zphistar_mu_dressed, _h_phistar_mu_dressed, weight);
00074         fillPlots(zfinder_bare_mu, _hist_zphistar_mu_bare, _h_phistar_mu_bare, weight);
00075       }
00076 
00077 
00078       void fillPlots(const ZFinder& zfind, Histo1DPtr hist, BinnedHistogram<double>& binnedHist, double weight) {
00079         if (zfind.bosons().size() != 1) return;
00080         Particles leptons = zfind.constituents(cmpMomByPt);
00081 
00082         const FourMomentum lminus = leptons[0].charge() < 0 ? leptons[0].momentum() : leptons[1].momentum();
00083         const FourMomentum lplus = leptons[0].charge() < 0 ? leptons[1].momentum() : leptons[0].momentum();
00084 
00085         const double phi_acop = M_PI - deltaPhi(lminus, lplus);
00086         const double costhetastar = tanh((lminus.eta()-lplus.eta())/2.0);
00087         const double sin2thetastar = (costhetastar <= 1) ? 1.0 - sqr(costhetastar) : 0;
00088         const double phistar = tan(phi_acop/2.0) * sqrt(sin2thetastar);
00089         hist->fill(phistar, weight);
00090 
00091         binnedHist.fill(zfind.bosons()[0].absrap(), phistar, weight);
00092       }
00093 
00094 
00095       /// Normalise histograms etc., after the run
00096       void finalize() {
00097         normalize(_hist_zphistar_el_dressed);
00098         normalize(_hist_zphistar_el_bare);
00099         normalize(_hist_zphistar_mu_dressed);
00100         normalize(_hist_zphistar_mu_bare);
00101 
00102         foreach (Histo1DPtr hist, _h_phistar_mu_dressed.getHistograms()) { normalize(hist); }
00103         foreach (Histo1DPtr hist, _h_phistar_mu_bare.getHistograms()) { normalize(hist); }
00104         foreach (Histo1DPtr hist, _h_phistar_el_bare.getHistograms()) { normalize(hist); }
00105         foreach (Histo1DPtr hist, _h_phistar_el_dressed.getHistograms()) { normalize(hist); }
00106       }
00107 
00108       //@}
00109 
00110 
00111     private:
00112 
00113       BinnedHistogram<double> _h_phistar_mu_dressed;
00114       BinnedHistogram<double> _h_phistar_mu_bare;
00115       BinnedHistogram<double> _h_phistar_el_dressed;
00116       BinnedHistogram<double> _h_phistar_el_bare;
00117 
00118       Histo1DPtr _hist_zphistar_el_dressed;
00119       Histo1DPtr _hist_zphistar_el_bare;
00120 
00121       Histo1DPtr _hist_zphistar_mu_dressed;
00122       Histo1DPtr _hist_zphistar_mu_bare;
00123 
00124       Histo1DPtr _hist_zphistar_el_bare_1;
00125       Histo1DPtr _hist_zphistar_el_bare_2;
00126       Histo1DPtr _hist_zphistar_el_bare_3;
00127 
00128       Histo1DPtr _hist_zphistar_el_dressed_1;
00129       Histo1DPtr _hist_zphistar_el_dressed_2;
00130       Histo1DPtr _hist_zphistar_el_dressed_3;
00131 
00132       Histo1DPtr _hist_zphistar_mu_bare_1;
00133       Histo1DPtr _hist_zphistar_mu_bare_2;
00134       Histo1DPtr _hist_zphistar_mu_bare_3;
00135 
00136       Histo1DPtr _hist_zphistar_mu_dressed_1;
00137       Histo1DPtr _hist_zphistar_mu_dressed_2;
00138       Histo1DPtr _hist_zphistar_mu_dressed_3;
00139 
00140   };
00141 
00142 
00143   // The hook for the plugin system
00144   DECLARE_RIVET_PLUGIN(ATLAS_2012_I1204784);
00145 
00146 }