CDF_2009_S8383952.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/ZFinder.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   class CDF_2009_S8383952 : public Analysis {
00012   public:
00013 
00014     /// @name Constructors etc.
00015     //@{
00016 
00017     /// Constructor
00018     CDF_2009_S8383952()
00019       : Analysis("CDF_2009_S8383952")
00020     {
00021       setBeams(PROTON, ANTIPROTON);
00022       setNeedsCrossSection(true);
00023     }
00024 
00025     //@}
00026 
00027 
00028   public:
00029 
00030     /// @name Analysis methods
00031     //@{
00032 
00033     /// Book histograms and initialise projections before the run
00034     void init() {
00035 
00036       /// Initialise and register projections here
00037       // this seems to have been corrected completely for all selection cuts,
00038       // i.e. eta cuts and pT cuts on leptons.
00039       ZFinder zfinder(-MAXRAPIDITY, MAXRAPIDITY, 0.0*GeV, ELECTRON,
00040                       66.0*GeV, 116.0*GeV, 0.2);
00041       addProjection(zfinder, "ZFinder");
00042 
00043 
00044       /// Book histograms here
00045       _h_xs = bookHistogram1D(1, 1, 1);
00046       _h_yZ = bookHistogram1D(2, 1, 1);
00047 
00048     }
00049 
00050 
00051     /// Perform the per-event analysis
00052     void analyze(const Event& event) {
00053       const double weight = event.weight();
00054 
00055       const ZFinder& zfinder = applyProjection<ZFinder>(event, "ZFinder");
00056       if (zfinder.particles().size() == 1) {
00057         double yZ = fabs(zfinder.particles()[0].momentum().rapidity());
00058         _h_yZ->fill(yZ, weight);
00059         _h_xs->fill(1960.0, weight);
00060       }
00061       else {
00062         getLog() << Log::DEBUG << "no unique lepton pair found." << endl;
00063       }
00064 
00065     }
00066 
00067 
00068     /// Normalise histograms etc., after the run
00069     void finalize() {
00070       scale(_h_xs, crossSection()/sumOfWeights());
00071       // Data seems to have been normalized for the avg of the two sides
00072       // (+ve & -ve rapidity) rather than the sum, hence the 0.5:
00073       scale(_h_yZ, 0.5*crossSection()/sumOfWeights());
00074     }
00075 
00076     //@}
00077 
00078 
00079   private:
00080 
00081     /// @name Histograms
00082     //@{
00083     AIDA::IHistogram1D *_h_yZ;
00084     AIDA::IHistogram1D *_h_xs;
00085     //@}
00086 
00087   };
00088 
00089 
00090 
00091   // This global object acts as a hook for the plugin system
00092   AnalysisBuilder<CDF_2009_S8383952> plugin_CDF_2009_S8383952;
00093 
00094 
00095 }