rivet is hosted by Hepforge, IPPP Durham
OPAL_1997_S3396100.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 strange baryon paper
00012   /// @author Peter Richardson
00013   class OPAL_1997_S3396100 : public Analysis {
00014   public:
00015 
00016     /// Constructor
00017     OPAL_1997_S3396100()
00018       : Analysis("OPAL_1997_S3396100"),
00019         _weightedTotalNumLambda(0.)     ,_weightedTotalNumXiMinus(0.),
00020         _weightedTotalNumSigma1385Plus(0.),_weightedTotalNumSigma1385Minus(0.),
00021         _weightedTotalNumXi1530(0.)   ,_weightedTotalNumLambda1520(0.)
00022     {}
00023 
00024 
00025     /// @name Analysis methods
00026     //@{
00027 
00028     void init() {
00029       addProjection(Beam(), "Beams");
00030       addProjection(ChargedFinalState(), "FS");
00031       addProjection(UnstableFinalState(), "UFS");
00032       _histXpLambda         = bookHisto1D( 1, 1, 1);
00033       _histXiLambda         = bookHisto1D( 2, 1, 1);
00034       _histXpXiMinus        = bookHisto1D( 3, 1, 1);
00035       _histXiXiMinus        = bookHisto1D( 4, 1, 1);
00036       _histXpSigma1385Plus  = bookHisto1D( 5, 1, 1);
00037       _histXiSigma1385Plus  = bookHisto1D( 6, 1, 1);
00038       _histXpSigma1385Minus = bookHisto1D( 7, 1, 1);
00039       _histXiSigma1385Minus = bookHisto1D( 8, 1, 1);
00040       _histXpXi1530         = bookHisto1D( 9, 1, 1);
00041       _histXiXi1530         = bookHisto1D(10, 1, 1);
00042       _histXpLambda1520     = bookHisto1D(11, 1, 1);
00043       _histXiLambda1520     = bookHisto1D(12, 1, 1);
00044     }
00045 
00046 
00047     void analyze(const Event& e) {
00048       // First, veto on leptonic events by requiring at least 4 charged FS particles
00049       const FinalState& fs = applyProjection<FinalState>(e, "FS");
00050       const size_t numParticles = fs.particles().size();
00051 
00052       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
00053       if (numParticles < 2) {
00054         MSG_DEBUG("Failed leptonic event cut");
00055         vetoEvent;
00056       }
00057       MSG_DEBUG("Passed leptonic event cut");
00058 
00059       // Get event weight for histo filling
00060       const double weight = e.weight();
00061 
00062       // Get beams and average beam momentum
00063       const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
00064       const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
00065                                    beams.second.momentum().vector3().mod() ) / 2.0;
00066       MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
00067 
00068       // Final state of unstable particles to get particle spectra
00069       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00070 
00071       foreach (const Particle& p, ufs.particles()) {
00072         const int id = abs(p.pdgId());
00073         double xp = p.momentum().vector3().mod()/meanBeamMom;
00074         double xi = -log(xp);
00075         switch (id) {
00076         case 3312:
00077           _histXpXiMinus->fill(xp, weight);
00078           _histXiXiMinus->fill(xi, weight);
00079           _weightedTotalNumXiMinus += weight;
00080           break;
00081         case 3224:
00082           _histXpSigma1385Plus->fill(xp, weight);
00083           _histXiSigma1385Plus->fill(xi, weight);
00084           _weightedTotalNumSigma1385Plus += weight;
00085           break;
00086         case 3114:
00087           _histXpSigma1385Minus->fill(xp, weight);
00088           _histXiSigma1385Minus->fill(xi, weight);
00089           _weightedTotalNumSigma1385Minus += weight;
00090           break;
00091         case 3122:
00092           _histXpLambda->fill(xp, weight);
00093           _histXiLambda->fill(xi, weight);
00094           _weightedTotalNumLambda += weight;
00095           break;
00096         case 3324:
00097           _histXpXi1530->fill(xp, weight);
00098           _histXiXi1530->fill(xi, weight);
00099           _weightedTotalNumXi1530 += weight;
00100           break;
00101         case 3124:
00102           _histXpLambda1520->fill(xp, weight);
00103           _histXiLambda1520->fill(xi, weight);
00104           _weightedTotalNumLambda1520 += weight;
00105           break;
00106         }
00107       }
00108     }
00109 
00110 
00111     /// Finalize
00112     void finalize() {
00113       normalize(_histXpLambda        , _weightedTotalNumLambda       /sumOfWeights());
00114       normalize(_histXiLambda        , _weightedTotalNumLambda       /sumOfWeights());
00115       normalize(_histXpXiMinus       , _weightedTotalNumXiMinus      /sumOfWeights());
00116       normalize(_histXiXiMinus       , _weightedTotalNumXiMinus      /sumOfWeights());
00117       normalize(_histXpSigma1385Plus , _weightedTotalNumSigma1385Plus/sumOfWeights());
00118       normalize(_histXiSigma1385Plus , _weightedTotalNumSigma1385Plus/sumOfWeights());
00119       normalize(_histXpSigma1385Minus, _weightedTotalNumSigma1385Plus/sumOfWeights());
00120       normalize(_histXiSigma1385Minus, _weightedTotalNumSigma1385Plus/sumOfWeights());
00121       normalize(_histXpXi1530        , _weightedTotalNumXi1530       /sumOfWeights());
00122       normalize(_histXiXi1530        , _weightedTotalNumXi1530       /sumOfWeights());
00123       normalize(_histXpLambda1520    , _weightedTotalNumLambda1520   /sumOfWeights());
00124       normalize(_histXiLambda1520    , _weightedTotalNumLambda1520   /sumOfWeights());
00125     }
00126 
00127     //@}
00128 
00129 
00130   private:
00131 
00132     /// Store the weighted sums of numbers of charged / charged+neutral
00133     /// particles - used to calculate average number of particles for the
00134     /// inclusive single particle distributions' normalisations.
00135     double _weightedTotalNumLambda;
00136     double _weightedTotalNumXiMinus;
00137     double _weightedTotalNumSigma1385Plus;
00138     double _weightedTotalNumSigma1385Minus;
00139     double _weightedTotalNumXi1530;
00140     double _weightedTotalNumLambda1520;
00141 
00142     Histo1DPtr _histXpLambda        ;
00143     Histo1DPtr _histXiLambda        ;
00144     Histo1DPtr _histXpXiMinus       ;
00145     Histo1DPtr _histXiXiMinus       ;
00146     Histo1DPtr _histXpSigma1385Plus ;
00147     Histo1DPtr _histXiSigma1385Plus ;
00148     Histo1DPtr _histXpSigma1385Minus;
00149     Histo1DPtr _histXiSigma1385Minus;
00150     Histo1DPtr _histXpXi1530        ;
00151     Histo1DPtr _histXiXi1530        ;
00152     Histo1DPtr _histXpLambda1520    ;
00153     Histo1DPtr _histXiLambda1520    ;
00154     //@}
00155 
00156   };
00157 
00158 
00159 
00160   // The hook for the plugin system
00161   DECLARE_RIVET_PLUGIN(OPAL_1997_S3396100);
00162 
00163 }