Rivet analyses referenceALICE_2016_I1507157Angular correlations of identified particles at 7 TeV.Experiment: ALICE (LHC) Inspire ID: 1507157 Status: UNVALIDATED Authors:
Beam energies: (3500.0, 3500.0) GeV Run details:
Angular correlations between like-sign and opposite-sign identified particles, integrated over $\Delta \eta < 1.3$. The analysis makes use of event mixing to remove background. The current implementation of the event mixing is not validated by experiment, and should be used with caution. Note in particular that for the event mixing to behave sensibly, event weights are assumed to be unity. Do not run this analysis with weighted events Source code: ALICE_2016_I1507157.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/AliceCommon.hh"
4#include "Rivet/Projections/PrimaryParticles.hh"
5#include "Rivet/Projections/ChargedFinalState.hh"
6#include "Rivet/Projections/EventMixingFinalState.hh"
7namespace Rivet {
8
9
10 /// @brief Correlations of identified particles in pp.
11 /// Also showcasing use of EventMixingFinalState.
12 class ALICE_2016_I1507157 : public Analysis {
13 public:
14
15 /// Constructor
16 RIVET_DEFAULT_ANALYSIS_CTOR(ALICE_2016_I1507157);
17
18
19 /// @name Analysis methods
20 //@{
21
22 /// @brief Calculate angular distance between particles.
23 double phaseDif(double a1, double a2){
24 double dif = a1 - a2;
25 while (dif < -M_PI/2)
26 dif += 2*M_PI;
27 while (dif > 3*M_PI/2)
28 dif -= 2*M_PI;
29 return dif;
30 }
31
32
33 /// Book histograms and initialise projections before the run
34 void init() {
35
36 double etamax = 0.8;
37 double pTmin = 0.5; // GeV
38
39 // Trigger
40 declare(ALICE::V0AndTrigger(), "V0-AND");
41 // Charged tracks used to manage the mixing observable.
42 ChargedFinalState cfsMult(Cuts::abseta < etamax);
43 declare(cfsMult, "CFSMult");
44
45 // Primary particles.
46 PrimaryParticles pp({Rivet::PID::PIPLUS, Rivet::PID::KPLUS,
47 Rivet::PID::K0S, Rivet::PID::K0L, Rivet::PID::PROTON,
48 Rivet::PID::NEUTRON, Rivet::PID::LAMBDA, Rivet::PID::SIGMAMINUS,
49 Rivet::PID::SIGMAPLUS, Rivet::PID::XIMINUS, Rivet::PID::XI0,
50 Rivet::PID::OMEGAMINUS},Cuts::abseta < etamax && Cuts::pT > pTmin*GeV);
51 declare(pp,"APRIM");
52
53 // The event mixing projection
54 declare(EventMixingFinalState(cfsMult, pp, 5, 0, 100, 10, defaultWeightIndex()),"EVM");
55 // The particle pairs.
56 pid = {{211, -211}, {321, -321}, {2212, -2212}, {3122, -3122}, {211, 211},
57 {321, 321}, {2212, 2212}, {3122, 3122}, {2212, 3122}, {2212, -3122}};
58 // The associated histograms in the data file.
59 vector<string> refdata = {"d04-x01-y01","d04-x01-y02","d04-x01-y03",
60 "d06-x01-y02","d05-x01-y01","d05-x01-y02","d05-x01-y03","d06-x01-y01",
61 "d01-x01-y02","d02-x01-y02"};
62 ratio.resize(refdata.size());
63 signal.resize(refdata.size());
64 background.resize(refdata.size());
65 for (int i = 0, N = refdata.size(); i < N; ++i) {
66 // The ratio plots.
67 book(ratio[i], refdata[i], true);
68 // Signal and mixed background.
69 book(signal[i], "/TMP/" + refdata[i] + "-s", refData(refdata[i]));
70 book(background[i], "/TMP/" + refdata[i] + "-b", refData(refdata[i]));
71 // Number of signal and mixed pairs.
72 nsp.push_back(0.);
73 nmp.push_back(0.);
74 }
75 }
76
77
78 /// Perform the per-event analysis
79 void analyze(const Event& event) {
80 // Triggering
81 if (!apply<ALICE::V0AndTrigger>(event, "V0-AND")()) return;
82 // The projections
83 const PrimaryParticles& pp =
84 applyProjection<PrimaryParticles>(event,"APRIM");
85 const EventMixingFinalState& evm =
86 applyProjection<EventMixingFinalState>(event, "EVM");
87 // Test if we have enough mixing events available to continue.
88 if (!evm.hasMixingEvents()) return;
89 for(const Particle& p1 : pp.particles()) {
90 // Start by doing the signal distributions
91 for(const Particle& p2 : pp.particles()) {
92 if(isSame(p1,p2))
93 continue;
94 double dEta = abs(p1.eta() - p2.eta());
95 double dPhi = phaseDif(p1.phi(), p2.phi());
96 if(dEta < 1.3) {
97 for (int i = 0, N = pid.size(); i < N; ++i) {
98 int pid1 = pid[i].first;
99 int pid2 = pid[i].second;
100 bool samesign = (pid1 * pid2 > 0);
101 if (samesign && ((pid1 == p1.pid() && pid2 == p2.pid()) ||
102 (pid1 == -p1.pid() && pid2 == -p2.pid()))) {
103 signal[i]->fill(dPhi);
104 nsp[i] += 1.0;
105 }
106 if (!samesign && abs(pid1) == abs(pid2) &&
107 pid1 == p1.pid() && pid2 == p2.pid()) {
108 signal[i]->fill(dPhi);
109 nsp[i] += 1.0;
110 }
111 if (!samesign && abs(pid1) != abs(pid2) &&
112 ( (pid1 == p1.pid() && pid2 == p2.pid()) ||
113 (pid2 == p1.pid() && pid1 == p2.pid()) ) ) {
114 signal[i]->fill(dPhi);
115 nsp[i] += 1.0;
116 }
117 }
118 }
119 }
120 // Then do the background distribution
121 for(const Particle& pMix : evm.particles()){
122 double dEta = abs(p1.eta() - pMix.eta());
123 double dPhi = phaseDif(p1.phi(), pMix.phi());
124 if(dEta < 1.3) {
125 for (int i = 0, N = pid.size(); i < N; ++i) {
126 int pid1 = pid[i].first;
127 int pid2 = pid[i].second;
128 bool samesign = (pid1 * pid2 > 0);
129 if (samesign && ((pid1 == p1.pid() && pid2 == pMix.pid()) ||
130 (pid1 == -p1.pid() && pid2 == -pMix.pid()))) {
131 background[i]->fill(dPhi);
132 nmp[i] += 1.0;
133 }
134 if (!samesign && abs(pid1) == abs(pid2) &&
135 pid1 == p1.pid() && pid2 == pMix.pid()) {
136 background[i]->fill(dPhi);
137 nmp[i] += 1.0;
138 }
139 if (!samesign && abs(pid1) != abs(pid2) &&
140 ( (pid1 == p1.pid() && pid2 == pMix.pid()) ||
141 (pid2 == p1.pid() && pid1 == pMix.pid()) ) ) {
142 background[i]->fill(dPhi);
143 nmp[i] += 1.0;
144 }
145 }
146 }
147 }
148 }
149 }
150
151
152 /// Normalise histograms etc., after the run
153 void finalize() {
154 for (int i = 0, N = pid.size(); i < N; ++i) {
155 double sc = nmp[i] / nsp[i];
156 signal[i]->scaleW(sc);
157 divide(signal[i],background[i],ratio[i]);
158 }
159 }
160
161 //@}
162
163
164 /// @name Histograms
165 //@{
166 vector<pair<int, int> > pid;
167 vector<Histo1DPtr> signal;
168 vector<Histo1DPtr> background;
169 vector<Scatter2DPtr> ratio;
170 vector<double> nsp;
171 vector<double> nmp;
172
173 //@}
174
175
176 };
177
178
179 // The hook for the plugin system
180 RIVET_DECLARE_PLUGIN(ALICE_2016_I1507157);
181
182
183}
|