rivet is hosted by Hepforge, IPPP Durham
BABAR_2007_S6895344.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include <iostream>
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/RivetYODA.hh"
00005 #include "Rivet/Tools/ParticleIdUtils.hh"
00006 #include "Rivet/Projections/Beam.hh"
00007 #include "Rivet/Projections/UnstableFinalState.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief BABAR Lambda_c from fragmentation
00013   /// @author Peter Richardson
00014   class BABAR_2007_S6895344 : public Analysis {
00015   public:
00016 
00017     BABAR_2007_S6895344()
00018       : Analysis("BABAR_2007_S6895344")
00019     { }
00020 
00021 
00022     void analyze(const Event& e) {
00023       const double weight = e.weight();
00024 
00025       // Loop through unstable FS particles and look for charmed mesons/baryons
00026       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00027 
00028       const Beam beamproj = applyProjection<Beam>(e, "Beams");
00029       const ParticlePair& beams = beamproj.beams();
00030       FourMomentum mom_tot = beams.first.momentum() + beams.second.momentum();
00031       LorentzTransform cms_boost(-mom_tot.boostVector());
00032       const double s = sqr(beamproj.sqrtS());
00033       const bool onresonance = fuzzyEquals(beamproj.sqrtS(), 10.58, 2E-3);
00034 
00035       // Particle masses from PDGlive (accessed online 16. Nov. 2009).
00036       foreach (const Particle& p, ufs.particles()) {
00037         // only looking at Lambda_c
00038         if(abs(p.pdgId())!=4122) continue;
00039         MSG_DEBUG("Lambda_c found");
00040         double mH2 = 5.22780; // 2.28646^2
00041         const double mom = cms_boost.transform(p.momentum()).vector3().mod();
00042         double xp = mom/sqrt(s/4.0 - mH2);
00043 
00044         if(onresonance) {
00045           _histOn  ->fill(xp,weight);
00046           _sigmaOn ->fill(10.58,weight);
00047         }
00048         else {
00049           _histOff ->fill(xp,weight);
00050           _sigmaOff->fill(10.54,weight);
00051         }
00052       }
00053     } // analyze
00054 
00055 
00056     void finalize() {
00057 
00058       scale(_sigmaOn , 1./sumOfWeights());
00059       scale(_sigmaOff, 1./sumOfWeights());
00060       scale(_histOn  , 1./sumOfWeights());
00061       scale(_histOff , 1./sumOfWeights());
00062     } // finalize
00063 
00064 
00065     void init() {
00066       addProjection(Beam(), "Beams");
00067       addProjection(UnstableFinalState(), "UFS");
00068 
00069       _histOff  = bookHisto1D(1,1,1);
00070       _sigmaOff = bookHisto1D(2,1,1);
00071       _histOn   = bookHisto1D(3,1,1);
00072       _sigmaOn  = bookHisto1D(4,1,1);
00073 
00074     } // init
00075 
00076   private:
00077 
00078     //@{
00079     // Histograms for the continuum cross sections
00080     Histo1DPtr _sigmaOn ;
00081     Histo1DPtr _sigmaOff;
00082     Histo1DPtr _histOn  ;
00083     Histo1DPtr _histOff ;
00084     //@}
00085 
00086   };
00087 
00088   // The hook for the plugin system
00089   DECLARE_RIVET_PLUGIN(BABAR_2007_S6895344);
00090 
00091 }