rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

DELPHI_1998_I473409

Flavour separated spectra for $\pi^\pm$, $K^\pm$, $p,\bar{p}$ production in hadronic $Z^0$ decays
Experiment: DELPHI (LEP)
Inspire ID: 473409
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Nucl.Phys. B444 (1995) 3-26, 1995
Beams: e+ e-
Beam energies: (45.6, 45.6) GeV
Run details:
  • Hadronic Z decay events generated on the Z pole ($\sqrt{s} = 91.2$ GeV)

DELPHI results for the spectra \pi^\pm$, $K^\pm$, $p,\bar{p}$ production in hadronic $Z^0$ decays. The results are separated in light and bottom quark initiated events.

Source code: DELPHI_1998_I473409.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/Beam.hh"
  4#include "Rivet/Projections/FinalState.hh"
  5#include "Rivet/Projections/ChargedFinalState.hh"
  6
  7#define I_KNOW_THE_INITIAL_QUARKS_PROJECTION_IS_DODGY_BUT_NEED_TO_USE_IT
  8#include "Rivet/Projections/InitialQuarks.hh"
  9
 10namespace Rivet {
 11
 12
 13  /// @brief flavour seperate pi,K,p spectra
 14  class DELPHI_1998_I473409 : public Analysis {
 15  public:
 16
 17    /// Constructor
 18    RIVET_DEFAULT_ANALYSIS_CTOR(DELPHI_1998_I473409);
 19
 20
 21    /// @name Analysis methods
 22    //@{
 23
 24    /// Book histograms and initialise projections before the run
 25    void init() {
 26
 27      // Initialise and register projections
 28      declare(Beam(), "Beams");
 29      declare(ChargedFinalState(), "FS");
 30      declare(InitialQuarks(), "IQF"); 
 31      // Book histograms
 32      book(_h_all_pi, "TMP/h_all_pi",refData( 4,1,1));
 33      book(_h_all_K , "TMP/h_all_K ",refData( 5,1,1));
 34      book(_h_all_p , "TMP/h_all_p ",refData( 6,1,1));
 35      book(_h_all_Kp, "TMP/h_all_Kp",refData( 7,1,1));
 36      book(_d_all   , "TMP/d_all   ",refData( 4,1,1));
 37      			           
 38      book(_h_bot_pi, "TMP/h_bot_pi",refData( 8,1,1));
 39      book(_h_bot_K , "TMP/h_bot_K ",refData( 9,1,1));
 40      book(_h_bot_p , "TMP/h_bot_p ",refData(10,1,1));
 41      book(_h_bot_Kp, "TMP/h_bot_Kp",refData(11,1,1));
 42      book(_d_bot   , "TMP/d_bot   ",refData( 8,1,1));
 43      			           
 44      book(_h_lgt_pi, "TMP/h_lgt_pi",refData(12,1,1));
 45      book(_h_lgt_K , "TMP/h_lgt_K ",refData(13,1,1));
 46      book(_h_lgt_p , "TMP/h_lgt_p ",refData(14,1,1));
 47      book(_h_lgt_Kp, "TMP/h_lgt_Kp",refData(15,1,1));
 48      book(_d_lgt   , "TMP/d_lgt   ",refData(12,1,1));
 49
 50      book(_h_all_ch_p, 16,1,1);
 51      book(_h_all_ch_x, 17,1,1);
 52      book(_h_all_pi_p, 18,1,1);
 53      book(_h_all_pi_x, 19,1,1);
 54      book(_h_all_K_p , 20,1,1);
 55      book(_h_all_k_x , 21,1,1);
 56      book(_h_all_p_p , 22,1,1);
 57      book(_h_all_p_x , 23,1,1);
 58           
 59      book(_h_bot_ch_p, 24,1,1);
 60      book(_h_bot_ch_x, 25,1,1);
 61      book(_h_bot_pi_p, 26,1,1);
 62      book(_h_bot_pi_x, 27,1,1);
 63      book(_h_bot_K_p , 28,1,1);
 64      book(_h_bot_k_x , 29,1,1);
 65      book(_h_bot_p_p , 30,1,1);
 66      book(_h_bot_p_x , 31,1,1);
 67           
 68      book(_h_lgt_ch_p, 32,1,1);
 69      book(_h_lgt_ch_x, 33,1,1);
 70      book(_h_lgt_pi_p, 34,1,1);
 71      book(_h_lgt_pi_x, 35,1,1);
 72      book(_h_lgt_K_p , 36,1,1);
 73      book(_h_lgt_k_x , 37,1,1);
 74      book(_h_lgt_p_p , 38,1,1);
 75      book(_h_lgt_p_x , 39,1,1);
 76
 77      for(unsigned int ix=0;ix<3;++ix) {
 78	for(unsigned int iy=0;iy<5;++iy) {
 79	  std::ostringstream title;
 80	  title << "/TMP/MULT_" << ix << "_" << iy;
 81	  book(_mult[ix][iy],title.str());
 82	}
 83      }
 84      book(_wLgt,"TMP/wLgt");
 85      book(_wBot,"TMP/wBot");
 86      book(_wAll,"TMP/wAll"); 
 87    }
 88
 89
 90    /// Perform the per-event analysis
 91    void analyze(const Event& event) {
 92
 93      // First, veto on leptonic events by requiring at least 4 charged FS particles
 94      const FinalState& fs = apply<ChargedFinalState>(event, "FS");
 95      const size_t numParticles = fs.particles().size();
 96
 97      // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
 98      if (numParticles < 2) {
 99        MSG_DEBUG("Failed leptonic event cut");
100        vetoEvent;
101      }
102      MSG_DEBUG("Passed leptonic event cut");
103
104
105      int flavour = 0;
106      const InitialQuarks& iqf = apply<InitialQuarks>(event, "IQF");
107
108      // If we only have two quarks (qqbar), just take the flavour.
109      // If we have more than two quarks, look for the highest energetic q-qbar pair.
110      if (iqf.particles().size() == 2) {
111        flavour = iqf.particles().front().abspid();
112      }
113      else {
114        map<int, double> quarkmap;
115        for (const Particle& p : iqf.particles()) {
116          if (quarkmap[p.pid()] < p.E()) {
117            quarkmap[p.pid()] = p.E();
118          }
119        }
120        double maxenergy = 0.;
121        for (int i = 1; i <= 5; ++i) {
122          if (quarkmap[i]+quarkmap[-i] > maxenergy) {
123           flavour = i;
124          }
125        }
126      }
127
128      // Get event weight for histo filling
129      _wAll->fill();
130      if(flavour<=3)      _wLgt->fill();
131      else if(flavour==5) _wBot->fill();
132
133      // Get beams and average beam momentum
134      const ParticlePair& beams = apply<Beam>(event, "Beams").beams();
135      const double meanBeamMom = ( beams.first.p3().mod() +
136                                   beams.second.p3().mod() ) / 2.0;
137      MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
138      // loop over the charged particles
139      for (const Particle& p : fs.particles()) {
140	double modp = p.p3().mod();
141        double xp = modp/meanBeamMom;
142	int id = abs(p.pid());
143	_d_all->fill(modp);
144	_mult[0][0]->fill();
145	_h_all_ch_p->fill(modp);
146	_h_all_ch_x->fill(xp  );
147	if(flavour<=3) {
148	  _d_lgt->fill(modp);
149	  _mult[2][0]->fill();
150	  _h_lgt_ch_p->fill(modp);
151	  _h_lgt_ch_x->fill(xp  );
152	}
153	else if(flavour==5) {
154	  _d_bot  ->fill(modp);
155	  _mult[1][0]->fill();
156	  _h_bot_ch_p->fill(modp);
157	  _h_bot_ch_x->fill(xp  );
158	}
159	if(id==211) {
160	  _h_all_pi ->fill(modp);
161	  _mult[0][1]->fill();
162	  _h_all_pi_p->fill(modp);
163	  _h_all_pi_x->fill(xp  );
164	  if(flavour<=3) {
165	    _h_lgt_pi ->fill(modp); 
166	    _mult[2][1]->fill();
167	    _h_lgt_pi_p->fill(modp);
168	    _h_lgt_pi_x->fill(xp  );
169	  }
170	  else if(flavour==5) {
171	    _h_bot_pi ->fill(modp);
172	    _mult[1][1]->fill();
173	    _h_bot_pi_p->fill(modp);
174	    _h_bot_pi_x->fill(xp  );
175	  }
176	}
177	else if(id==321) {
178	  _h_all_K ->fill(modp);
179	  _h_all_Kp->fill(modp);
180	  _mult[0][2]->fill();
181	  _mult[0][4]->fill();
182	  _h_all_K_p ->fill(modp);
183	  _h_all_k_x ->fill(xp  );
184	  if(flavour<=3) {
185	    _h_lgt_K->fill(modp);
186	    _h_lgt_Kp->fill(modp);
187	    _mult[2][2]->fill();
188	    _mult[2][4]->fill();
189	    _h_lgt_K_p ->fill(modp);
190	    _h_lgt_k_x ->fill(xp  );
191	  }
192	  else if(flavour==5) {
193	    _h_bot_K ->fill(modp);
194	    _h_bot_Kp->fill(modp);
195	    _mult[1][2]->fill();
196	    _mult[1][4]->fill();
197	    _h_bot_K_p ->fill(modp);
198	    _h_bot_k_x ->fill(xp  );
199	  }
200	}
201	else if(id==2212) {
202	  _h_all_p ->fill(modp);
203	  _h_all_Kp->fill(modp);
204	  _mult[0][3]->fill();
205	  _mult[0][4]->fill();
206	  _h_all_p_p ->fill(modp);
207	  _h_all_p_x ->fill(xp  );
208	  if(flavour<=3) {
209	    _h_lgt_p ->fill(modp);
210	    _h_lgt_Kp->fill(modp);
211	    _mult[2][3]->fill();
212	    _mult[2][4]->fill();
213	    _h_lgt_p_p ->fill(modp);
214	    _h_lgt_p_x ->fill(xp  );
215	  }
216	  else if(flavour==5) {
217	    _h_bot_p ->fill(modp);
218	    _h_bot_Kp->fill(modp); 
219	    _mult[1][3]->fill();
220	    _mult[1][4]->fill();
221	    _h_bot_p_p ->fill(modp);
222	    _h_bot_p_x ->fill(xp  );
223	  }
224	}
225      }
226    }
227
228
229    /// Normalise histograms etc., after the run
230    void finalize() {
231
232
233      // // Book histograms
234      scale(_h_all_pi,100.);
235      scale(_h_all_K ,100.);
236      scale(_h_all_p ,100.);
237      scale(_h_all_Kp,100.);
238      Scatter2DPtr temp;
239      book(temp,4,1,1);
240      divide(_h_all_pi, _d_all, temp);
241      book(temp,5,1,1);
242      divide(_h_all_K , _d_all, temp);
243      book(temp,6,1,1);
244      divide(_h_all_p , _d_all, temp);
245      book(temp,7,1,1);
246      divide(_h_all_Kp, _d_all, temp);
247      
248      scale(_h_bot_pi,100.);
249      scale(_h_bot_K ,100.);
250      scale(_h_bot_p ,100.);
251      scale(_h_bot_Kp,100.);
252      book(temp, 8,1,1);
253      divide(_h_bot_pi, _d_bot, temp);
254      book(temp, 9,1,1);
255      divide(_h_bot_K , _d_bot, temp);
256      book(temp,10,1,1);
257      divide(_h_bot_p , _d_bot, temp);
258      book(temp,11,1,1);
259      divide(_h_bot_Kp, _d_bot, temp);
260      
261      scale(_h_lgt_pi,100.);
262      scale(_h_lgt_K ,100.);
263      scale(_h_lgt_p ,100.);
264      scale(_h_lgt_Kp,100.);
265      book(temp,12,1,1);
266      divide(_h_lgt_pi, _d_lgt, temp);
267      book(temp,13,1,1);
268      divide(_h_lgt_K , _d_lgt, temp);
269      book(temp,14,1,1);
270      divide(_h_lgt_p , _d_lgt, temp);
271      book(temp,15,1,1);
272      divide(_h_lgt_Kp, _d_lgt, temp);
273
274      scale(_h_all_ch_p, 1./ *_wAll);
275      scale(_h_all_ch_x, 1./ *_wAll);
276      scale(_h_all_pi_p, 1./ *_wAll);
277      scale(_h_all_pi_x, 1./ *_wAll);
278      scale(_h_all_K_p , 1./ *_wAll);
279      scale(_h_all_k_x , 1./ *_wAll);
280      scale(_h_all_p_p , 1./ *_wAll);
281      scale(_h_all_p_x , 1./ *_wAll);
282
283      scale(_h_bot_ch_p, 1./ *_wBot);
284      scale(_h_bot_ch_x, 1./ *_wBot);
285      scale(_h_bot_pi_p, 1./ *_wBot);
286      scale(_h_bot_pi_x, 1./ *_wBot);
287      scale(_h_bot_K_p , 1./ *_wBot);
288      scale(_h_bot_k_x , 1./ *_wBot);
289      scale(_h_bot_p_p , 1./ *_wBot);
290      scale(_h_bot_p_x , 1./ *_wBot);
291
292      scale(_h_lgt_ch_p, 1./ *_wLgt);
293      scale(_h_lgt_ch_x, 1./ *_wLgt);
294      scale(_h_lgt_pi_p, 1./ *_wLgt);
295      scale(_h_lgt_pi_x, 1./ *_wLgt);
296      scale(_h_lgt_K_p , 1./ *_wLgt);
297      scale(_h_lgt_k_x , 1./ *_wLgt);
298      scale(_h_lgt_p_p , 1./ *_wLgt);
299      scale(_h_lgt_p_x , 1./ *_wLgt);
300
301      // multiplicities
302      vector<CounterPtr> scales = {_wAll,_wBot,_wLgt};
303      for(unsigned int ix=0;ix<3;++ix) {
304	if(scales[ix]->effNumEntries()<=0.) continue;
305	for(unsigned int iy=0;iy<5;++iy) {
306	  Scatter2DPtr scatter;
307	  book(scatter, ix+1, 1, iy+1, true);
308	  scale(_mult[ix][iy],1./ *scales[ix]);
309	  scatter->point(0).setY(_mult[ix][iy]->val(),_mult[ix][iy]->err());
310	}
311      }
312    }
313
314    //@}
315
316
317    /// @name Histograms
318    //@{
319    Histo1DPtr _h_all_pi , _h_all_K  , _h_all_p  , _h_all_Kp , _d_all;
320    Histo1DPtr _h_bot_pi , _h_bot_K  , _h_bot_p  , _h_bot_Kp , _d_bot;
321    Histo1DPtr _h_lgt_pi , _h_lgt_K  , _h_lgt_p  , _h_lgt_Kp , _d_lgt;
322    Histo1DPtr _h_all_ch_p, _h_all_ch_x , _h_all_pi_p , _h_all_pi_x ;
323    Histo1DPtr _h_all_K_p , _h_all_k_x  , _h_all_p_p  , _h_all_p_x  ;
324    Histo1DPtr _h_bot_ch_p , _h_bot_ch_x , _h_bot_pi_p , _h_bot_pi_x;
325    Histo1DPtr _h_bot_K_p  , _h_bot_k_x  , _h_bot_p_p  , _h_bot_p_x ;
326    Histo1DPtr _h_lgt_ch_p , _h_lgt_ch_x , _h_lgt_pi_p , _h_lgt_pi_x;
327    Histo1DPtr _h_lgt_K_p  , _h_lgt_k_x  , _h_lgt_p_p  , _h_lgt_p_x ;
328    CounterPtr _mult[3][5];
329
330    CounterPtr _wLgt, _wBot, _wAll;
331    //@}
332
333  };
334
335
336  // The hook for the plugin system
337  RIVET_DECLARE_PLUGIN(DELPHI_1998_I473409);
338
339
340}