Rivet analyses referenceALICE_2011_I885104Transverse momentum spectra of pions, kaons and protons in pp collisions at 0.9 TeVExperiment: ALICE (LHC) Inspire ID: 885104 Status: VALIDATED Authors:
Beam energies: (450.0, 450.0) GeV Run details:
Obtaining the transverse momentum spectra of pions, kaons and protons in $pp$ collisions at $\sqrt{s} = 0.9$ TeV with ALICE at the LHC. Mean transverse momentum as a function of the mass of the emitted particle is also included. Source code: ALICE_2011_I885104.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/ChargedFinalState.hh"
4
5namespace Rivet {
6
7
8 class ALICE_2011_I885104 : public Analysis {
9 public:
10
11 RIVET_DEFAULT_ANALYSIS_CTOR(ALICE_2011_I885104);
12
13
14 void init() {
15 const ChargedFinalState cfs((Cuts::etaIn(-15, 15)));
16 declare(cfs, "CFS");
17
18 book(_histPtPions ,"d01-x01-y01");
19 book(_histPtAntiPions ,"d01-x01-y02");
20 book(_histPtKaons ,"d02-x01-y01");
21 book(_histPtAntiKaons ,"d02-x01-y02");
22 book(_histPtProtons ,"d03-x01-y01");
23 book(_histPtAntiProtons ,"d03-x01-y02");
24 book(_histAveragePt ,"d04-x01-y01");
25 }
26
27
28 void analyze(const Event& event) {
29 if(_edges.empty()) _edges = _histAveragePt->xEdges();
30 const ChargedFinalState& cfs = apply<ChargedFinalState>(event, "CFS");
31 for (const Particle& p : cfs.particles()) {
32 if(p.absrap()<0.5) {
33 switch (p.pid()) {
34 case 211:
35 _histPtPions->fill(p.pT()/GeV);
36 _histAveragePt->fill(_edges[0], p.pT()/GeV);
37 break;
38 case -211:
39 _histPtAntiPions->fill(p.pT()/GeV);
40 _histAveragePt->fill(_edges[0], p.pT()/GeV);
41 break;
42 case 2212:
43 if ( !(p.hasAncestorWith(Cuts::pid == 3322) || // Xi0
44 p.hasAncestorWith(Cuts::pid == 3122) || p.hasAncestorWith(Cuts::pid == -3122) || // Lambda
45 p.hasAncestorWith(Cuts::pid == 3222) || p.hasAncestorWith(Cuts::pid == -3222) || // Sigma+/-
46 p.hasAncestorWith(Cuts::pid == 3312) || p.hasAncestorWith(Cuts::pid == -3312) ) ) { // Xi-/+
47 _histPtProtons->fill(p.pT()/GeV);
48 _histAveragePt->fill(_edges[2], p.pT()/GeV);
49 }
50 break;
51 case -2212:
52 if ( !(p.hasAncestorWith(Cuts::pid == 3322) || // Xi0
53 p.hasAncestorWith(Cuts::pid == 3122) || p.hasAncestorWith(Cuts::pid == -3122) || // Lambda
54 p.hasAncestorWith(Cuts::pid == 3222) || p.hasAncestorWith(Cuts::pid == -3222) || // Sigma+/-
55 p.hasAncestorWith(Cuts::pid == 3312) || p.hasAncestorWith(Cuts::pid == -3312) ) ) { // Xi-/+
56 _histPtAntiProtons->fill(p.pT()/GeV);
57 _histAveragePt->fill(_edges[2], p.pT()/GeV);
58 }
59 break;
60 case 321:
61 _histPtKaons->fill(p.pT()/GeV);
62 _histAveragePt->fill(_edges[1], p.pT()/GeV);
63 break;
64 case -321:
65 _histPtAntiKaons->fill(p.pT()/GeV);
66 _histAveragePt->fill(_edges[1], p.pT()/GeV);
67 break;
68 }
69 }
70 }
71 }
72
73
74 void finalize() {
75 scale(_histPtPions, 1./sumOfWeights());
76 scale(_histPtProtons, 1./sumOfWeights());
77 scale(_histPtKaons, 1./sumOfWeights());
78 scale(_histPtAntiPions, 1./sumOfWeights());
79 scale(_histPtAntiProtons, 1./sumOfWeights());
80 scale(_histPtAntiKaons, 1./sumOfWeights());
81 }
82
83
84 private:
85
86 Histo1DPtr _histPtPions;
87 Histo1DPtr _histPtProtons;
88 Histo1DPtr _histPtKaons;
89 Histo1DPtr _histPtAntiPions;
90 Histo1DPtr _histPtAntiProtons;
91 Histo1DPtr _histPtAntiKaons;
92 BinnedProfilePtr<string> _histAveragePt;
93 vector<string> _edges;
94
95 };
96
97
98
99 RIVET_DECLARE_ALIASED_PLUGIN(ALICE_2011_I885104, ALICE_2011_S8945144);
100
101}
|