rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BESIII_2022_I2039027

Cross section for $e^+e^-\to\pi^+\pi^-\eta$ between 3.872 and 4.7 GeV
Experiment: BESIII (BEPC)
Inspire ID: 2039027
Status: VALIDATED NOHEPDATA
Authors:
  • Peter Richardson
References: Beams: e+ e-
Beam energies: ANY
Run details:
  • e+e- to hadrons

Measurement of the cross section for $e^+e^-\to\pi^+\pi^-\eta$ between 3.872 and 4.7 GeV by the BESIII collaboration.

Source code: BESIII_2022_I2039027.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 e+e- -> pi+pi-eta
 10  class BESIII_2022_I2039027 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2022_I2039027);
 15
 16
 17    /// @name Analysis methods
 18    /// @{
 19
 20    /// Book histograms and initialise projections before the run
 21    void init() {
 22      declare(FinalState(), "FS");
 23      declare(UnstableParticles(), "UFS");
 24      book(_num[0] , "TMP/etapipi");
 25      book(_num[1] , "TMP/etarho" );
 26    }
 27
 28    void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
 29      for(const Particle &child : p.children()) {
 30	if(child.children().empty()) {
 31	  --nRes[child.pid()];
 32	  --ncount;
 33	}
 34	else
 35	  findChildren(child,nRes,ncount);
 36      }
 37    }
 38
 39    /// Perform the per-event analysis
 40    void analyze(const Event& event) {
 41      const FinalState& fs = apply<FinalState>(event, "FS");
 42      map<long,int> nCount;
 43      int ntotal(0);
 44      for (const Particle& p : fs.particles()) {
 45	nCount[p.pid()] += 1;
 46	++ntotal;
 47      }
 48      const FinalState& ufs = apply<FinalState>(event, "UFS");
 49      // loop over eta mesons
 50      for (const Particle& p : ufs.particles(Cuts::pid==221)) {
 51	map<long,int> nRes = nCount;
 52	int ncount = ntotal;
 53	findChildren(p,nRes,ncount);
 54	bool matched = true;
 55	for(auto const & val : nRes) {
 56	  if(abs(val.first)==211) {
 57	    if(val.second !=1) {
 58	      matched = false;
 59	      break;
 60	    }
 61	  }
 62	  else if(val.second!=0) {
 63	    matched = false;
 64	    break;
 65	  }
 66	}
 67	if(!matched) continue;
 68	_num[0]->fill();
 69	for (const Particle& p2 : ufs.particles(Cuts::pid==113)) {
 70	  map<long,int> nResB = nRes;
 71	  int ncountB = ncount;
 72	  findChildren(p2,nResB,ncountB);
 73	  if(ncountB!=0) continue;
 74	  bool matched = true;
 75	  for(auto const & val : nResB) {
 76	    if(val.second!=0) {
 77	      matched = false;
 78	      break;
 79	    }
 80	  }
 81	  if(matched) _num[1]->fill();
 82	}
 83      }
 84    }
 85
 86
 87    /// Normalise histograms etc., after the run
 88    void finalize() {
 89      double fact = crossSection()/ sumOfWeights() /picobarn;
 90      for(unsigned int ix=0;ix<2;++ix) {
 91        const double sigma = _num[ix]->val()*fact;
 92        const double error = _num[ix]->err()*fact;
 93        Estimate1DPtr  mult;
 94        book(mult, ix+1, 1, 1);
 95        for (auto& b : mult->bins()) {
 96          if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
 97            b.set(sigma, error);
 98          }
 99        }
100      }
101    }
102
103    /// @}
104
105
106    /// @name Histograms
107    /// @{
108    CounterPtr _num[2];
109    /// @}
110
111
112  };
113
114
115  RIVET_DECLARE_PLUGIN(BESIII_2022_I2039027);
116
117}