rivet is hosted by Hepforge, IPPP Durham
CLEO_2004_S5809304.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/UnstableFinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief CLEO charmed mesons and baryons from fragmentation
00011   /// @author Peter Richardson
00012   class CLEO_2004_S5809304 : public Analysis {
00013   public:
00014 
00015     CLEO_2004_S5809304()
00016       : Analysis("CLEO_2004_S5809304")
00017     { }
00018 
00019 
00020     void analyze(const Event& e) {
00021       const double weight = e.weight();
00022 
00023       // Loop through unstable FS particles and look for charmed mesons/baryons
00024       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00025 
00026       const Beam beamproj = applyProjection<Beam>(e, "Beams");
00027       const ParticlePair& beams = beamproj.beams();
00028       FourMomentum mom_tot = beams.first.momentum() + beams.second.momentum();
00029       LorentzTransform cms_boost;
00030       if(mom_tot.vector3().mod()>0.001)
00031     cms_boost = LorentzTransform(-mom_tot.boostVector());
00032       const double s = sqr(beamproj.sqrtS());
00033 
00034       // Particle masses from PDGlive (accessed online 16. Nov. 2009).
00035       foreach (const Particle& p, ufs.particles()) {
00036 
00037         double xp = 0.0;
00038         double mH2 = 0.0;
00039         // 3-momentum in CMS frame
00040         const double mom = cms_boost.transform(p.momentum()).vector3().mod();
00041 
00042         const int PdgId = abs(p.pdgId());
00043         MSG_DEBUG("pdgID = " << PdgId << "  mom = " << mom);
00044         switch (PdgId) {
00045 
00046         case 421:
00047           MSG_DEBUG("D0 found");
00048           mH2 = 3.47763; // 1.86484^2
00049           xp = mom/sqrt(s/4.0 - mH2);
00050           _sigmaD0A->fill(10.6,weight);
00051           _sigmaD0B->fill(10.6,weight);
00052           _histXpD0A->fill(xp, weight);
00053           _histXpD0B->fill(xp, weight);
00054           _histXpTotal->fill(xp, weight);
00055           break;
00056         case 411:
00057           MSG_DEBUG("D+ found");
00058           mH2 = 3.49547; // 1.86962^2
00059           xp = mom/sqrt(s/4.0 - mH2);
00060           _sigmaDPlus->fill(10.6,weight);
00061           _histXpDplus->fill(xp, weight);
00062           _histXpTotal->fill(xp, weight);
00063           break;
00064 
00065         case 413:
00066           MSG_DEBUG("D*+ found");
00067           mH2 = 4.04119; // 2.01027^2
00068           xp = mom/sqrt(s/4.0 - mH2);
00069           _sigmaDStarPlusA->fill(10.6,weight);
00070           _sigmaDStarPlusB->fill(10.6,weight);
00071           _histXpDStarPlusA->fill(xp, weight);
00072           _histXpDStarPlusB->fill(xp, weight);
00073           _histXpTotal->fill(xp, weight);
00074           break;
00075 
00076         case 423:
00077           MSG_DEBUG("D*0 found");
00078           mH2 = 4.02793; // 2.00697**2
00079           xp = mom/sqrt(s/4.0 - mH2);
00080           _sigmaDStar0A->fill(10.6,weight);
00081           _sigmaDStar0B->fill(10.6,weight);
00082           _histXpDStar0A->fill(xp, weight);
00083           _histXpDStar0B->fill(xp, weight);
00084           _histXpTotal->fill(xp, weight);
00085           break;
00086         }
00087       }
00088     } // analyze
00089 
00090 
00091     void finalize() {
00092 
00093       scale(_sigmaDPlus     , crossSection()/picobarn/sumOfWeights());
00094       scale(_sigmaD0A       , crossSection()/picobarn/sumOfWeights());
00095       scale(_sigmaD0B       , crossSection()/picobarn/sumOfWeights());
00096       scale(_sigmaDStarPlusA, crossSection()/picobarn/sumOfWeights());
00097       scale(_sigmaDStarPlusB, crossSection()/picobarn/sumOfWeights());
00098       scale(_sigmaDStar0A   , crossSection()/picobarn/sumOfWeights());
00099       scale(_sigmaDStar0B   , crossSection()/picobarn/sumOfWeights());
00100 
00101       scale(_histXpDplus     , crossSection()/picobarn/sumOfWeights());
00102       scale(_histXpD0A       , crossSection()/picobarn/sumOfWeights());
00103       scale(_histXpD0B       , crossSection()/picobarn/sumOfWeights());
00104       scale(_histXpDStarPlusA, crossSection()/picobarn/sumOfWeights());
00105       scale(_histXpDStarPlusB, crossSection()/picobarn/sumOfWeights());
00106       scale(_histXpDStar0A   , crossSection()/picobarn/sumOfWeights());
00107       scale(_histXpDStar0B   , crossSection()/picobarn/sumOfWeights());
00108       scale(_histXpTotal     , crossSection()/picobarn/sumOfWeights()/4.);
00109     } // finalize
00110 
00111 
00112     void init() {
00113       addProjection(Beam(), "Beams");
00114       addProjection(UnstableFinalState(), "UFS");
00115 
00116       // continuum cross sections
00117       _sigmaDPlus      = bookHisto1D(1,1,1);
00118       _sigmaD0A        = bookHisto1D(1,1,2);
00119       _sigmaD0B        = bookHisto1D(1,1,3);
00120       _sigmaDStarPlusA = bookHisto1D(1,1,4);
00121       _sigmaDStarPlusB = bookHisto1D(1,1,5);
00122       _sigmaDStar0A    = bookHisto1D(1,1,6);
00123       _sigmaDStar0B    = bookHisto1D(1,1,7);
00124 
00125        // histograms for continuum data
00126       _histXpDplus      = bookHisto1D(2, 1, 1);
00127       _histXpD0A        = bookHisto1D(3, 1, 1);
00128       _histXpD0B        = bookHisto1D(4, 1, 1);
00129       _histXpDStarPlusA = bookHisto1D(5, 1, 1);
00130       _histXpDStarPlusB = bookHisto1D(6, 1, 1);
00131       _histXpDStar0A    = bookHisto1D(7, 1, 1);
00132       _histXpDStar0B    = bookHisto1D(8, 1, 1);
00133       _histXpTotal      = bookHisto1D(9, 1, 1);
00134 
00135     } // init
00136 
00137   private:
00138 
00139     //@{
00140     // Histograms for the continuum cross sections
00141     Histo1DPtr _sigmaDPlus     ;
00142     Histo1DPtr _sigmaD0A       ;
00143     Histo1DPtr _sigmaD0B       ;
00144     Histo1DPtr _sigmaDStarPlusA;
00145     Histo1DPtr _sigmaDStarPlusB;
00146     Histo1DPtr _sigmaDStar0A   ;
00147     Histo1DPtr _sigmaDStar0B   ;
00148 
00149     // histograms for continuum data
00150     Histo1DPtr _histXpDplus     ;
00151     Histo1DPtr _histXpD0A       ;
00152     Histo1DPtr _histXpD0B       ;
00153     Histo1DPtr _histXpDStarPlusA;
00154     Histo1DPtr _histXpDStarPlusB;
00155     Histo1DPtr _histXpDStar0A   ;
00156     Histo1DPtr _histXpDStar0B   ;
00157     Histo1DPtr _histXpTotal     ;
00158     //@}
00159 
00160   };
00161 
00162   // The hook for the plugin system
00163   DECLARE_RIVET_PLUGIN(CLEO_2004_S5809304);
00164 
00165 }