MC_TTBAR.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/ChargedFinalState.hh"
00006
00007 namespace Rivet {
00008
00009
00010
00011
00012 class MC_TTBAR : public Analysis {
00013 public:
00014
00015
00016
00017
00018
00019 MC_TTBAR()
00020 : Analysis("MC_TTBAR")
00021 {
00022
00023 }
00024
00025
00026
00027
00028 public:
00029
00030
00031
00032
00033
00034 void init() {
00035
00036 const ChargedFinalState cfs(-5.0, 5.0);
00037 addProjection(cfs, "CFS");
00038
00039
00040 _hist_nch_eta = bookHistogram1D("nch-eta", 20, -5.0, 5.0);
00041 _hist_nch_pt = bookHistogram1D("nch-pt", 100, 0.0, 200.0);
00042 _hist_nch_phi = bookHistogram1D("nch-phi", 100, 0.0, TWOPI);
00043
00044 }
00045
00046
00047
00048 void analyze(const Event& event) {
00049 const double weight = event.weight();
00050 const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
00051
00052 foreach (const Particle& p, cfs.particles()) {
00053 double eta = p.momentum().pseudorapidity();
00054 double pT = p.momentum().perp();
00055 double phi = p.momentum().phi();
00056 _hist_nch_eta->fill(eta, weight);
00057 _hist_nch_pt->fill(pT, weight);
00058 _hist_nch_phi->fill(phi, weight);
00059 }
00060
00061 }
00062
00063
00064
00065 void finalize() {
00066 scale(_hist_nch_eta, 1.0/sumOfWeights());
00067 scale(_hist_nch_pt, 1.0/sumOfWeights());
00068 scale(_hist_nch_phi, 1.0/sumOfWeights());
00069 }
00070
00071
00072 private:
00073
00074
00075
00076 AIDA::IHistogram1D* _hist_nch_eta;
00077 AIDA::IHistogram1D* _hist_nch_pt;
00078 AIDA::IHistogram1D* _hist_nch_phi;
00079
00080
00081 };
00082
00083
00084
00085
00086 AnalysisBuilder<MC_TTBAR> plugin_MC_TTBAR;
00087
00088
00089 }