rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_S8971293.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/BinnedHistogram.hh"
00004 #include "Rivet/RivetYODA.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   class ATLAS_2011_S8971293 : public Analysis {
00013   public:
00014 
00015     /// @name Constructors etc.
00016     //@{
00017 
00018     /// Constructor
00019     ATLAS_2011_S8971293()
00020       : Analysis("ATLAS_2011_S8971293")
00021     {    }
00022 
00023     //@}
00024 
00025 
00026   public:
00027 
00028     /// @name Analysis methods
00029     //@{
00030 
00031     /// Book histograms and initialise projections before the run
00032     void init() {
00033       /// Initialise and register projections
00034       addProjection(FastJets(FinalState(), FastJets::ANTIKT, 0.6), "AntiKtJets06");
00035 
00036       /// Book histograms
00037       _h_deltaPhi.addHistogram(110., 160., bookHisto1D(1, 1, 1));
00038       _h_deltaPhi.addHistogram(160., 210., bookHisto1D(1, 1, 2));
00039       _h_deltaPhi.addHistogram(210., 260., bookHisto1D(1, 1, 3));
00040       _h_deltaPhi.addHistogram(260., 310., bookHisto1D(1, 1, 4));
00041       _h_deltaPhi.addHistogram(310., 400., bookHisto1D(1, 1, 5));
00042       _h_deltaPhi.addHistogram(400., 500., bookHisto1D(1, 1, 6));
00043       _h_deltaPhi.addHistogram(500., 600., bookHisto1D(1, 1, 7));
00044       _h_deltaPhi.addHistogram(600., 800., bookHisto1D(1, 1, 8));
00045       _h_deltaPhi.addHistogram(800., 10000., bookHisto1D(1, 1, 9));
00046     }
00047 
00048 
00049     /// Perform the per-event analysis
00050     void analyze(const Event& event) {
00051       const double weight = event.weight();
00052 
00053       Jets jets06;
00054       foreach (const Jet& jet, applyProjection<FastJets>(event, "AntiKtJets06").jetsByPt(100.0*GeV)) {
00055         if (fabs(jet.momentum().rapidity()) < 2.8) {
00056           jets06.push_back(jet);
00057         }
00058       }
00059       if (jets06.size()>1){
00060         if (fabs(jets06[0].momentum().rapidity())<0.8 && fabs(jets06[1].momentum().rapidity())<0.8) {
00061           double observable = mapAngle0ToPi(jets06[0].momentum().phi()-jets06[1].momentum().phi()) / M_PI;
00062           _h_deltaPhi.fill(jets06[0].momentum().pT(), observable, weight);
00063         }
00064       }
00065     }
00066 
00067 
00068     /// Normalise histograms etc., after the run
00069     void finalize() {
00070       foreach (Histo1DPtr hist, _h_deltaPhi.getHistograms()) {
00071         normalize(hist, 1/M_PI);
00072       }
00073     }
00074 
00075     //@}
00076 
00077 
00078   private:
00079 
00080     /// @name Histograms
00081     //@{
00082     BinnedHistogram<double> _h_deltaPhi;
00083     //@}
00084 
00085 
00086   };
00087 
00088 
00089 
00090   // The hook for the plugin system
00091   DECLARE_RIVET_PLUGIN(ATLAS_2011_S8971293);
00092 
00093 }