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