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