rivet is hosted by Hepforge, IPPP Durham
BELLE_2013_I1216515.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include <iostream>
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/Projections/Beam.hh"
00005 #include "Rivet/Projections/ChargedFinalState.hh"
00006 #include "Rivet/Tools/ParticleIdUtils.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief BELLE pion and kaon continuum production
00012   /// @author Peter Richardson
00013   class BELLE_2013_I1216515 : public Analysis {
00014   public:
00015 
00016     BELLE_2013_I1216515()
00017       : Analysis("BELLE_2013_I1216515")
00018     { }
00019 
00020 
00021     void analyze(const Event& e) {
00022       const double weight = e.weight();
00023 
00024       // Loop through charged FS particles and look for charmed mesons/baryons
00025       const ChargedFinalState& fs = applyProjection<ChargedFinalState>(e, "FS");
00026 
00027       const Beam beamproj = applyProjection<Beam>(e, "Beams");
00028       const ParticlePair& beams = beamproj.beams();
00029       FourMomentum mom_tot = beams.first.momentum() + beams.second.momentum();
00030       LorentzTransform cms_boost(-mom_tot.boostVector());
00031       MSG_DEBUG("CMS Energy sqrt s = " << beamproj.sqrtS());
00032 
00033       foreach (const Particle& p, fs.particles()) {
00034         // energy in CMS frame
00035         const double en = cms_boost.transform(p.momentum()).t();
00036     const double z = 2.*en/beamproj.sqrtS();
00037         const int PdgId = p.abspid();
00038         MSG_DEBUG("pdgID = " << PdgId << "  Energy = " << en);
00039         switch (PdgId) {
00040     case PID::PIPLUS:
00041       _histPion->fill(z,weight);
00042       break;
00043     case PID::KPLUS:
00044       _histKaon->fill(z,weight);
00045       break;
00046     default :
00047       break;
00048         }
00049       }
00050     } // analyze
00051 
00052 
00053     void finalize() {
00054 
00055       scale(_histPion,crossSection()/femtobarn/sumOfWeights());
00056       scale(_histKaon,crossSection()/femtobarn/sumOfWeights());
00057     } // finalize
00058 
00059 
00060     void init() {
00061       addProjection(Beam(), "Beams");
00062       addProjection(ChargedFinalState(), "FS");
00063 
00064       _histPion = bookHisto1D(1,1,1);
00065       _histKaon = bookHisto1D(1,1,2);
00066 
00067     } // init
00068 
00069   private:
00070 
00071     //@{
00072     // Histograms for continuum data (sqrt(s) = 10.52 GeV)
00073     Histo1DPtr _histPion;
00074     Histo1DPtr _histKaon;
00075     //@}
00076 
00077   };
00078 
00079 
00080   // The hook for the plugin system
00081   DECLARE_RIVET_PLUGIN(BELLE_2013_I1216515);
00082 
00083 }