00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/ChargedFinalState.hh"
00006 #include "Rivet/Projections/TriggerCDFRun2.hh"
00007
00008 namespace Rivet {
00009
00010
00011 class CDF_2009_NOTE_9936 : public Analysis {
00012 public:
00013
00014
00015
00016
00017
00018 CDF_2009_NOTE_9936()
00019 : Analysis("CDF_2009_NOTE_9936")
00020
00021 {
00022
00023 setBeams(PROTON, ANTIPROTON);
00024
00025
00026 setNeedsCrossSection(false);
00027 }
00028
00029
00030
00031
00032 public:
00033
00034
00035
00036
00037
00038 void init() {
00039
00040 addProjection(TriggerCDFRun2(), "Trigger");
00041
00042 addProjection(ChargedFinalState(-1.0, 1.0, 0.4*GeV), "CFS");
00043
00044 _hist_nch = bookHistogram1D(1, 1, 1);
00045 }
00046
00047
00048
00049 void analyze(const Event& event) {
00050
00051 const bool trigger = applyProjection<TriggerCDFRun2>(event, "Trigger").minBiasDecision();
00052 if (!trigger) vetoEvent;
00053
00054 const double weight = event.weight();
00055
00056
00057 const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
00058 _hist_nch->fill(cfs.size(), weight);
00059
00060 }
00061
00062
00063
00064 void finalize() {
00065 normalize(_hist_nch);
00066 }
00067
00068
00069
00070 private:
00071
00072 AIDA::IHistogram1D *_hist_nch;
00073
00074 };
00075
00076
00077
00078
00079 AnalysisBuilder<CDF_2009_NOTE_9936> plugin_CDF_2009_NOTE_9936;
00080
00081
00082 }