Rivet analyses referenceALICE_2010_I860416Charged particle $\langle p_\perp \rangle$ vs. $N_\text{ch}$ in $pp$ collisions at 900 GeVExperiment: ALICE (LHC) Inspire ID: 860416 Status: VALIDATED Authors:
Beam energies: (450.0, 450.0) GeV Run details:
ALICE measurement of $\langle p_\perp \rangle$ vs. $N_\text{ch}$ and invariant particle yield (as function of $p_\perp$) in proton-proton collisions at $\sqrt{s} = 900 \text{GeV}$. Source code: ALICE_2010_I860416.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/ChargedFinalState.hh"
4
5namespace Rivet {
6
7
8 class ALICE_2010_I860416 : public Analysis {
9 public:
10
11 /// Constructor
12 RIVET_DEFAULT_ANALYSIS_CTOR(ALICE_2010_I860416);
13
14
15 /// @name Analysis methods
16 /// @{
17
18 /// Book histograms and initialise projections before the run
19 void init() {
20
21 ChargedFinalState cfs((Cuts::etaIn(-0.8, 0.8) && Cuts::pT >= 0.15));
22 declare(cfs, "CFS");
23
24 book(_h_pT, 4, 1, 1);
25
26 book(_h_pT_Nch_015, 11, 1, 1);
27 book(_h_pT_Nch_05, 12, 1, 1);
28
29 book(_Nevt_after_cuts,"Nevt_after_cuts");
30
31 }
32
33
34 /// Perform the per-event analysis
35 void analyze(const Event& event) {
36 const ChargedFinalState& charged = apply<ChargedFinalState>(event, "CFS");
37
38 _Nevt_after_cuts->fill();
39
40 // Get number of particles that fulfill certain pT requirements
41 int Nch_015 = 0;
42 int Nch_05 = 0;
43 for (const Particle& p : charged.particles()) {
44 double pT = p.pT()/GeV;
45 if (pT < 4.0) Nch_015++;
46 if (pT > 0.5 && pT < 4.0) Nch_05++;
47 }
48
49 // Now we can fill histograms
50 for (const Particle& p : charged.particles()) {
51 double pT = p.pT()/GeV;
52 if (pT < 4.0) _h_pT_Nch_015 ->fill(Nch_015, pT);
53 if (pT > 0.5 && pT < 4.0) _h_pT_Nch_05 ->fill(Nch_05, pT);
54
55 // To get the Yield, fill appropriate weight 1/(2PI * pT * d eta)
56 _h_pT->fill(pT, 1.0 /(TWOPI*pT*1.6) );
57 }
58
59 }
60
61
62 /// Normalise histograms etc., after the run
63 void finalize() {
64 scale(_h_pT, 1.0/ *_Nevt_after_cuts);
65 }
66
67 /// @}
68
69
70 private:
71
72 /// @name Histograms
73 /// @{
74 Histo1DPtr _h_pT;
75 Profile1DPtr _h_pT_Nch_015;
76 Profile1DPtr _h_pT_Nch_05;
77 CounterPtr _Nevt_after_cuts;
78 /// @}
79
80 };
81
82
83
84 RIVET_DECLARE_ALIASED_PLUGIN(ALICE_2010_I860416, ALICE_2010_S8706239);
85
86}
|