Rivet analyses referenceALICE_2014_I1244523Multiplicity Dependence of Pion, Kaon, Proton and Lambda Production in p--Pb Collisions at 5.02 TeV/nnExperiment: ALICE (LHC) Inspire ID: 1244523 Status: UNVALIDATED Authors:
Beam energies: (4000.0, 326560.0) GeV Run details:
Identified baryons and mesons plotted in invariant pT spectra as well as average pT and yield ratios. The measurements are done in centrality classes, and one must apply centrality selection by first running the ALICE pB centrality calibration analysis and preloading the produced histograms. No generator level cut on particle life time should be applied. Source code: ALICE_2014_I1244523.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#include "Rivet/Tools/Cuts.hh"
7
8namespace Rivet {
9
10
11 /// @brief Identified particles in p--Pb @ 5 TeV
12 class ALICE_2014_I1244523 : public Analysis {
13 public:
14
15 /// Constructor
16 RIVET_DEFAULT_ANALYSIS_CTOR(ALICE_2014_I1244523);
17
18
19 /// @name Analysis methods
20 //@{
21
22 int profileIndex(vector<double> cBins, double c) {
23 int index = 100;
24 if (c > 0 && c <= cBins[0]) return cBins.size() - 1;
25 for (size_t i = 0; i < cBins.size() - 1; ++i) {
26 if (c > cBins[i] && c <= cBins[i + 1]) {
27 index = i;
28 break;
29 }
30 }
31 // Catch low fluctuation.
32 return max(0, int(cBins.size() - index - 2));
33 }
34
35 void scaleHisto(Histo1DPtr h) {
36 vector<YODA::HistoBin1D>& bins = h->bins();
37 for (vector<YODA::HistoBin1D>::iterator b = bins.begin(); b != bins.end(); ++b) {
38 b->scaleW(1./b->width()/b->xMid());
39 }
40 }
41
42 /// Book histograms and initialise projections before the run
43 void init() {
44 // The centrality projection.
45 declareCentrality(ALICE::V0AMultiplicity(),
46 "ALICE_2015_PPBCentrality", "V0A", "V0A");
47
48 // Define the cuts for the analysis:
49 // pPb Collision has a centre of mass system shift of +0.465
50 // They study -0.5 < yCoM < 0.0 -> -0.035 < y < 0.465
51 const Cut& cut = Cuts::rap < 0.035 && Cuts::rap > -0.465;
52 //const Cut& cut = Cuts::rap > -0.035 && Cuts::rap < 0.465;
53 const ALICE::PrimaryParticles fs(cut);
54 declare(fs,"FS");
55
56 // The event trigger.
57 declare(ALICE::V0AndTrigger(), "V0-AND");
58
59 // The centrality bins
60 centralityBins = {5.,10.,20.,40.,60.,80.,100.};
61
62 for (int i = 0; i < 4; ++i) {
63 // First we book the invariant spectra.
64 book(_histPipT[centralityBins[i]], 1, 1, 1 + i);
65 if (i < 3) book(_histPipT[centralityBins[i + 4]], 2, 1, 1 + i);
66 book(_histKpT[centralityBins[i]], 3, 1, 1 + i);
67 if (i < 3) book(_histKpT[centralityBins[i + 4]], 4, 1, 1 + i);
68 book(_histK0SpT[centralityBins[i]], 5, 1, 1 + i);
69 if (i < 3) book(_histK0SpT[centralityBins[i + 4]], 6, 1, 1 + i);
70 book(_histProtonpT[centralityBins[i]], 7, 1, 1 + i);
71 if (i < 3) book(_histProtonpT[centralityBins[i + 4]], 8, 1, 1 + i);
72 book(_histLambdapT[centralityBins[i]], 9, 1, 1 + i);
73 if (i < 3) book(_histLambdapT[centralityBins[i + 4]], 10, 1, 1 + i);
74 // The associated sow counters.
75 book(_sow[centralityBins[i]], "TMP/sow" + toString(i));
76 if (i < 3) book(_sow[centralityBins[i + 4]], "TMP/sow" + toString(i + 4));
77 // Then the pi spectra going into the centrality dependent pT ratios.
78 book(_tmpPi4KpT[centralityBins[i]], "TMP/NPi4K" + toString(i), refData(11, 1, 1 + i));
79 if (i < 3) book(_tmpPi4KpT[centralityBins[i + 4]], "TMP/NPi4K" + toString(i + 4), refData(12, 1, 1 + i));
80 book(_tmpPi4PpT[centralityBins[i]], "TMP/NPi4P" + toString(i), refData(13, 1, 1 + i));
81 if (i < 3) book(_tmpPi4PpT[centralityBins[i + 4]], "TMP/NPi4P" + toString(i + 4), refData(14, 1, 1 + i));
82 book(_tmpK4LpT[centralityBins[i]], "TMP/NK4L" + toString(i), refData(15, 1, 1 + i));
83 if (i < 3) book(_tmpK4LpT[centralityBins[i + 4]], "TMP/NK4L" + toString(i + 4), refData(16, 1, 1 + i));
84 // Then the rest of the spectra going into the cent. dep't pT ratios.
85 book(_tmpKpT[centralityBins[i]], "TMP/NK" + toString(i), refData(11, 1, 1 + i));
86 if (i < 3) book(_tmpKpT[centralityBins[i + 4]], "TMP/NK" + toString(i + 4), refData(12, 1, 1 + i));
87 book(_tmpProtonpT[centralityBins[i]], "TMP/NP" + toString(i), refData(13, 1, 1 + i));
88 if (i < 3) book(_tmpProtonpT[centralityBins[i + 4]], "TMP/NP" + toString(i + 4), refData(14, 1, 1 + i));
89 book(_tmpLambdapT[centralityBins[i]], "TMP/NL" + toString(i), refData(15, 1, 1 + i));
90 if (i < 3) book(_tmpLambdapT[centralityBins[i + 4]], "TMP/NL" + toString(i + 4), refData(16, 1, 1 + i));
91 // Then the centrality dependent pT ratios.
92 book(_ratioKPi[centralityBins[i]], 11, 1, 1 + i, true);
93 if (i < 3) book(_ratioKPi[centralityBins[i + 4]], 12, 1, 1 + i, true);
94 book(_ratioPPi[centralityBins[i]], 13, 1, 1 + i, true);
95 if (i < 3) book(_ratioPPi[centralityBins[i + 4]], 14, 1, 1 + i, true);
96 book(_ratioLK[centralityBins[i]], 15, 1, 1 + i, true);
97 if (i < 3) book(_ratioLK[centralityBins[i + 4]], 16, 1, 1 + i, true);
98 }
99
100 // Mean pT vs. multiplicity class.
101 book(_histLambdaMeanpT, 17, 1, 1);
102 book(_histProtonMeanpT, 18, 1, 1);
103 book(_histK0SMeanpT, 19, 1, 1);
104 book(_histKMeanpT, 20, 1, 1);
105 book(_histPiMeanpT, 21, 1, 1);
106
107 // Yield ratios.
108 book(_histKtoPiYield, 22, 1, 1, true);
109 book(_histProtontoPiYield, 22, 1, 2, true);
110 book(_histLambdatoPiYield, 22, 1, 3, true);
111
112 book(_histKYield, "TMP/KY", refData(22,1,1));
113 book(_histProtonYield, "TMP/PrY",refData(22,1,2));
114 book(_histLambdaYield, "TMP/LY", refData(22,1,3));
115 book(_histPiYield, "TMP/PiY",refData(22,1,1));
116 book(_histPi4LYield, "TMP/PiLY",refData(22,1,3)); // HepData entry is wrong -- look in the paper.
117
118 }
119
120
121 /// Perform the per-event analysis
122 void analyze(const Event& event) {
123 // Event trigger.
124 if (!apply<ALICE::V0AndTrigger>(event, "V0-AND")() ) vetoEvent;
125 // Centrality
126 const CentralityProjection& cent = apply<CentralityProjection>(event,"V0A");
127 double c = cent();
128 // Find the index for the profiles.
129 int index = profileIndex(centralityBins, c);
130 // Find the correct histograms
131 // all the pion histos
132 auto pi1Itr = _histPipT.upper_bound(c);
133 // Test the first one.
134 if (pi1Itr == _histPipT.end()) return;
135 auto pi2Itr = _tmpPi4KpT.upper_bound(c);
136 auto pi3Itr = _tmpPi4PpT.upper_bound(c);
137 // Then the rest
138 auto kItr = _histKpT.upper_bound(c);
139 auto k0Itr = _histK0SpT.upper_bound(c);
140 auto krItr = _tmpKpT.upper_bound(c);
141 auto klItr = _tmpK4LpT.upper_bound(c);
142 auto pItr = _histProtonpT.upper_bound(c);
143 auto prItr = _tmpProtonpT.upper_bound(c);
144 auto lItr = _histLambdapT.upper_bound(c);
145 auto lrItr = _tmpLambdapT.upper_bound(c);
146 // And the sow
147 auto sowItr = _sow.upper_bound(c);
148 sowItr->second->fill();
149
150
151 const ALICE::PrimaryParticles& fs =
152 apply<ALICE::PrimaryParticles>(event,"FS");
153 // Count number of particles for yields.
154 int npi = 0, nk = 0, np = 0, nlam = 0;
155 for(auto p : fs.particles()) {
156 const double pT = p.pT();
157 const int pid = abs(p.pid());
158 const double nW = 1 / M_PI / pT; // Dividing and multiplying by 2 because dy.
159 if (pid == 211) { // pi+/-
160 ++npi;
161 pi1Itr->second->fill(pT, nW);
162 pi2Itr->second->fill(pT);
163 pi3Itr->second->fill(pT);
164 _histPiMeanpT->fillBin(index, pT);
165 }
166 else if (pid == 321) { // K +/-
167 ++nk;
168 kItr->second->fill(pT, nW);
169 krItr->second->fill(pT);
170 _histKMeanpT->fillBin(index, pT);
171 }
172 else if (pid == 310) { // K0S
173 k0Itr->second->fill(pT, nW);
174 klItr->second->fill(pT);
175 _histK0SMeanpT->fillBin(index, pT);
176 }
177 else if (pid == 2212) { // p + pbar
178 ++np;
179 pItr->second->fill(pT, nW);
180 prItr->second->fill(pT);
181 _histProtonMeanpT->fillBin(index, pT);
182 }
183 else if (pid == 3122) { // Lambda + Lambdabar
184 ++nlam;
185 lItr->second->fill(pT, nW);
186 lrItr->second->fill(pT);
187 _histLambdaMeanpT->fillBin(index, pT);
188 }
189 }
190 // Fill the yield profiles.
191 _histKYield->fillBin(index, double(nk));
192 _histPi4LYield->fillBin(index, double(npi));
193 _histProtonYield->fillBin(index, double(np));
194 _histPiYield->fillBin(index, double(npi));
195 _histLambdaYield->fillBin(index, double(nlam));
196 }
197
198 /// Normalise histograms etc., after the run
199 void finalize() {
200
201 // Loop over centrality classes.
202 for (int i = 0; i < 7; i++){
203
204 // Normalize the spectra.
205 _histPipT[centralityBins[i]]->scaleW(1./_sow[centralityBins[i]]->sumW());
206 _histKpT[centralityBins[i]]->scaleW(1./_sow[centralityBins[i]]->sumW());
207 _histK0SpT[centralityBins[i]]->scaleW(1./_sow[centralityBins[i]]->sumW());
208 _histProtonpT[centralityBins[i]]->scaleW(1./_sow[centralityBins[i]]->sumW());
209 _histLambdapT[centralityBins[i]]->scaleW(1./_sow[centralityBins[i]]->sumW());
210
211 // Make the pT ratios.
212 divide(_tmpKpT[centralityBins[i]], _tmpPi4KpT[centralityBins[i]],
213 _ratioKPi[centralityBins[i]]);
214 divide(_tmpProtonpT[centralityBins[i]], _tmpPi4PpT[centralityBins[i]],
215 _ratioPPi[centralityBins[i]]);
216 divide(_tmpLambdapT[centralityBins[i]], _tmpK4LpT[centralityBins[i]],
217 _ratioLK[centralityBins[i]]);
218 }
219
220 divide(_histKYield, _histPiYield, _histKtoPiYield);
221 divide(_histProtonYield, _histPiYield, _histProtontoPiYield);
222 divide(_histLambdaYield, _histPi4LYield, _histLambdatoPiYield);
223
224 }
225
226 //@}
227
228private:
229 vector<double> centralityBins;
230 // pT spectra (separated by multiplicity classes)
231 map<double, Histo1DPtr> _histPipT;
232 map<double, Histo1DPtr> _histKpT;
233 map<double, Histo1DPtr> _histK0SpT;
234 map<double, Histo1DPtr> _histProtonpT;
235 map<double, Histo1DPtr> _histLambdapT;
236
237 // Associated sum of weights.
238 map<double, CounterPtr> _sow;
239
240 // pT spectra for ratios.
241 map<double, Histo1DPtr> _tmpPi4KpT;
242 map<double, Histo1DPtr> _tmpPi4PpT;
243 map<double, Histo1DPtr> _tmpK4LpT;
244 map<double, Histo1DPtr> _tmpKpT;
245 map<double, Histo1DPtr> _tmpProtonpT;
246 map<double, Histo1DPtr> _tmpLambdapT;
247
248 // The acual ratios.
249 map<double, Scatter2DPtr> _ratioKPi;
250 map<double, Scatter2DPtr> _ratioPPi;
251 map<double, Scatter2DPtr> _ratioLK;
252
253 // Mean pT vs. Multiplicity
254 Profile1DPtr _histKMeanpT;
255 Profile1DPtr _histK0SMeanpT;
256 Profile1DPtr _histProtonMeanpT;
257 Profile1DPtr _histLambdaMeanpT;
258 Profile1DPtr _histPiMeanpT;
259
260 // Total yields
261 Profile1DPtr _histKYield;
262 Profile1DPtr _histProtonYield;
263 Profile1DPtr _histLambdaYield;
264 Profile1DPtr _histPiYield;
265 Profile1DPtr _histPi4LYield;
266
267 // Yield ratios.
268 Scatter2DPtr _histKtoPiYield;
269 Scatter2DPtr _histProtontoPiYield;
270 Scatter2DPtr _histLambdatoPiYield;
271
272 };
273
274
275 // The hook for the plugin system
276 RIVET_DECLARE_PLUGIN(ALICE_2014_I1244523);
277
278
279}
|