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/RivetAIDA.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       /// Set whether your finalize method needs the generator cross section
00023       setNeedsCrossSection(false);
00024     }
00025 
00026     //@}
00027 
00028 
00029   public:
00030 
00031     /// @name Analysis methods
00032     //@{
00033 
00034     /// Book histograms and initialise projections before the run
00035     void init() {
00036       /// Initialise and register projections
00037       addProjection(FastJets(FinalState(), FastJets::ANTIKT, 0.6), "AntiKtJets06");
00038 
00039       /// Book histograms
00040       _h_deltaPhi.addHistogram(110., 160., bookHistogram1D(1, 1, 1));
00041       _h_deltaPhi.addHistogram(160., 210., bookHistogram1D(1, 1, 2));
00042       _h_deltaPhi.addHistogram(210., 260., bookHistogram1D(1, 1, 3));
00043       _h_deltaPhi.addHistogram(260., 310., bookHistogram1D(1, 1, 4));
00044       _h_deltaPhi.addHistogram(310., 400., bookHistogram1D(1, 1, 5));
00045       _h_deltaPhi.addHistogram(400., 500., bookHistogram1D(1, 1, 6));
00046       _h_deltaPhi.addHistogram(500., 600., bookHistogram1D(1, 1, 7));
00047       _h_deltaPhi.addHistogram(600., 800., bookHistogram1D(1, 1, 8));
00048       _h_deltaPhi.addHistogram(800., 10000., bookHistogram1D(1, 1, 9));
00049     }
00050 
00051 
00052     /// Perform the per-event analysis
00053     void analyze(const Event& event) {
00054       const double weight = event.weight();
00055 
00056       Jets jets06;
00057       foreach (const Jet& jet, applyProjection<FastJets>(event, "AntiKtJets06").jetsByPt(100.0*GeV)) {
00058         if (fabs(jet.momentum().rapidity()) < 2.8) {
00059           jets06.push_back(jet);
00060         }
00061       } 
00062       if (jets06.size()>1){
00063         if (fabs(jets06[0].momentum().rapidity())<0.8 && fabs(jets06[1].momentum().rapidity())<0.8) {
00064           double observable = mapAngle0ToPi(jets06[0].momentum().phi()-jets06[1].momentum().phi()) / M_PI;
00065           _h_deltaPhi.fill(jets06[0].momentum().pT(), observable, weight);
00066         }
00067       }
00068     }
00069 
00070 
00071     /// Normalise histograms etc., after the run
00072     void finalize() {
00073       foreach (AIDA::IHistogram1D* hist, _h_deltaPhi.getHistograms()) {
00074         normalize(hist, 1/M_PI);
00075       }
00076     }
00077 
00078     //@}
00079 
00080 
00081   private:
00082 
00083     /// @name Histograms
00084     //@{
00085     BinnedHistogram<double> _h_deltaPhi;
00086     //@}
00087 
00088 
00089   };
00090 
00091 
00092 
00093   // This global object acts as a hook for the plugin system
00094   AnalysisBuilder<ATLAS_2011_S8971293> plugin_ATLAS_2011_S8971293;
00095 
00096 
00097 }