ATLAS_2010_CONF_2010_083.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 #include "Rivet/Tools/Logging.hh"
00007 #include "LWH/Histogram1D.h"
00008 
00009 namespace Rivet {
00010 
00011   class ATLAS_2010_CONF_2010_083 : public Analysis {
00012   public:
00013 
00014     ATLAS_2010_CONF_2010_083() : Analysis("ATLAS_2010_CONF_2010_083") {
00015       setNeedsCrossSection(true);
00016     }
00017 
00018 
00019     void init() {
00020       FinalState fs(-1.5, 1.5, 0.0*GeV);
00021       FastJets jetsproj(fs, FastJets::ANTIKT, 0.6);
00022       addProjection(jetsproj, "Jets");
00023 
00024       for (size_t i=0 ; i<4 ; i++) {
00025         _h_dphi[i] = bookHistogram1D(i+1, 1, 1);
00026       }
00027     }
00028 
00029 
00030     void analyze(const Event& event) {
00031       const double weight = event.weight();
00032 
00033       const FastJets & jetsproj = applyProjection<FastJets>(event, "Jets");
00034       Jets alljets = jetsproj.jetsByPt(100.0*GeV);
00035       Jets jets;
00036       foreach (const Jet jet, alljets) {
00037         if (fabs(jet.momentum().eta())<0.8) {
00038           jets.push_back(jet);
00039         }
00040         if (jets.size()==2) break;
00041       }
00042 
00043       if (jets.size() < 2 || jets[0].momentum().pT() < 110.0*GeV) {
00044         vetoEvent;
00045       }
00046 
00047       const double dphi = deltaPhi(jets[0].momentum().phi(), jets[1].momentum().phi());
00048       const double ptlead = jets[0].momentum().pT();
00049 
00050       if (ptlead > 310.0*GeV) {
00051         _h_dphi[3]->fill(dphi, weight);
00052       }
00053       else if (ptlead > 210.0*GeV) {
00054         _h_dphi[2]->fill(dphi, weight);
00055       }
00056       else if (ptlead > 160.0*GeV) {
00057         _h_dphi[1]->fill(dphi, weight);
00058       }
00059       else {
00060         _h_dphi[0]->fill(dphi, weight);
00061       }
00062     }
00063 
00064     void finalize() {
00065       for (size_t i=0 ; i<4 ; i++) {
00066         normalize(_h_dphi[i], 1.0);
00067       }
00068     }
00069 
00070 
00071   private:
00072 
00073     AIDA::IHistogram1D* _h_dphi[4];
00074   };
00075 
00076   // This global object acts as a hook for the plugin system
00077   AnalysisBuilder<ATLAS_2010_CONF_2010_083> plugin_ATLAS_2010_CONF_2010_083;
00078 
00079 }
00080