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