00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/ParticleIdUtils.hh"
00005 #include "Rivet/Projections/Beam.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/ChargedFinalState.hh"
00008 #include "Rivet/Projections/UnstableFinalState.hh"
00009
00010 namespace Rivet {
00011
00012
00013
00014
00015 class DELPHI_1995_S3137023 : public Analysis {
00016 public:
00017
00018
00019 DELPHI_1995_S3137023()
00020 : Analysis("DELPHI_1995_S3137023")
00021 {
00022 setBeams(ELECTRON, POSITRON);
00023 _weightedTotalNumXiMinus = 0;
00024 _weightedTotalNumSigma1385Plus = 0;
00025 }
00026
00027
00028
00029
00030
00031 void init() {
00032 addProjection(Beam(), "Beams");
00033 addProjection(ChargedFinalState(), "FS");
00034 addProjection(UnstableFinalState(), "UFS");
00035
00036 _histXpXiMinus = bookHistogram1D(2, 1, 1);
00037 _histXpSigma1385Plus = bookHistogram1D(3, 1, 1);
00038 }
00039
00040
00041 void analyze(const Event& e) {
00042
00043 const FinalState& fs = applyProjection<FinalState>(e, "FS");
00044 const size_t numParticles = fs.particles().size();
00045
00046
00047 if (numParticles < 2) {
00048 getLog() << Log::DEBUG << "Failed leptonic event cut" << endl;
00049 vetoEvent;
00050 }
00051 getLog() << Log::DEBUG << "Passed leptonic event cut" << endl;
00052
00053
00054 const double weight = e.weight();
00055
00056
00057 const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
00058 const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
00059 beams.second.momentum().vector3().mod() ) / 2.0;
00060 getLog() << Log::DEBUG << "Avg beam momentum = " << meanBeamMom << endl;
00061
00062
00063 const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00064
00065 foreach (const Particle& p, ufs.particles()) {
00066 const int id = abs(p.pdgId());
00067 switch (id) {
00068 case 3312:
00069 _histXpXiMinus->fill(p.momentum().vector3().mod()/meanBeamMom, weight);
00070 _weightedTotalNumXiMinus += weight;
00071 break;
00072 case 3114:
00073 _histXpSigma1385Plus->fill(p.momentum().vector3().mod()/meanBeamMom, weight);
00074 _weightedTotalNumSigma1385Plus += weight;
00075 break;
00076 }
00077 }
00078
00079 }
00080
00081
00082
00083 void finalize() {
00084 normalize(_histXpXiMinus , _weightedTotalNumXiMinus/sumOfWeights());
00085 normalize(_histXpSigma1385Plus , _weightedTotalNumSigma1385Plus/sumOfWeights());
00086 }
00087
00088
00089
00090
00091 private:
00092
00093
00094
00095
00096 double _weightedTotalNumXiMinus;
00097 double _weightedTotalNumSigma1385Plus;
00098
00099 AIDA::IHistogram1D *_histXpXiMinus;
00100 AIDA::IHistogram1D *_histXpSigma1385Plus;
00101
00102
00103 };
00104
00105
00106
00107
00108 AnalysisBuilder<DELPHI_1995_S3137023> plugin_DELPHI_1995_S3137023;
00109
00110 }