rivet is hosted by Hepforge, IPPP Durham
OPAL_1995_S3198391.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/Beam.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/ChargedFinalState.hh"
00006 #include "Rivet/Projections/UnstableFinalState.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief OPAL Delta++ fragmentation function paper
00012   /// @author Peter Richardson
00013   class OPAL_1995_S3198391 : public Analysis {
00014   public:
00015 
00016     /// Constructor
00017     OPAL_1995_S3198391()
00018       : Analysis("OPAL_1995_S3198391")
00019     {}
00020 
00021 
00022     /// @name Analysis methods
00023     //@{
00024 
00025     void init() {
00026       addProjection(Beam(), "Beams");
00027       addProjection(ChargedFinalState(), "FS");
00028       addProjection(UnstableFinalState(), "UFS");
00029       _histXpDelta   = bookHisto1D( 1, 1, 1);
00030     }
00031 
00032 
00033     void analyze(const Event& e) {
00034       // First, veto on leptonic events by requiring at least 4 charged FS particles
00035       const FinalState& fs = applyProjection<FinalState>(e, "FS");
00036       const size_t numParticles = fs.particles().size();
00037 
00038       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
00039       if (numParticles < 2) {
00040         MSG_DEBUG("Failed leptonic event cut");
00041         vetoEvent;
00042       }
00043       MSG_DEBUG("Passed leptonic event cut");
00044 
00045       // Get event weight for histo filling
00046       const double weight = e.weight();
00047 
00048       // Get beams and average beam momentum
00049       const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
00050       const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
00051                                    beams.second.momentum().vector3().mod() ) / 2.0;
00052       MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
00053 
00054       // Final state of unstable particles to get particle spectra
00055       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00056 
00057       foreach (const Particle& p, ufs.particles()) {
00058         if(abs(p.pdgId())==2224) {
00059           double xp = p.momentum().vector3().mod()/meanBeamMom;
00060           _histXpDelta->fill(xp, weight);
00061         }
00062       }
00063     }
00064 
00065 
00066     /// Finalize
00067     void finalize() {
00068       scale(_histXpDelta, 1./sumOfWeights());
00069     }
00070 
00071     //@}
00072 
00073 
00074   private:
00075 
00076       Histo1DPtr _histXpDelta;
00077     //@}
00078 
00079   };
00080 
00081   // The hook for the plugin system
00082   DECLARE_RIVET_PLUGIN(OPAL_1995_S3198391);
00083 
00084 }