00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/Beam.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 #include "Rivet/Projections/TriggerCDFRun0Run1.hh"
00008
00009 namespace Rivet {
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 class CDF_2002_S4796047 : public Analysis {
00032 public:
00033
00034
00035 CDF_2002_S4796047()
00036 : Analysis("CDF_2002_S4796047")
00037 {
00038 setBeams(PROTON, ANTIPROTON);
00039 _sumWTrig = 0;
00040 }
00041
00042
00043
00044
00045
00046
00047 void init() {
00048 addProjection(TriggerCDFRun0Run1(), "Trigger");
00049 const ChargedFinalState cfs(-1.0, 1.0, 0.4*GeV);
00050 addProjection(cfs, "FS");
00051
00052
00053 if (fuzzyEquals(sqrtS()/GeV, 630)) {
00054 _hist_multiplicity = bookHistogram1D(1, 1, 1);
00055 _hist_pt_vs_multiplicity = bookProfile1D(3, 1, 1);
00056 } else if (fuzzyEquals(sqrtS()/GeV, 1800)) {
00057 _hist_multiplicity = bookHistogram1D(2, 1, 1);
00058 _hist_pt_vs_multiplicity = bookProfile1D(4, 1, 1);
00059 }
00060 }
00061
00062
00063
00064 void analyze(const Event& evt) {
00065
00066 const bool trigger = applyProjection<TriggerCDFRun0Run1>(evt, "Trigger").minBiasDecision();
00067 if (!trigger) vetoEvent;
00068 const double weight = evt.weight();
00069 _sumWTrig += weight;
00070
00071
00072 const ChargedFinalState& fs = applyProjection<ChargedFinalState>(evt, "FS");
00073 const size_t numParticles = fs.particles().size();
00074
00075
00076 _hist_multiplicity->fill(numParticles, weight);
00077
00078
00079 foreach (const Particle& p, fs.particles()) {
00080 const double pT = p.momentum().pT();
00081 _hist_pt_vs_multiplicity->fill(numParticles, pT/GeV, weight);
00082 }
00083
00084 }
00085
00086
00087 void finalize() {
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 if (fuzzyEquals(sqrtS()/GeV, 630)) {
00099 normalize(_hist_multiplicity, 3.21167);
00100 } else if (fuzzyEquals(sqrtS()/GeV, 1800)) {
00101 normalize(_hist_multiplicity, 4.19121);
00102 }
00103 }
00104
00105
00106
00107
00108 private:
00109
00110
00111
00112 double _sumWTrig;
00113
00114
00115
00116
00117 AIDA::IHistogram1D* _hist_multiplicity;
00118 AIDA::IProfile1D* _hist_pt_vs_multiplicity;
00119
00120
00121 };
00122
00123
00124
00125
00126 AnalysisBuilder<CDF_2002_S4796047> plugin_CDF_2002_S4796047;
00127
00128 }