00001
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
00012
00013 class CDF_1990_S2089246 : public Analysis {
00014 public:
00015
00016
00017 CDF_1990_S2089246()
00018 : Analysis("CDF_1990_S2089246")
00019 {
00020 setBeams(PROTON, ANTIPROTON);
00021 _sumWTrig = 0;
00022 }
00023
00024
00025
00026
00027
00028 void init() {
00029
00030 addProjection(TriggerCDFRun0Run1(), "Trigger");
00031 addProjection(ChargedFinalState(-3.5, 3.5), "CFS");
00032
00033
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
00043 void analyze(const Event& event) {
00044
00045 const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision();
00046 if (!trigger) vetoEvent;
00047 const double weight = event.weight();
00048 _sumWTrig += weight;
00049
00050
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
00060 void finalize() {
00061
00062
00063 scale(_hist_eta, 0.5/_sumWTrig);
00064 }
00065
00066
00067
00068
00069 private:
00070
00071
00072
00073 double _sumWTrig;
00074
00075
00076
00077
00078 AIDA::IHistogram1D* _hist_eta;
00079
00080
00081 };
00082
00083
00084
00085
00086 AnalysisBuilder<CDF_1990_S2089246> plugin_CDF_1990_S2089246;
00087
00088 }