Rivet analyses referenceHRS_1987_I215848Hadron Spectra in $e^+e^-$ collisions at 29 GeVExperiment: HRS (PEP) Inspire ID: 215848 Status: VALIDATED Authors:
Beam energies: (14.5, 14.5) GeV Run details:
$K^0$, $K^+$, $p$, $\pi^+$ and $\Lambda^0$ spectra at $\sqrt{s} = 29.$ GeV using the HRS detector at PEP. Source code: HRS_1987_I215848.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief Hadron Spectra in $e^+e^-$ collisions at 29 GeV
9 class HRS_1987_I215848 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(HRS_1987_I215848);
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(_h["pi"], 2, 1, 1);
23 book(_h["Kp"], 3, 1, 1);
24 book(_h["p"], 4, 1, 1);
25 book(_h["K0"], 5, 1, 1);
26 book(_h["lam"], 6, 1, 1);
27 }
28
29
30 /// Perform the per-event analysis
31 void analyze(const Event& event) {
32 const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
33 for (const Particle & p : ufs.particles()) {
34 const double xE = 2.*p.E()/sqrtS();
35 const double beta = p.p3().mod() / p.E();
36 if (p.pid()==130 || p.pid()==310) {
37 _h["K0"]->fill(xE,1./beta);
38 }
39 else if (p.abspid()==321) {
40 _h["Kp"]->fill(xE, 1./beta);
41 }
42 else if (p.abspid()==211) {
43 _h["pi"]->fill(xE, 1./beta);
44 }
45 else if (p.abspid()==2212) {
46 _h["p"]->fill(xE, 1./beta);
47 }
48 else if (p.abspid()==3122) {
49 _h["lam"]->fill(xE, 1./beta);
50 }
51 }
52 }
53
54 /// Normalise histograms etc., after the run
55 void finalize() {
56 const double sf = crossSection()*sqr(sqrtS())/microbarn/sumOfWeights();
57 scale(_h, sf);
58 }
59
60 ///@}
61
62
63 /// @name Histograms
64 ///@{
65 map<string, Histo1DPtr> _h;
66 ///@}
67
68
69 };
70
71
72 RIVET_DECLARE_PLUGIN(HRS_1987_I215848);
73
74}
|