CDF_1990_S2089246.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/RivetAIDA.hh"
00005 #include "Rivet/Projections/ChargedFinalState.hh"
00006 #include "Rivet/Projections/TriggerCDFRun0Run1.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief CDF pseudorapidity analysis at 630 and 1800 GeV
00012   /// @author Andy Buckley
00013   class CDF_1990_S2089246 : public Analysis {
00014   public:
00015 
00016     /// Constructor
00017     CDF_1990_S2089246()
00018       : Analysis("CDF_1990_S2089246")
00019     {
00020       setBeams(PROTON, ANTIPROTON);
00021       _sumWTrig = 0;
00022     }
00023 
00024 
00025     /// @name Analysis methods
00026     //@{
00027 
00028     void init() {
00029       // Setup projections
00030       addProjection(TriggerCDFRun0Run1(), "Trigger");
00031       addProjection(ChargedFinalState(-3.5, 3.5), "CFS");
00032 
00033       // Book histo
00034       if (fuzzyEquals(sqrtS()/GeV, 1800, 1E-3)) {
00035         _hist_eta = bookHistogram1D(3, 1, 1);
00036       } else if (fuzzyEquals(sqrtS()/GeV, 630, 1E-3)) {
00037         _hist_eta = bookHistogram1D(4, 1, 1);
00038       }
00039     }
00040 
00041 
00042     /// Do the analysis
00043     void analyze(const Event& event) {
00044       // Trigger
00045       const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision();
00046       if (!trigger) vetoEvent;
00047       const double weight = event.weight();
00048       _sumWTrig += weight;
00049 
00050       // Loop over final state charged particles to fill eta histos
00051       const FinalState& fs = applyProjection<FinalState>(event, "CFS");
00052       foreach (const Particle& p, fs.particles()) {
00053         const double eta = p.momentum().pseudorapidity();
00054         _hist_eta->fill(fabs(eta), weight);
00055       }
00056     }
00057 
00058 
00059     /// Finalize
00060     void finalize() {
00061       // Divide through by num events to get d<N>/d(eta) in bins
00062       // Factor of 1/2 for |eta| -> eta
00063       scale(_hist_eta, 0.5/_sumWTrig);
00064     }
00065 
00066     //@}
00067 
00068 
00069   private:
00070 
00071     /// @name Weight counter
00072     //@{
00073     double _sumWTrig;
00074     //@}
00075 
00076     /// @name Histogram collections
00077     //@{
00078     AIDA::IHistogram1D* _hist_eta;
00079     //@}
00080 
00081   };
00082 
00083 
00084 
00085   // This global object acts as a hook for the plugin system
00086   AnalysisBuilder<CDF_1990_S2089246> plugin_CDF_1990_S2089246;
00087 
00088 }