rivet is hosted by Hepforge, IPPP Durham
CMS_2012_I1184941.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FastJets.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   class CMS_2012_I1184941 : public Analysis {
00010   public:
00011 
00012     CMS_2012_I1184941()
00013       : Analysis("CMS_2012_I1184941")
00014     {   }
00015 
00016   public:
00017 
00018     void init() {
00019       FinalState fs;
00020       addProjection(fs, "FS");
00021 
00022       const FastJets jets(FinalState(-4.9, 4.9, 0.0*GeV), FastJets::ANTIKT, 0.5);
00023       addProjection(jets, "AntiKtJets05");
00024 
00025       _h_xi = bookHisto1D(1, 1, 1);
00026     }
00027 
00028 
00029     void analyze(const Event& event) {
00030       const double weight = event.weight();
00031 
00032       double xiM = 0.;
00033       double xiP = 0.;
00034 
00035       const Jets jets = applyProjection<FastJets>(event, "AntiKtJets05").jetsByPt(20.*GeV);
00036       if (jets.size() < 2) vetoEvent;  // require a dijet system with a 20 GeV cut on both jets
00037       if (fabs(jets[0].eta()) > 4.4 || fabs(jets[1].eta()) > 4.4) vetoEvent;
00038 
00039       const FinalState& fsp = applyProjection<FinalState>(event, "FS");
00040 
00041       foreach (const Particle& p, fsp.particlesByEta()) {
00042         double eta = p.eta();
00043         double energy = p.momentum().E();
00044         double costheta = cos(p.momentum().theta());
00045 
00046         // Yes, they really correct to +/- infinity, using Pythia 8 ...
00047         if ( eta < 4.9 )  xiP += (energy + energy*costheta);
00048         if ( -4.9 < eta ) xiM += (energy - energy*costheta);
00049       }
00050 
00051       xiP = xiP / (sqrtS()/GeV);
00052       xiM = xiM / (sqrtS()/GeV);
00053 
00054       _h_xi->fill( xiM, weight ); // Fill the histogram both with xiP and xiM, and get the average in the endjob.
00055       _h_xi->fill( xiP, weight );
00056 
00057     }
00058 
00059 
00060     void finalize() {
00061       scale( _h_xi, crossSection()/microbarn/sumOfWeights() / 2.);
00062     }
00063 
00064   private:
00065 
00066     Histo1DPtr _h_xi;
00067 
00068   };
00069 
00070   // The hook for the plugin system
00071   DECLARE_RIVET_PLUGIN(CMS_2012_I1184941);
00072 
00073 }