rivet is hosted by Hepforge, IPPP Durham
OPAL_1998_S3749908.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetYODA.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   /// @brief OPAL photon/light meson paper
00014   /// @author Peter Richardson
00015   class OPAL_1998_S3749908 : public Analysis {
00016   public:
00017 
00018     /// Constructor
00019     OPAL_1998_S3749908()
00020       : Analysis("OPAL_1998_S3749908")
00021     {}
00022 
00023 
00024     /// @name Analysis methods
00025     //@{
00026 
00027     void init() {
00028       addProjection(Beam(), "Beams");
00029       addProjection(ChargedFinalState(), "FS");
00030       addProjection(UnstableFinalState(), "UFS");
00031       _histXePhoton   = bookHisto1D( 2, 1, 1);
00032       _histXiPhoton   = bookHisto1D( 3, 1, 1);
00033       _histXePi       = bookHisto1D( 4, 1, 1);
00034       _histXiPi       = bookHisto1D( 5, 1, 1);
00035       _histXeEta      = bookHisto1D( 6, 1, 1);
00036       _histXiEta      = bookHisto1D( 7, 1, 1);
00037       _histXeRho      = bookHisto1D( 8, 1, 1);
00038       _histXiRho      = bookHisto1D( 9, 1, 1);
00039       _histXeOmega    = bookHisto1D(10, 1, 1);
00040       _histXiOmega    = bookHisto1D(11, 1, 1);
00041       _histXeEtaPrime = bookHisto1D(12, 1, 1);
00042       _histXiEtaPrime = bookHisto1D(13, 1, 1);
00043       _histXeA0       = bookHisto1D(14, 1, 1);
00044       _histXiA0       = bookHisto1D(15, 1, 1);
00045     }
00046 
00047 
00048     void analyze(const Event& e) {
00049       // First, veto on leptonic events by requiring at least 4 charged FS particles
00050       const FinalState& fs = applyProjection<FinalState>(e, "FS");
00051       const size_t numParticles = fs.particles().size();
00052 
00053       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
00054       if (numParticles < 2) {
00055         MSG_DEBUG("Failed leptonic event cut");
00056         vetoEvent;
00057       }
00058       MSG_DEBUG("Passed leptonic event cut");
00059 
00060       // Get event weight for histo filling
00061       const double weight = e.weight();
00062 
00063       // Get beams and average beam momentum
00064       const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
00065       const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
00066                                    beams.second.momentum().vector3().mod() ) / 2.0;
00067       MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
00068 
00069       // Final state of unstable particles to get particle spectra
00070       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00071 
00072       foreach (const Particle& p, ufs.particles()) {
00073         const int id = abs(p.pdgId());
00074         double xi = -log(p.momentum().vector3().mod()/meanBeamMom);
00075         double xE = p.momentum().t()/meanBeamMom;
00076         switch (id) {
00077         case 22:
00078           _histXePhoton->fill(xE, weight);
00079           _histXiPhoton->fill(xi, weight);
00080           break;
00081         case 111:
00082           _histXePi->fill(xE, weight);
00083           _histXiPi->fill(xi, weight);
00084           break;
00085         case 211:
00086           _histXeEta->fill(xE, weight);
00087           _histXiEta->fill(xi, weight);
00088           break;
00089         case 213:
00090           _histXeRho->fill(xE, weight);
00091           _histXiRho->fill(xi, weight);
00092           break;
00093         case 223:
00094           _histXeOmega->fill(xE, weight);
00095           _histXiOmega->fill(xi, weight);
00096           break;
00097         case 331:
00098           _histXeEtaPrime->fill(xE, weight);
00099           _histXiEtaPrime->fill(xi, weight);
00100           break;
00101         case 9000111:
00102           _histXeA0->fill(xE, weight);
00103           _histXiA0->fill(xi, weight);
00104           break;
00105         }
00106       }
00107     }
00108 
00109 
00110     /// Finalize
00111     void finalize() {
00112       scale(_histXePhoton  , 1./sumOfWeights());
00113       scale(_histXiPhoton  , 1./sumOfWeights());
00114       scale(_histXePi      , 1./sumOfWeights());
00115       scale(_histXiPi      , 1./sumOfWeights());
00116       scale(_histXeEta     , 1./sumOfWeights());
00117       scale(_histXiEta     , 1./sumOfWeights());
00118       scale(_histXeRho     , 1./sumOfWeights());
00119       scale(_histXiRho     , 1./sumOfWeights());
00120       scale(_histXeOmega   , 1./sumOfWeights());
00121       scale(_histXiOmega   , 1./sumOfWeights());
00122       scale(_histXeEtaPrime, 1./sumOfWeights());
00123       scale(_histXiEtaPrime, 1./sumOfWeights());
00124       scale(_histXeA0      , 1./sumOfWeights());
00125       scale(_histXiA0      , 1./sumOfWeights());
00126     }
00127 
00128     //@}
00129 
00130 
00131   private:
00132 
00133       Histo1DPtr _histXePhoton  ;
00134       Histo1DPtr _histXiPhoton  ;
00135       Histo1DPtr _histXePi      ;
00136       Histo1DPtr _histXiPi      ;
00137       Histo1DPtr _histXeEta     ;
00138       Histo1DPtr _histXiEta     ;
00139       Histo1DPtr _histXeRho     ;
00140       Histo1DPtr _histXiRho     ;
00141       Histo1DPtr _histXeOmega   ;
00142       Histo1DPtr _histXiOmega   ;
00143       Histo1DPtr _histXeEtaPrime;
00144       Histo1DPtr _histXiEtaPrime;
00145       Histo1DPtr _histXeA0      ;
00146       Histo1DPtr _histXiA0      ;
00147     //@}
00148 
00149   };
00150 
00151   // The hook for the plugin system
00152   DECLARE_RIVET_PLUGIN(OPAL_1998_S3749908);
00153 
00154 }