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