rivet is hosted by Hepforge, IPPP Durham
ALEPH_2002_S4823664.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 ALEPH eta/omega fragmentation function paper
00012   /// @author Peter Richardson
00013   class ALEPH_2002_S4823664 : public Analysis {
00014   public:
00015 
00016     /// Constructor
00017     ALEPH_2002_S4823664()
00018       : Analysis("ALEPH_2002_S4823664")
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       _histXpEta   = bookHisto1D( 2, 1, 2);
00030       _histXpOmega = bookHisto1D( 3, 1, 2);
00031     }
00032 
00033 
00034     void analyze(const Event& e) {
00035       // First, veto on leptonic events by requiring at least 4 charged FS particles
00036       const FinalState& fs = applyProjection<FinalState>(e, "FS");
00037       const size_t numParticles = fs.particles().size();
00038 
00039       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
00040       if (numParticles < 2) {
00041         MSG_DEBUG("Failed leptonic event cut");
00042         vetoEvent;
00043       }
00044       MSG_DEBUG("Passed leptonic event cut");
00045 
00046       // Get event weight for histo filling
00047       const double weight = e.weight();
00048 
00049       // Get beams and average beam momentum
00050       const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
00051       const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
00052                                    beams.second.momentum().vector3().mod() ) / 2.0;
00053       MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
00054 
00055       // Final state of unstable particles to get particle spectra
00056       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00057 
00058       foreach (const Particle& p, ufs.particles()) {
00059         if(abs(p.pdgId())==221) {
00060           double xp = p.momentum().vector3().mod()/meanBeamMom;
00061           _histXpEta->fill(xp, weight);
00062         }
00063         else if(abs(p.pdgId())==223) {
00064           double xp = p.momentum().vector3().mod()/meanBeamMom;
00065           _histXpOmega->fill(xp, weight);
00066         }
00067       }
00068     }
00069 
00070 
00071     /// Finalize
00072     void finalize() {
00073       scale(_histXpEta  , 1./sumOfWeights());
00074       scale(_histXpOmega, 1./sumOfWeights());
00075     }
00076 
00077     //@}
00078 
00079 
00080   private:
00081 
00082       Histo1DPtr _histXpEta;
00083       Histo1DPtr _histXpOmega;
00084     //@}
00085 
00086   };
00087 
00088   // The hook for the plugin system
00089   DECLARE_RIVET_PLUGIN(ALEPH_2002_S4823664);
00090 
00091 }