rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BABAR_2006_I716277

Cross section for $e^+e^-\to\eta\gamma$ and $\eta^\prime\gamma$ at 10.58 GeV
Experiment: BABAR (PEP-II)
Inspire ID: 716277
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • PR D74,012002
Beams: e+ e-
Beam energies: ANY
Run details:
  • e+ e- to hadrons

Cross section for $e^+e^-\to\eta\gamma$ and $\eta^\prime\gamma$ at 10.58 GeV

Source code: BABAR_2006_I716277.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_2006_I716277 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2006_I716277);
 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(_numEtaGamma, "TMP/EtaGamma");
 26      book(_numEtaPrimeGamma, "TMP/EtaPrimeGamma");
 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()];
 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
 43      const FinalState& fs = apply<FinalState>(event, "FS");
 44      
 45      map<long,int> nCount;
 46      int ntotal(0);
 47      for (const Particle& p : fs.particles()) {
 48	nCount[p.pid()] += 1;
 49	++ntotal;
 50      }
 51      
 52      const FinalState& ufs = apply<FinalState>(event, "UFS");
 53      for (const Particle& p : ufs.particles()) {
 54	if(p.children().empty()) continue;
 55	// find the eta/eta prime
 56        if(p.pid()!=221 && p.pid()!=331) continue;
 57	map<long,int> nRes = nCount;
 58	int ncount = ntotal;
 59	findChildren(p,nRes,ncount);
 60	// eta pi+pi-
 61	if(ncount!=1) continue;
 62	bool matched = true;
 63	for(auto const & val : nRes) {
 64	  if(val.first==22) {
 65	    if(val.second !=1) {
 66	      matched = false;
 67	      break;
 68	    }
 69	  }
 70	  else if(val.second!=0) {
 71	    matched = false;
 72	    break;
 73	  }
 74	}
 75	if(matched) {
 76	  if(p.pid()==221)
 77	    _numEtaGamma->fill();
 78	  else
 79	    _numEtaPrimeGamma->fill();
 80	}
 81      }
 82    }
 83
 84    /// Normalise histograms etc., after the run
 85    void finalize() {
 86      for(unsigned int ix=1;ix<3;++ix) {
 87	double sigma,error;
 88	if(ix==1) {
 89	  sigma = _numEtaGamma->val();
 90	  error = _numEtaGamma->err();
 91	}
 92	else {
 93	  sigma = _numEtaPrimeGamma->val();
 94	  error = _numEtaPrimeGamma->err();
 95	}
 96	sigma *= crossSection()/ sumOfWeights() /femtobarn;
 97	error *= crossSection()/ sumOfWeights() /femtobarn; 
 98	Scatter2D temphisto(refData(1, 1, ix));
 99	Scatter2DPtr  mult;
100        book(mult, 1, 1, ix);
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 _numEtaGamma,_numEtaPrimeGamma;
123    //@}
124
125
126  };
127
128
129  // The hook for the plugin system
130  RIVET_DECLARE_PLUGIN(BABAR_2006_I716277);
131
132
133}