rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BABAR_2001_I558091

Inclusive $J/\psi$ cross section at 10.57 GeV
Experiment: BABAR (PEP-II)
Inspire ID: 558091
Status: VALIDATED
Authors:
  • Your Name
References:
  • PRL 87,162002
Beams: e- e+
Beam energies: ANY
Run details:
  • e+ e- to hadrons

Measurement of inclusive $J/psi$ production by BaBar for 10.57 GeV.

Source code: BABAR_2001_I558091.cc
 1// -*- C++ -*-
 2#include "Rivet/Analysis.hh"
 3#include "Rivet/Projections/UnstableParticles.hh"
 4
 5namespace Rivet {
 6
 7
 8  /// @brief J/psi rate
 9  class BABAR_2001_I558091 : public Analysis {
10  public:
11
12    /// Constructor
13    RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2001_I558091);
14
15
16    /// @name Analysis methods
17    //@{
18
19    /// Book histograms and initialise projections before the run
20    void init() {
21      declare(UnstableParticles(), "UFS");
22      book(_c_jpsi, "/TMP/jpsi");
23    }
24
25
26    /// Perform the per-event analysis
27    void analyze(const Event& event) {
28      const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
29      double nJsi=0.;
30      for (const Particle& p : ufs.particles()) {
31        if (p.pid()==443) {
32	  bool fs = true;
33	  for (const Particle & child : p.children()) {
34	    if(child.pid()==443) {
35	      fs = false;
36	      break;
37	    }
38	  }
39	  if(fs) nJsi += 1.;
40	}
41      }
42      _c_jpsi->fill(nJsi);
43    }
44
45
46    /// Normalise histograms etc., after the run
47    void finalize() {
48      double fact = crossSection()/ sumOfWeights() /picobarn;
49      double sigma = _c_jpsi->val()*fact;
50      double error = _c_jpsi->err()*fact;
51      Scatter2D temphisto(refData(1, 1, 1));
52      Scatter2DPtr mult;
53      book(mult, 1, 1, 1);
54      for (size_t b = 0; b < temphisto.numPoints(); b++) {
55	const double x  = temphisto.point(b).x();
56	pair<double,double> ex = temphisto.point(b).xErrs();
57	pair<double,double> ex2 = ex;
58	if(ex2.first ==0.) ex2. first=0.0001;
59	if(ex2.second==0.) ex2.second=0.0001;
60	if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
61	  mult->addPoint(x, sigma, ex, make_pair(error,error));
62	}
63	else {
64	  mult->addPoint(x, 0., ex, make_pair(0.,.0));
65	}
66      }
67    }
68
69    //@}
70
71
72    /// @name Histograms
73    //@{
74    CounterPtr _c_jpsi;
75    //@}
76
77
78  };
79
80
81  // The hook for the plugin system
82  RIVET_DECLARE_PLUGIN(BABAR_2001_I558091);
83
84
85}