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