Rivet analyses referenceALICE_2012_I1126966Pion, Kaon, and Proton Production in Central Pb-Pb Collisions at 2.76 TeVExperiment: ALICE (LHC) Inspire ID: 1126966 Status: UNVALIDATED Authors:
Beam energies: (287040.0, 287040.0) GeV Run details:
Measurements of the transverse momentum distributions of charged pions, kaons and (anti)protons in Lead-Lead collisions at a centre-of-mass energy per nucleon of 2.76 TeV. The data, covering the PT range up to 4.5 GeV for protons, is restricted to the central rapidity range |y| < 0.5. Source code: ALICE_2012_I1126966.cc 1//-*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/CentralityProjection.hh"
4#include "Rivet/Projections/AliceCommon.hh"
5#include "Rivet/Tools/AliceCommon.hh"
6
7namespace Rivet {
8
9
10 /// Pion, Kaon, and Proton Production in 0-5%
11 /// central Pb--Pb Collisions at 2.76 TeV
12 class ALICE_2012_I1126966 : public Analysis {
13 public:
14
15 /// Constructor
16 RIVET_DEFAULT_ANALYSIS_CTOR(ALICE_2012_I1126966);
17
18 /// Book histograms and initialise projections before the run
19 void init() {
20 // Particles of interest.
21 declare(ALICE::PrimaryParticles(Cuts::absrap < 0.5),"CFS");
22
23 // The event trigger.
24 declare(ALICE::V0AndTrigger(), "V0-AND");
25 // The centrality projection.
26 declareCentrality(ALICE::V0MMultiplicity(),
27 "ALICE_2015_PBPBCentrality", "V0M", "V0M");
28
29 // Invariant pT distributions.
30 book(_histPtPi, "d01-x01-y01"); //pi+
31 book(_histPtPibar, "d01-x01-y02");// pi-
32 book(_histPtKaon, "d02-x01-y01"); //K+
33 book(_histPtKaonbar, "d02-x01-y02"); //K-
34 book(_histPtProton, "d03-x01-y01"); //P+
35 book(_histPtProtonbar, "d03-x01-y02"); //P-
36 // Yield histograms.
37 book(_histNpi, "d04-x01-y01");
38 book(_histNpibar, "d04-x01-y02");
39 book(_histNKaon, "d04-x01-y03");
40 book(_histNKaonbar, "d04-x01-y04");
41 book(_histNproton, "d04-x01-y05");
42 book(_histNprotonbar, "d04-x01-y06");
43 // Sum of weights of triggered events.
44 book(sow, "sow");
45 }
46
47
48 /// Perform the per-event analysis
49 void analyze(const Event& event) {
50 // Analysis only considers 0-5% central events
51 if (apply<CentralityProjection>(event,"V0M")() > 5.0)
52 vetoEvent;
53 // Event trigger.
54 if (!apply<ALICE::V0AndTrigger>(event, "V0-AND")() ) vetoEvent;
55
56 sow->fill();
57 // ID particles counters for this event.
58 int Npi=0;
59 int Npibar=0;
60 int NKaon=0;
61 int NKaonbar=0;
62 int Nproton=0;
63 int Nprotonbar=0;
64
65 for (const Particle& p : apply<ALICE::PrimaryParticles>(event,"CFS").particles()) {
66 const double pWeight = 1.0 / p.pT() / 2. / M_PI;
67 switch (p.pid()) {
68 case 211: // pi+
69 Npi++;
70 _histPtPi->fill(p.pT()/GeV, pWeight);
71 break;
72 case -211: //pi-
73 Npibar++;
74 _histPtPibar->fill(p.pT()/GeV, pWeight);
75 break;
76 case 2212: // proton
77 Nproton++;
78 _histPtProton->fill(p.pT()/GeV, pWeight);
79 break;
80 case -2212: // p-bar
81 Nprotonbar++;
82 _histPtProtonbar->fill(p.pT()/GeV, pWeight);
83 break;
84 case 321: // K+
85 NKaon++;
86 _histPtKaon->fill(p.pT()/GeV, pWeight);
87 break;
88 case -321: // K-
89 NKaonbar++;
90 _histPtKaonbar->fill(p.pT()/GeV, pWeight);
91 break;
92 }
93 } // Particle loop ends.
94
95 // Fill yield histograms.
96 _histNpi->fill(0.0, Npi);
97 _histNpibar->fill(0.0, Npibar);
98 _histNKaon->fill(0.0, NKaon);
99 _histNKaonbar->fill(0.0, NKaonbar);
100 _histNproton->fill(0.0, Nproton);
101 _histNprotonbar->fill(0.0, Nprotonbar);
102 }
103
104
105 void finalize() {
106 const double s = 1./sow->sumW();
107 _histPtPi->scaleW(s);
108 _histPtPibar->scaleW(s);
109 _histPtKaon->scaleW(s);
110 _histPtKaonbar->scaleW(s);
111 _histPtProton->scaleW(s);
112 _histPtProtonbar->scaleW(s);
113 _histNpi->scaleW(s);
114 _histNpibar->scaleW(s);
115 _histNKaon->scaleW(s);
116 _histNKaonbar->scaleW(s);
117 _histNproton->scaleW(s);
118 _histNprotonbar->scaleW(s);
119
120}
121
122 private:
123
124 // pT histograms
125 Histo1DPtr _histPtPi;
126 Histo1DPtr _histPtKaon;
127 Histo1DPtr _histPtProton;
128 Histo1DPtr _histPtPibar;
129 Histo1DPtr _histPtKaonbar;
130 Histo1DPtr _histPtProtonbar;
131 Histo1DPtr _histNpi;
132 Histo1DPtr _histNpibar;
133 Histo1DPtr _histNKaon;
134 Histo1DPtr _histNKaonbar;
135 Histo1DPtr _histNproton;
136 Histo1DPtr _histNprotonbar;
137 CounterPtr sow;
138
139 };
140
141
142 // The hook for the plugin system
143 RIVET_DECLARE_PLUGIN(ALICE_2012_I1126966);
144
145
146}
|