rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BELLE_2008_I759073

Cross section for $e^+e^-\to D^0D^-\pi^++\text{c.c.}$ below 5 GeV
Experiment: BELLE (KEKB)
Inspire ID: 759073
Status: VALIDATED
Authors:
  • Peter Richardson
No references listed
Beams: e+ e-
Beam energies: ANY
Run details:
  • e+e- to hadrons

Cross section for $e^+e^-\to D^0D^-\pi^++\text{c.c.}$ below 5 GeV

Source code: BELLE_2008_I759073.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 Cross section for D0 D- pi+ +c.c
 10  class BELLE_2008_I759073 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(BELLE_2008_I759073);
 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    }
 28
 29    void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
 30      for (const Particle &child : p.children()) {
 31	if(child.children().empty()) {
 32	  nRes[child.pid()]-=1;
 33	  --ncount;
 34	}
 35	else
 36	  findChildren(child,nRes,ncount);
 37      }
 38    }
 39
 40    /// Perform the per-event analysis
 41    void analyze(const Event& event) {
 42      const FinalState& fs = apply<FinalState>(event, "FS");
 43
 44      map<long,int> nCount;
 45      int ntotal(0);
 46      for (const Particle& p : fs.particles()) {
 47	nCount[p.pid()] += 1;
 48	++ntotal;
 49      }
 50      const FinalState& ufs = apply<FinalState>(event, "UFS");
 51
 52
 53      for(unsigned int ix=0;ix<ufs.particles().size();++ix) {
 54	const Particle& p1 = ufs.particles()[ix];
 55	if(abs(p1.pid())!=421) continue;
 56	map<long,int> nRes = nCount;
 57	int ncount = ntotal;
 58	findChildren(p1,nRes,ncount);
 59	bool matched=false;
 60	int id2 = p1.pid()>0 ? -411 :  411;
 61	int ipi = p1.pid()>0 ?  211 : -211;
 62	for(unsigned int iy=0;iy<ufs.particles().size();++iy) {
 63	  if(ix==iy) continue;
 64	  const Particle& p2 = ufs.particles()[iy];
 65	  if(p2.pid()!=id2) continue;
 66	  map<long,int> nRes2 = nRes;
 67	  int ncount2 = ncount;
 68	  findChildren(p2,nRes2,ncount2);
 69	  if(ncount2!=1) continue;
 70	  matched=true;
 71	  for(auto const & val : nRes2) {
 72	    if(val.first==ipi) {
 73	      if(val.second!=1) {
 74		matched = false;
 75		break;
 76	      }
 77	    }
 78	    else if(val.second!=0) {
 79	      matched = false;
 80	      break;
 81	    }
 82	  }
 83	  if(matched) break;
 84	}
 85	if(matched)
 86	  _nD0->fill();
 87      }
 88    }
 89
 90
 91    /// Normalise histograms etc., after the run
 92    void finalize() {
 93      double sigma = _nD0->val();
 94      double error = _nD0->err();
 95      sigma *= crossSection()/ sumOfWeights() /nanobarn;
 96      error *= crossSection()/ sumOfWeights() /nanobarn; 
 97      Scatter2D temphisto(refData(1, 1, 1));
 98      Scatter2DPtr  mult;
 99      book(mult, 1, 1, 1);
100      for (size_t b = 0; b < temphisto.numPoints(); b++) {
101	const double x  = temphisto.point(b).x();
102	pair<double,double> ex = temphisto.point(b).xErrs();
103	pair<double,double> ex2 = ex;
104	if(ex2.first ==0.) ex2. first=0.0001;
105	if(ex2.second==0.) ex2.second=0.0001;
106	if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
107	  mult->addPoint(x, sigma, ex, make_pair(error,error));
108	}
109	else {
110	  mult->addPoint(x, 0., ex, make_pair(0.,.0));
111	}
112      }
113    }
114
115    //@}
116
117    /// @name Histograms
118    //@{
119    CounterPtr _nD0;
120    //@}
121
122  };
123
124
125  // The hook for the plugin system
126  RIVET_DECLARE_PLUGIN(BELLE_2008_I759073);
127
128
129}