rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_I928289_Z.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include <cmath>
00003 
00004 #include "Rivet/Analysis.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/ZFinder.hh"
00007 
00008 
00009 namespace Rivet {
00010 
00011   using namespace Cuts;
00012 
00013   class ATLAS_2011_I928289_Z : public Analysis {
00014   public:
00015 
00016     /// Constructor
00017     ATLAS_2011_I928289_Z()
00018       : Analysis("ATLAS_2011_I928289_Z")
00019     {
00020       setNeedsCrossSection(true);
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 
00032       FinalState fs;
00033       
00034       Cut cut =  pT >= 20.0*GeV;
00035 
00036       ZFinder zfinder_ee_bare(   fs, cut, PID::ELECTRON, 66.0*GeV, 116.0*GeV, 0.0, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK);
00037       ZFinder zfinder_ee_dressed(fs, cut, PID::ELECTRON, 66.0*GeV, 116.0*GeV, 0.1, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK);
00038       ZFinder zfinder_mm_bare(   fs, cut, PID::MUON    , 66.0*GeV, 116.0*GeV, 0.0, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK);
00039       ZFinder zfinder_mm_dressed(fs, cut, PID::MUON    , 66.0*GeV, 116.0*GeV, 0.1, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK);
00040 
00041       addProjection(zfinder_ee_bare   , "ZFinder_ee_bare"   );
00042       addProjection(zfinder_ee_dressed, "ZFinder_ee_dressed");
00043       addProjection(zfinder_mm_bare   , "ZFinder_mm_bare"   );
00044       addProjection(zfinder_mm_dressed, "ZFinder_mm_dressed");
00045 
00046       //y(Z) cross-section dependence 
00047       _h_Z_y_ee_bare     = bookHisto1D(1, 1, 1);
00048       _h_Z_y_ee_dressed  = bookHisto1D(1, 1, 2);
00049       _h_Z_y_mm_bare     = bookHisto1D(1, 1, 3);
00050       _h_Z_y_mm_dressed  = bookHisto1D(1, 1, 4);
00051 
00052     }
00053 
00054 
00055     /// Perform the per-event analysis
00056     void analyze(const Event& event) {
00057 
00058       const double weight = event.weight();
00059 
00060       ///Do the event by event analysis here
00061       const ZFinder& zfinder_ee_bare     = applyProjection<ZFinder>(event, "ZFinder_ee_bare"   );
00062       const ZFinder& zfinder_ee_dressed  = applyProjection<ZFinder>(event, "ZFinder_ee_dressed");
00063       const ZFinder& zfinder_mm_bare     = applyProjection<ZFinder>(event, "ZFinder_mm_bare"   );
00064       const ZFinder& zfinder_mm_dressed  = applyProjection<ZFinder>(event, "ZFinder_mm_dressed");
00065 
00066       FillPlots1d(zfinder_ee_bare   , _h_Z_y_ee_bare   , weight);
00067       FillPlots1d(zfinder_ee_dressed, _h_Z_y_ee_dressed, weight);
00068       FillPlots1d(zfinder_mm_bare   , _h_Z_y_mm_bare   , weight);
00069       FillPlots1d(zfinder_mm_dressed, _h_Z_y_mm_dressed, weight);
00070 
00071     }
00072 
00073     
00074     void FillPlots1d(const ZFinder& zfinder, Histo1DPtr hist, double weight) {
00075 
00076       if (zfinder.bosons().size() != 1) return;
00077       
00078       const FourMomentum zmom = zfinder.bosons()[0].momentum();
00079       
00080       hist->fill( fabs(zmom.rapidity()), weight);
00081 
00082       return; 
00083     } 
00084 
00085     /// Normalise histograms etc., after the run
00086     void finalize() {
00087 
00088       /// Print summary info
00089       const double xs_pb(crossSection() / picobarn);
00090       const double sumw(sumOfWeights());
00091       MSG_INFO("Cross-Section/pb: " << xs_pb      );
00092       MSG_INFO("Sum of weights  : " << sumw       );
00093       MSG_INFO("nEvents         : " << numEvents());
00094 
00095       const double sf(0.5 * xs_pb / sumw); // 0.5 accounts for rapidity bin width
00096 
00097       ///Normalise, scale and otherwise manipulate histograms here
00098       scale(_h_Z_y_ee_bare   , sf); 
00099       scale(_h_Z_y_ee_dressed, sf); 
00100       scale(_h_Z_y_mm_bare   , sf); 
00101       scale(_h_Z_y_mm_dressed, sf); 
00102 
00103     }
00104 
00105     //@}
00106 
00107 
00108   private:
00109 
00110     // Data members like post-cuts event weight counters go here
00111 
00112 
00113   private:
00114 
00115     /// @name Histograms
00116     //@{
00117     Histo1DPtr _h_Z_y_ee_bare;
00118     Histo1DPtr _h_Z_y_ee_dressed;
00119     Histo1DPtr _h_Z_y_mm_bare;
00120     Histo1DPtr _h_Z_y_mm_dressed;
00121     //@}
00122   };
00123 
00124 
00125   // The hook for the plugin system
00126   DECLARE_RIVET_PLUGIN(ATLAS_2011_I928289_Z);
00127 
00128 }