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/TriggerUA5.hh"
00007
00008 namespace Rivet {
00009
00010
00011 class UA5_1989_S1926373 : public Analysis {
00012 public:
00013
00014
00015 UA5_1989_S1926373() : Analysis("UA5_1989_S1926373") {
00016 setBeams(PROTON, ANTIPROTON);
00017 _sumWPassed = 0;
00018 }
00019
00020
00021
00022
00023
00024
00025 void init() {
00026 addProjection(TriggerUA5(), "Trigger");
00027 addProjection(ChargedFinalState(-0.5, 0.5), "CFS05");
00028 addProjection(ChargedFinalState(-1.5, 1.5), "CFS15");
00029 addProjection(ChargedFinalState(-3.0, 3.0), "CFS30");
00030 addProjection(ChargedFinalState(-5.0, 5.0), "CFS50");
00031
00032
00033 if (fuzzyEquals(sqrtS()/GeV, 200, 1E-3)) {
00034 _hist_nch = bookHistogram1D(1, 1, 1);
00035 _hist_nch_eta05 = bookHistogram1D(3, 1, 1);
00036 _hist_nch_eta15 = bookHistogram1D(4, 1, 1);
00037 _hist_nch_eta30 = bookHistogram1D(5, 1, 1);
00038 _hist_nch_eta50 = bookHistogram1D(6, 1, 1);
00039 _hist_mean_nch = bookHistogram1D(11, 1, 1);
00040 } else if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00041 _hist_nch = bookHistogram1D(2, 1, 1);
00042 _hist_nch_eta05 = bookHistogram1D(7, 1, 1);
00043 _hist_nch_eta15 = bookHistogram1D(8, 1, 1);
00044 _hist_nch_eta30 = bookHistogram1D(9, 1, 1);
00045 _hist_nch_eta50 = bookHistogram1D(10, 1, 1);
00046 _hist_mean_nch = bookHistogram1D(12, 1, 1);
00047 }
00048
00049
00050 }
00051
00052
00053
00054 void analyze(const Event& event) {
00055
00056 const TriggerUA5& trigger = applyProjection<TriggerUA5>(event, "Trigger");
00057 if (!trigger.nsdDecision()) vetoEvent;
00058
00059 const double weight = event.weight();
00060 _sumWPassed += weight;
00061
00062
00063 const int numP05 = applyProjection<ChargedFinalState>(event, "CFS05").size();
00064 const int numP15 = applyProjection<ChargedFinalState>(event, "CFS15").size();
00065 const int numP30 = applyProjection<ChargedFinalState>(event, "CFS30").size();
00066 const int numP50 = applyProjection<ChargedFinalState>(event, "CFS50").size();
00067
00068
00069 _hist_nch->fill(numP50, weight);
00070 _hist_nch_eta05->fill(numP05, weight);
00071 _hist_nch_eta15->fill(numP15, weight);
00072 _hist_nch_eta30->fill(numP30, weight);
00073 _hist_nch_eta50->fill(numP50, weight);
00074 _hist_mean_nch->fill(_hist_mean_nch->binMean(0), numP50);
00075 }
00076
00077
00078 void finalize() {
00079 scale(_hist_nch, _sumWPassed);
00080 scale(_hist_nch_eta05, _sumWPassed);
00081 scale(_hist_nch_eta15, _sumWPassed);
00082 scale(_hist_nch_eta30, _sumWPassed);
00083 scale(_hist_nch_eta50, _sumWPassed);
00084 scale(_hist_mean_nch, 1.0/_sumWPassed);
00085 }
00086
00087
00088
00089
00090 private:
00091
00092
00093
00094 double _sumWPassed;
00095
00096
00097
00098
00099 AIDA::IHistogram1D* _hist_nch;
00100 AIDA::IHistogram1D* _hist_nch_eta05;
00101 AIDA::IHistogram1D* _hist_nch_eta15;
00102 AIDA::IHistogram1D* _hist_nch_eta30;
00103 AIDA::IHistogram1D* _hist_nch_eta50;
00104 AIDA::IHistogram1D* _hist_mean_nch;
00105
00106
00107 };
00108
00109
00110
00111
00112 AnalysisBuilder<UA5_1989_S1926373> plugin_UA5_1989_S1926373;
00113
00114 }