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