Rivet analyses referenceNA49_2006_I694016Inclusive production of charged pions in p+p collisions at 158 GeV/c beam momentumExperiment: NA49 (SPS) Inspire ID: 694016 Status: UNVALIDATED Authors:
Beam energies: (8.7, 8.7) GeV Run details:
Charged pion production in fixed target, $p_{\mathrm{lab}} = $158 GeV/c. The elastic trigger is implemented by looking for elastic final states with only 2 particles, instead of attempting to reproduce the experimental trigger, which cannot be directly unfolded. Source code: NA49_2006_I694016.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4#include "Rivet/Particle.hh"
5
6namespace Rivet {
7
8
9 class NA49_2006_I694016 : public Analysis {
10 public:
11
12 /// @name Constructors etc.
13 /// @{
14 /// Constructor
15 NA49_2006_I694016() : Analysis("NA49_2006_I694016"){}
16
17
18
19 void init() {
20 declare(FinalState(), "FS");
21 book(_h_dndxf, 1,1,1);
22 book(_p_mptxf, 2,1,1);
23 book(_h_dndy, 3,1,1);
24 book(_c_ninel, "nInelastic");
25 }
26
27
28
29 void analyze(const Event& event) {
30 const FinalState& fs = apply<FinalState>(event, "FS");
31 const size_t numParticles = fs.particles().size();
32 const float SRT = event.sqrtS();
33
34 // Inelastic events selection
35 if (numParticles <= 2) {
36 MSG_DEBUG("Elastic event");
37 vetoEvent;
38 }
39 _c_ninel -> fill();
40
41 // Plot distributions
42 for(const Particle& p : fs.particles()) {
43 if(p.pid() == PID::PIPLUS){
44 double xF = p.pz() / (SRT/2.);
45 _h_dndxf -> fill(xF);
46 _h_dndy -> fill(p.rapidity());
47 _p_mptxf -> fill(xF, p.pt());
48 }
49 }
50 }
51
52
53
54 void finalize() {
55 scale(_h_dndxf, 1./ *_c_ninel); // Scale by the number of inelastic events
56 for (auto& b : _h_dndxf->bins()) b.scaleW(1./b.xWidth()); // Scale by the bin width (dxF)
57
58 scale(_h_dndy, 1./ *_c_ninel);
59 for (auto& by : _h_dndy->bins()) by.scaleW(1./by.xWidth());
60 }
61
62
63
64 private:
65 CounterPtr _c_ninel; // Counter of inelastic events
66 Histo1DPtr _h_dndxf; // dn/dxf histogram
67 Histo1DPtr _h_dndy; // dn/dy histogram
68 Profile1DPtr _p_mptxf; // mean pT vs xF profile
69 };
70
71
72 RIVET_DECLARE_PLUGIN(NA49_2006_I694016);
73}
|