rivet is hosted by Hepforge, IPPP Durham
ATLAS_2015_I1387176.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 
00006 namespace Rivet {
00007 
00008   /// Rivet analysis class for ATLAS_2015_I1387176 dataset
00009   class ATLAS_2015_I1387176 : public Analysis {
00010   public:
00011 
00012     /// Constructor
00013     DEFAULT_RIVET_ANALYSIS_CTOR(ATLAS_2015_I1387176);
00014 
00015 
00016     /// Initialization, called once before running
00017     void init() {
00018       // Projections
00019       FastJets jets(FinalState(), FastJets::ANTIKT, 0.4);
00020       jets.useInvisibles();
00021       declare(jets, "Jets");
00022 
00023       // Book histograms
00024       _hist_EEC  = bookHisto1D(1, 1, 1);
00025       _hist_AEEC = bookScatter2D(2, 1, 1);
00026 
00027       // add dummy histogram for heterogenous merging
00028       string hname = "d01-x01-y01";
00029       const Scatter2D& ref = refData(hname);
00030       hname = "d01-x01-y02";
00031       _hist_dummy = bookHisto1D(hname, ref);
00032     }
00033 
00034     void analyze(const Event& event) {
00035 
00036       const double evtWeight = event.weight();
00037       const Jets& jets = apply<FastJets>(event, "Jets").jetsByPt(Cuts::pT > 50.0*GeV && Cuts::abseta < 2.5);
00038 
00039       if (jets.size() < 2)  vetoEvent;
00040       if (jets[0].pT() + jets[1].pT() < 500*GeV)  vetoEvent;
00041 
00042       double sumEt = 0.0;
00043       foreach (Jet j, jets)  sumEt += j.E() / cosh(j.eta());
00044 
00045       foreach (Jet j1, jets) {
00046         double et1 = j1.E() / cosh(j1.eta());
00047 
00048         foreach (Jet j2, jets) {
00049           double et2 = j2.E() / cosh(j2.eta());
00050           double etWeight = et1 * et2 / ( sumEt * sumEt );
00051           double dPhi = deltaPhi(j1, j2);
00052           double cosPhi = cos(dPhi);
00053           if (cosPhi == 1.0)  cosPhi = 0.9999;
00054 
00055           _hist_EEC->fill(cosPhi, etWeight * evtWeight);
00056           _hist_dummy->fill(cosPhi, etWeight * evtWeight);
00057           }
00058       }
00059     }
00060 
00061     void finalize() {
00062 
00063       scale(_hist_dummy, crossSectionPerEvent());
00064       normalize(_hist_EEC);
00065 
00066       vector<Point2D> points;
00067       size_t nBins = _hist_EEC->numBins();
00068       for (size_t k = 0; k < nBins/2; ++k) {
00069         double x = _hist_EEC->bin(k).midpoint();
00070         double y = _hist_EEC->bin(k).height() - _hist_EEC->bin(nBins-(k+1)).height();
00071         double ex = _hist_EEC->bin(k).xWidth()/2;
00072         double e1 = _hist_EEC->bin(k).heightErr();
00073         double e2 = _hist_EEC->bin(nBins-(k+1)).heightErr();
00074         double ey = sqrt( e1 * e1 + e2 * e2 );
00075         points.push_back(Point2D(x, y, ex, ey));
00076       }
00077 
00078       _hist_AEEC->addPoints(points);
00079     }
00080 
00081   private:
00082     Histo1DPtr _hist_EEC;
00083     Histo1DPtr _hist_dummy;
00084     Scatter2DPtr _hist_AEEC;
00085   };
00086 
00087 
00088 
00089   // The hook for the plugin system
00090   DECLARE_RIVET_PLUGIN(ATLAS_2015_I1387176);
00091 
00092 }