Rivet analyses referenceNA22_1986_I18431Multiplicity distributions in pp, K+p and π+p at plab=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 π+p fixed target collisions, plab=250 GeV/c or equivalently √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 sf *= 20.94; // simga_inel(pi+ p) from DOI:10.1007/BF01550769
31 }
32 else if (beam.first.pid() == PID::KPLUS && beam.second.pid() == PID::PROTON) {
33 btype = 2;
34 sf *= 17.72; // simga_inel(K+ p) from DOI:10.1007/BF01550769
35 }
36 else if (beam.first.pid() == PID::PROTON && beam.second.pid() == PID::PROTON) {
37 btype = 3;
38 sf *= 32.40; // simga_inel(p p) from DOI:10.1007/BF01550769
39 }
40 else {
41 MSG_ERROR("Beam error: Not compatible!");
42 return;
43 }
44
45 // Book histo for appropriate beam type
46 if (btype == 3) book(_h_mult2, btype, 1, 1);
47 else book(_h_mult1, btype, 1, 1);
48
49 }
50
51
52 /// Perform the per-event analysis
53 void analyze(const Event& event) {
54 size_t nfs = apply<ChargedFinalState>(event, "CFS").size();
55 if (nfs >= 30) nfs = 30;
56 if (_h_mult1) {
57 string edge = to_string(nfs)+".0";
58 if (nfs == 30) edge = ">= 30.0";
59 _h_mult1->fill(edge);
60 }
61 if (_h_mult2) _h_mult2->fill(nfs);
62 }
63
64
65 /// Normalise histograms etc., after the run
66 void finalize() {
67 if (_h_mult1) normalize(_h_mult1, sf); // normalize to 2 to account for bin width
68 if (_h_mult2) normalize(_h_mult2, sf); // normalize to 2 to account for bin width
69 }
70
71 /// @}
72
73
74 /// @name Histograms
75 /// @{
76 BinnedHistoPtr<string> _h_mult1;
77 BinnedHistoPtr<int> _h_mult2;
78 double sf = 2.0;
79 /// @}
80
81
82 };
83
84
85 RIVET_DECLARE_PLUGIN(NA22_1986_I18431);
86
87
88}
|