UA5_1987_S1640666.cc
Go to the documentation of this file.00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/TriggerUA5.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007
00008 namespace Rivet {
00009
00010
00011 class UA5_1987_S1640666 : public Analysis {
00012 public:
00013
00014
00015 UA5_1987_S1640666()
00016 : Analysis("UA5_1987_S1640666")
00017 {
00018 _sumWPassed = 0;
00019
00020 }
00021
00022
00023 void init() {
00024 addProjection(TriggerUA5(), "Trigger");
00025 addProjection(ChargedFinalState(-5.0, 5.0), "CFS");
00026
00027 _hist_mean_nch = bookHistogram1D(1, 1, 1);
00028 _hist_nch = bookHistogram1D(3, 1, 1);
00029
00030 }
00031
00032
00033
00034 void analyze(const Event& event) {
00035
00036 const TriggerUA5& trigger = applyProjection<TriggerUA5>(event, "Trigger");
00037 if (!trigger.nsdDecision()) vetoEvent;
00038
00039 const double weight = event.weight();
00040 _sumWPassed += weight;
00041
00042
00043 const int Nch = applyProjection<ChargedFinalState>(event, "CFS").size();
00044
00045
00046 _hist_nch->fill(Nch, weight);
00047 _hist_mean_nch->fill(_hist_mean_nch->binMean(0), Nch);
00048
00049 }
00050
00051
00052
00053 void finalize() {
00054
00055 scale(_hist_nch, 1.0/_sumWPassed);
00056 scale(_hist_mean_nch, 1.0/_sumWPassed);
00057
00058 }
00059
00060 private:
00061
00062 double _sumWPassed;
00063
00064 AIDA::IHistogram1D *_hist_mean_nch;
00065 AIDA::IHistogram1D *_hist_nch;
00066
00067 };
00068
00069
00070
00071
00072 DECLARE_RIVET_PLUGIN(UA5_1987_S1640666);
00073
00074
00075 }