rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BABAR_2017_I1511276

Cross section for $e^+e^-\to K_S^0K_L^0$ with $\pi^0$, $\eta$ and $\pi^0\pi^0$ between threshold and 4 GeV
Experiment: BABAR (PEP-II)
Inspire ID: 1511276
Status: VALIDATED NOHEPDATA
Authors:
  • Peter Richardson
References:
  • Phys.Rev. D95 (2017) no.5, 052001
Beams: e+ e-
Beam energies: ANY
Run details:
  • e+e- to hadrons

Cross section for $e^+e^-\to K_S^0K_L^0$ with $\pi^0$, $\eta$ and $\pi^0\pi^0$ between threshold and 4 GeV using radiative events.

Source code: BABAR_2017_I1511276.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 BABAR_2017_I1511276 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2017_I1511276);
 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
 27      book(_nKKpi  , "TMP/KKpi");
 28      book(_nPhipi , "TMP/Phipi");
 29      book(_nKKeta , "TMP/KKeta");
 30      book(_nKKpipi, "TMP/KKpipi");
 31
 32    }
 33
 34    void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
 35      for(const Particle &child : p.children()) {
 36	if(child.children().empty()) {
 37	  nRes[child.pid()]-=1;
 38	  --ncount;
 39	}
 40	else
 41	  findChildren(child,nRes,ncount);
 42      }
 43    }
 44
 45    /// Perform the per-event analysis
 46    void analyze(const Event& event) {
 47      const FinalState& fs = apply<FinalState>(event, "FS");
 48      map<long,int> nCount;
 49      int ntotal(0);
 50      for (const Particle& p : fs.particles()) {
 51	nCount[p.pid()] += 1;
 52	++ntotal;
 53      }
 54      // stable histos
 55      if( ntotal == 3 && nCount[130] == 1 &&
 56	  nCount[310] == 1 && nCount[111] == 1)
 57	_nKKpi->fill();
 58      else if( ntotal == 4 && nCount[130] == 1 &&
 59	       nCount[310] == 1 && nCount[111] == 2)
 60	_nKKpipi->fill();
 61      // unstable particles
 62      const FinalState& ufs = apply<FinalState>(event, "UFS");
 63      for (const Particle& p : ufs.particles()) {
 64	if(p.children().empty()) continue;
 65	if(p.pid()!=333 && p.pid()!=221) continue;
 66	map<long,int> nRes=nCount;
 67	int ncount = ntotal;
 68	findChildren(p,nRes,ncount);
 69	bool matched  = true;
 70	if(p.pid()==333 && ncount==1) {
 71	  for(auto const & val : nRes) {
 72	    if(val.first==111) {
 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)
 84	    _nPhipi->fill();
 85	}
 86	else if(p.pid()==221 && ncount==2) {
 87	  for(auto const & val : nRes) {
 88	    if(val.first==130 || val.first==310) {
 89	      if(val.second!=1) {
 90		matched = false;
 91		break;
 92	      }
 93	    }
 94	    else if(val.second!=0) {
 95	      matched = false;
 96	      break;
 97	    }
 98	  }
 99	  if(matched)
100	    _nKKeta->fill();
101	}
102      }
103    }
104
105
106    /// Normalise histograms etc., after the run
107    void finalize() {
108      for(unsigned int ix=1;ix<5;++ix) {
109	double sigma = 0., error = 0.;
110	if(ix==1) {
111	  sigma = _nKKpi->val();
112	  error = _nKKpi->err();
113	}
114	else if (ix==2) {
115	  sigma = _nPhipi->val();
116	  error = _nPhipi->err();
117	}
118	else if (ix==3) {
119	  sigma = _nKKeta->val();
120	  error = _nKKeta->err();
121	}
122	else if (ix==4) {
123	  sigma = _nKKpipi->val();
124	  error = _nKKpipi->err();
125	}
126	  
127	sigma *= crossSection()/ sumOfWeights() /nanobarn;
128	error *= crossSection()/ sumOfWeights() /nanobarn;
129	
130	Scatter2D temphisto(refData(ix, 1, 1));
131	Scatter2DPtr  mult;
132        book(mult, ix, 1, 1);
133	for (size_t b = 0; b < temphisto.numPoints(); b++) {
134	  const double x  = temphisto.point(b).x();
135	  pair<double,double> ex = temphisto.point(b).xErrs();
136	  pair<double,double> ex2 = ex;
137	  if(ex2.first ==0.) ex2. first=0.0001;
138	  if(ex2.second==0.) ex2.second=0.0001;
139	  if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
140	    mult->addPoint(x, sigma, ex, make_pair(error,error));
141	  }
142	  else {
143	    mult->addPoint(x, 0., ex, make_pair(0.,.0));
144	  }
145	}
146      }
147    }
148
149    //@}
150
151
152    /// @name Histograms
153    //@{
154    CounterPtr _nKKpi,_nPhipi,_nKKeta,_nKKpipi;
155    //@}
156
157
158  };
159
160
161  // The hook for the plugin system
162  RIVET_DECLARE_PLUGIN(BABAR_2017_I1511276);
163
164
165}