rivet is hosted by Hepforge, IPPP Durham
CDF_2012_I1124333.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 
00005 namespace Rivet {
00006 
00007   using namespace Cuts;
00008 
00009   /// @ CDF Run II Z \f$ p_\perp \f$ in Drell-Yan events
00010   /// @author Simone Amoroso
00011   class CDF_2012_I1124333 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     CDF_2012_I1124333()
00016       : Analysis("CDF_2012_I1124333")
00017     {    }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book histograms and initialise projections before the run
00024     void init() {
00025 
00026       ///  Initialise and register projections here
00027       ZFinder zfinder(FinalState(), Cuts::open(), PID::ELECTRON, 66*GeV, 116*GeV, 0.0, ZFinder::NOCLUSTER);
00028       addProjection(zfinder, "ZFinder");
00029 
00030 
00031       ///  Book histograms here, e.g.:
00032       //      _hist_z_xs = bookHisto1D(1, 1, 1);
00033       _hist_zpt = bookHisto1D(2, 1, 1);
00034     }
00035 
00036 
00037     /// Perform the per-event analysis
00038     void analyze(const Event& event) {
00039       const double weight = event.weight();
00040 
00041       /// @todo Do the event by event analysis here
00042       const ZFinder& zfinder = applyProjection<ZFinder>(event, "ZFinder");
00043       if (zfinder.bosons().size() != 1) {
00044         MSG_DEBUG("Num e+ e- pairs found = " << zfinder.bosons().size());
00045     vetoEvent;
00046       }
00047       const FourMomentum& pZ = zfinder.bosons()[0].momentum();
00048       if (pZ.mass2() < 0) {
00049     MSG_DEBUG("Negative Z mass**2 = " << pZ.mass2()/GeV2 << "!");
00050     vetoEvent;
00051       }
00052 
00053       MSG_DEBUG("Dilepton mass = " << pZ.mass()/GeV << " GeV");
00054       _hist_zpt->fill(pZ.pT(), weight);
00055       //      _hist_z_xs->fill(1, weight);
00056     }
00057 
00058 
00059     /// Normalise histograms etc., after the run
00060     void finalize() {
00061       scale(_hist_zpt, crossSection()/picobarn/sumOfWeights());
00062     }
00063 
00064     //@}
00065 
00066 
00067   private:
00068 
00069     // Data members like post-cuts event weight counters go here
00070 
00071 
00072     /// @name Histograms
00073     //@{
00074     Histo1DPtr _hist_zpt;
00075     //    Histo1DPtr _hist_z_xs;
00076     //@}
00077 
00078 
00079   };
00080 
00081 
00082 
00083   // The hook for the plugin system
00084   DECLARE_RIVET_PLUGIN(CDF_2012_I1124333);
00085 
00086 }