CDF_2000_S4155203.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // CDF Z pT analysis
00003 
00004 #include "Rivet/Analysis.hh"
00005 #include "Rivet/RivetAIDA.hh"
00006 #include "Rivet/Tools/Logging.hh"
00007 #include "Rivet/Projections/ZFinder.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /*
00013    * @brief CDF Run I Z pT in Drell-Yan events
00014    * @author Hendrik Hoeth
00015    */
00016   class CDF_2000_S4155203 : public Analysis {
00017   public:
00018 
00019     /// Constructor
00020     CDF_2000_S4155203()
00021       : Analysis("CDF_2000_S4155203"),
00022         _sumWeightSelected(0.0)
00023     {
00024       setBeams(PROTON, ANTIPROTON);
00025       setNeedsCrossSection(true);
00026     }
00027 
00028 
00029     /// @name Analysis methods
00030     //@{
00031  
00032     void init() {
00033       // Set up projections
00034       ZFinder zfinder(FinalState(), ELECTRON, 66.0*GeV, 116.0*GeV, 0.2);
00035       addProjection(zfinder, "ZFinder");
00036 
00037       // Book histogram
00038       _hist_zpt = bookHistogram1D(1, 1, 1);
00039     }
00040  
00041  
00042     /// Do the analysis
00043     void analyze(const Event& e) {
00044       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00045       if (zfinder.particles().size() != 1) {
00046         getLog() << Log::DEBUG << "No unique e+e- pair found" << endl;
00047         vetoEvent;
00048       }
00049    
00050       FourMomentum pZ = zfinder.particles()[0].momentum();
00051       getLog() << Log::DEBUG << "Dilepton mass = " << pZ.mass()/GeV << " GeV"  << endl;
00052       getLog() << Log::DEBUG << "Dilepton pT   = " << pZ.pT()/GeV << " GeV" << endl;
00053       _hist_zpt->fill(pZ.pT()/GeV, e.weight());
00054       _sumWeightSelected += e.weight();
00055     }
00056  
00057  
00058     void finalize() {
00059       scale(_hist_zpt, crossSection()/picobarn/_sumWeightSelected);
00060     }
00061  
00062     //@}
00063 
00064 
00065   private:
00066 
00067     double _sumWeightSelected;
00068 
00069     AIDA::IHistogram1D *_hist_zpt;
00070 
00071   };
00072 
00073  
00074 
00075   // This global object acts as a hook for the plugin system
00076   AnalysisBuilder<CDF_2000_S4155203> plugin_CDF_2000_S4155203;
00077 
00078 }