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