Rivet analyses referenceNA22_1986_I18431Multiplicity distributions in $pp$, $K^+ p$ and $\pi^+ p$ at $p_{\mathrm{lab}} = 250$ GeV/cExperiment: NA22 (SPS) Inspire ID: 18431 Status: VALIDATED Authors:
Beam energies: (250.0, 0.0); (250.0, 0.0); (250.0, 0.0) GeV Run details:
Charged multiplicity distributions of $pp$, $K^+ p$ and $\pi^+ p$ fixed target collisions, $p_{\mathrm{lab}} = 250$ GeV/c or equivalently $\sqrt{s} = 21.7$ GeV/c (pp). Source code: NA22_1986_I18431.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/Beam.hh"
4#include "Rivet/Projections/ChargedFinalState.hh"
5
6namespace Rivet {
7
8
9 /// NA22 min bias multiplicity distributions.
10 class NA22_1986_I18431 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(NA22_1986_I18431);
15
16
17 /// @name Analysis methods
18 ///@{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22
23 declare(ChargedFinalState(), "CFS");
24
25 // Figure out beam type
26 const ParticlePair& beam = beams();
27 int btype = 0;
28 if (beam.first.pid() == PID::PIPLUS && beam.second.pid() == PID::PROTON)
29 btype = 1;
30 else if (beam.first.pid() == PID::KPLUS && beam.second.pid() == PID::PROTON)
31 btype = 2;
32 else if (beam.first.pid() == PID::PROTON && beam.second.pid() == PID::PROTON)
33 btype = 3;
34 else {
35 MSG_ERROR("Beam error: Not compatible!");
36 return;
37 }
38
39 // Book histo for appropriate beam type
40 book(_h_mult, btype, 1, 1);
41
42 }
43
44
45 /// Perform the per-event analysis
46 void analyze(const Event& event) {
47 size_t nfs = apply<ChargedFinalState>(event, "CFS").size();
48 if (nfs >= 30) nfs = 30;
49 _h_mult->fill(nfs);
50 }
51
52
53 /// Normalise histograms etc., after the run
54 void finalize() {
55 normalize(_h_mult, 2.0); // normalize to 2 to account for bin width
56 }
57
58 ///@}
59
60
61 /// @name Histograms
62 //@{
63 Histo1DPtr _h_mult;
64 //@}
65
66
67 };
68
69
70 // The hook for the plugin system
71 RIVET_DECLARE_PLUGIN(NA22_1986_I18431);
72
73
74}
|