rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BELLE_2008_I757220

Cross section for $e^+e^-\to D^+D^-$ and $D^0\bar{D}^0$ below 5 GeV
Experiment: BELLE (KEKB)
Inspire ID: 757220
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Phys. Rev. D77, 011103 (2008)
Beams: e+ e-
Beam energies: ANY
Run details:
  • e+e- to hadrons

Cross section for $e^+e^-\to D^+D^-$ and $D^0\bar{D}^0$ below 5 GeV

Source code: BELLE_2008_I757220.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/FinalState.hh"
  4#include "Rivet/Projections/UnstableParticles.hh"
  5
  6namespace Rivet {
  7
  8
  9  /// @brief Add a short analysis description here
 10  class BELLE_2008_I757220 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(BELLE_2008_I757220);
 15
 16
 17    /// @name Analysis methods
 18    //@{
 19
 20    /// Book histograms and initialise projections before the run
 21    void init() {
 22
 23      // Initialise and register projections
 24      declare(FinalState(), "FS");
 25      declare(UnstableParticles(), "UFS");
 26      book(_nD0, "/TMP/nD0");
 27      book(_nDp, "/TMP/nDp");
 28    }
 29
 30    void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
 31      for (const Particle &child : p.children()) {
 32	if(child.children().empty()) {
 33	  nRes[child.pid()]-=1;
 34	  --ncount;
 35	}
 36	else
 37	  findChildren(child,nRes,ncount);
 38      }
 39    }
 40
 41    /// Perform the per-event analysis
 42    void analyze(const Event& event) {
 43      const FinalState& fs = apply<FinalState>(event, "FS");
 44
 45      map<long,int> nCount;
 46      int ntotal(0);
 47      for (const Particle& p : fs.particles()) {
 48	nCount[p.pid()] += 1;
 49	++ntotal;
 50      }
 51      const FinalState& ufs = apply<FinalState>(event, "UFS");
 52
 53      for(unsigned int ix=0;ix<ufs.particles().size();++ix) {
 54	const Particle& p1 = ufs.particles()[ix];
 55	if(abs(p1.pid())!=411 && abs(p1.pid())!=421)
 56	  continue;
 57	map<long,int> nRes = nCount;
 58	int ncount = ntotal;
 59	findChildren(p1,nRes,ncount);
 60	bool matched=false;
 61	for(unsigned int iy=0;iy<ufs.particles().size();++iy) {
 62	  if(ix==iy) continue;
 63	  const Particle& p2 = ufs.particles()[iy];
 64	  if(p2.pid()!=-p1.pid()) continue;
 65	  map<long,int> nRes2 = nRes;
 66	  int ncount2 = ncount;
 67	  findChildren(p2,nRes2,ncount2);
 68	  if(ncount2!=0) continue;
 69	  matched=true;
 70	  for(auto const & val : nRes2) {
 71	    if(val.second!=0) {
 72	      matched = false;
 73	      break;
 74	    }
 75	  }
 76	  if(matched) break;
 77	}
 78	if(matched) {
 79	  if(abs(p1.pid())==411)
 80	    _nDp->fill();
 81	  else if(abs(p1.pid())==421)
 82	    _nD0->fill();
 83	}
 84      }
 85    }
 86
 87
 88    /// Normalise histograms etc., after the run
 89    void finalize() {
 90      for(unsigned int ix=1;ix<3;++ix) {
 91	double sigma,error;
 92	if(ix==1) {
 93	  sigma = _nD0->val();
 94	  error = _nD0->err();
 95	}
 96	else {
 97	  sigma = _nDp->val();
 98	  error = _nDp->err();
 99	}
100    	sigma *= crossSection()/ sumOfWeights() /nanobarn;
101    	error *= crossSection()/ sumOfWeights() /nanobarn; 
102	Scatter2D temphisto(refData(ix, 1, 1));
103    	Scatter2DPtr  mult;
104        book(mult, ix, 1, 1);
105	for (size_t b = 0; b < temphisto.numPoints(); b++) {
106	  const double x  = temphisto.point(b).x();
107	  pair<double,double> ex = temphisto.point(b).xErrs();
108	  pair<double,double> ex2 = ex;
109	  if(ex2.first ==0.) ex2. first=0.0001;
110	  if(ex2.second==0.) ex2.second=0.0001;
111	  if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
112	    mult->addPoint(x, sigma, ex, make_pair(error,error));
113	  }
114	  else {
115	    mult->addPoint(x, 0., ex, make_pair(0.,.0));
116	  }
117	}
118      }
119    }
120
121    //@}
122
123
124    /// @name Histograms
125    //@{
126    CounterPtr _nD0,_nDp;
127    //@}
128
129
130  };
131
132
133  // The hook for the plugin system
134  RIVET_DECLARE_PLUGIN(BELLE_2008_I757220);
135
136
137}