CDF_2009_S8233977.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/FinalState.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 #include "Rivet/Projections/TriggerCDFRun2.hh"
00008
00009 namespace Rivet {
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 class CDF_2009_S8233977 : public Analysis {
00026 public:
00027
00028
00029 CDF_2009_S8233977()
00030 : Analysis("CDF_2009_S8233977"),
00031 _sumWeightSelected(0.0)
00032 { }
00033
00034
00035
00036
00037
00038
00039 void init() {
00040 addProjection(TriggerCDFRun2(), "Trigger");
00041 addProjection(FinalState(-1.0, 1.0, 0.0*GeV), "EtFS");
00042 addProjection(ChargedFinalState(-1.0, 1.0, 0.4*GeV), "CFS");
00043
00044 _hist_pt = bookHistogram1D(1, 1, 1);
00045 _hist_pt_vs_multiplicity = bookProfile1D(2, 1, 1);
00046 _hist_sumEt = bookHistogram1D(3, 1, 1);
00047 }
00048
00049
00050
00051
00052 void analyze(const Event& evt) {
00053
00054 const bool trigger = applyProjection<TriggerCDFRun2>(evt, "Trigger").minBiasDecision();
00055 if (!trigger) vetoEvent;
00056
00057
00058 const double weight = evt.weight();
00059
00060
00061
00062
00063 const ChargedFinalState& trackfs = applyProjection<ChargedFinalState>(evt, "CFS");
00064 const size_t numParticles = trackfs.size();
00065 foreach (const Particle& p, trackfs.particles()) {
00066 const double pT = p.momentum().pT() / GeV;
00067 _hist_pt_vs_multiplicity->fill(numParticles, pT, weight);
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 const double sinh1 = 1.1752012;
00081 const double apT = sinh1 * pT;
00082 const double mPi = 139.57*MeV;
00083 const double root = sqrt(mPi*mPi + (1+sinh1)*pT*pT);
00084 const double dy = std::log((root+apT)/(root-apT));
00085 const double dphi = TWOPI;
00086 _hist_pt->fill(pT, weight/(pT*dphi*dy));
00087 }
00088
00089
00090 const FinalState& etfs = applyProjection<FinalState>(evt, "EtFS");
00091 double sumEt = 0.0;
00092 foreach (const Particle& p, etfs.particles()) {
00093 sumEt += p.momentum().Et();
00094 }
00095 _hist_sumEt->fill(sumEt, weight);
00096 _sumWeightSelected += evt.weight();
00097 }
00098
00099
00100
00101
00102 void finalize() {
00103 scale(_hist_sumEt, crossSection()/millibarn/(4*M_PI*_sumWeightSelected));
00104 scale(_hist_pt, crossSection()/millibarn/_sumWeightSelected);
00105 MSG_DEBUG("sumOfWeights() = " << sumOfWeights());
00106 MSG_DEBUG("_sumWeightSelected = " << _sumWeightSelected);
00107 }
00108
00109
00110
00111
00112 private:
00113
00114 double _sumWeightSelected;
00115 AIDA::IProfile1D *_hist_pt_vs_multiplicity;
00116 AIDA::IHistogram1D *_hist_pt;
00117 AIDA::IHistogram1D *_hist_sumEt;
00118
00119 };
00120
00121
00122
00123
00124 DECLARE_RIVET_PLUGIN(CDF_2009_S8233977);
00125
00126 }