rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

SND_2018_I1693737

Cross section for $e^+e^-\to\eta K^+K^-$ for energies below 2 GeV
Experiment: SND (VEPP-2M)
Inspire ID: 1693737
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Phys.Atom.Nucl. 81 (2018) no.2, 205-213
Beams: e+ e-
Beam energies: ANY
Run details:
  • e+ e- to hadrons

Cross section for $e^+e^-\to\eta K^+K^-$ for energies below 2 GeV

Source code: SND_2018_I1693737.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 SND_2018_I1693737 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(SND_2018_I1693737);
 15
 16
 17    /// @name Analysis methods
 18    //@{
 19
 20    /// Book histograms and initialise projections before the run
 21    void init() {
 22      // Initialise and register projections
 23      declare(FinalState(), "FS");
 24      declare(UnstableParticles(), "UFS");
 25      book(_nKKEta, "/TMP/nKKEta");
 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()]-=1;
 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      for (const Particle& p : ufs.particles()) {
 50      	if(p.children().empty()) continue;
 51      	if(p.pid()!=221) continue;
 52      	map<long,int> nRes = nCount;
 53      	int ncount = ntotal;
 54      	findChildren(p,nRes,ncount);
 55	if(ncount!=2) continue;
 56	bool matched = true;
 57	for(auto const & val : nRes) {
 58	  if(abs(val.first)==321) {
 59	    if(val.second!=1) {
 60	      matched = false;
 61	      break;
 62	    }
 63	  }
 64	  else if(val.second!=0) {
 65	    matched = false;
 66	    break;
 67	  }
 68	}
 69	if(matched) {
 70	  _nKKEta->fill();
 71	  break;
 72	}
 73      }
 74    }
 75
 76    /// Normalise histograms etc., after the run
 77    void finalize() {
 78      double sigma = _nKKEta->val();
 79      double error = _nKKEta->err();
 80      sigma *= crossSection()/ sumOfWeights() /nanobarn;
 81      error *= crossSection()/ sumOfWeights() /nanobarn; 
 82      Scatter2D temphisto(refData(1, 1, 1));
 83      Scatter2DPtr mult;
 84      book(mult, 1, 1, 1);
 85      for (size_t b = 0; b < temphisto.numPoints(); b++) {
 86	const double x  = temphisto.point(b).x();
 87	pair<double,double> ex = temphisto.point(b).xErrs();
 88	pair<double,double> ex2 = ex;
 89	if(ex2.first ==0.) ex2. first=0.0001;
 90	if(ex2.second==0.) ex2.second=0.0001;
 91	if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
 92	  mult->addPoint(x, sigma, ex, make_pair(error,error));
 93	}
 94	else {
 95	    mult->addPoint(x, 0., ex, make_pair(0.,.0));
 96	}
 97      }
 98    }
 99
100    //@}
101
102
103    /// @name Histograms
104    //@{
105    CounterPtr _nKKEta;
106    //@}
107
108
109  };
110
111
112  // The hook for the plugin system
113  RIVET_DECLARE_PLUGIN(SND_2018_I1693737);
114
115
116}