rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BESIII_2018_I1685535

Cross section for $e^+e^-\to\pi^+D^0D^{*-}$ +c.c. cross section between 4.05 and 4.60 GeV
Experiment: BESIII (BEPC)
Inspire ID: 1685535
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Phys.Rev.Lett. 122 (2019) no.10, 102002
Beams: e+ e-
Beam energies: ANY
Run details:
  • e+e- to hadrons

Measurement of the cross section for $e^+e^-\to\pi^+D^0D^{*-}$ +c.c. cross section between 4.05 and 4.60 GeV by thew BEWS collaboration.

Source code: BESIII_2018_I1685535.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 BESIII_2018_I1685535 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2018_I1685535);
 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 ? -413 :  413;
 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      for(unsigned int ix=1;ix<3;++ix) {
 98	Scatter2D temphisto(refData(ix, 1, 1));
 99	Scatter2DPtr  mult;
100	book(mult, ix, 1, 1);
101	for (size_t b = 0; b < temphisto.numPoints(); b++) {
102	  const double x  = temphisto.point(b).x();
103	  pair<double,double> ex = temphisto.point(b).xErrs();
104	  pair<double,double> ex2 = ex;
105	  if(ex2.first ==0.) ex2. first=0.0001;
106	  if(ex2.second==0.) ex2.second=0.0001;
107	  if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
108	    mult->addPoint(x, sigma, ex, make_pair(error,error));
109	  }
110	  else {
111	    mult->addPoint(x, 0., ex, make_pair(0.,.0));
112	  }
113	}
114      }
115    }
116
117    //@}
118
119
120    /// @name Histograms
121    //@{
122    CounterPtr _nD0;
123    //@}
124
125
126  };
127
128
129  RIVET_DECLARE_PLUGIN(BESIII_2018_I1685535);
130
131}