rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

SLD_1999_I469925

Production of $\pi^+$, $K^+$, $K^0$, $K^{*0}$, $\Phi$, $p$ and $\Lambda^0$ in hadronic $Z^0$ decay
Experiment: SLD (SLC)
Inspire ID: 469925
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Phys.Rev.D59:052001,1999
  • hep-ex/9805029
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)

Measurement of scaled momentum distributions and fragmentation functions in flavour tagged events at SLC. SLD measured these observables in uds-, c-, and b-events separately. An inclusive measurement is also included.

Source code: SLD_1999_I469925.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/Beam.hh"
  4#include "Rivet/Projections/FinalState.hh"
  5#include "Rivet/Projections/UnstableParticles.hh"
  6#include "Rivet/Projections/ChargedFinalState.hh"
  7#include "Rivet/Projections/Thrust.hh"
  8
  9#define I_KNOW_THE_INITIAL_QUARKS_PROJECTION_IS_DODGY_BUT_NEED_TO_USE_IT
 10#include "Rivet/Projections/InitialQuarks.hh"
 11
 12namespace Rivet {
 13
 14
 15  /// @brief SLD flavour-dependent fragmentation paper
 16  ///
 17  /// @author Peter Richardson
 18  class SLD_1999_I469925 : public Analysis {
 19  public:
 20
 21    /// Constructor
 22    SLD_1999_I469925()
 23      : Analysis("SLD_1999_I469925"),
 24         _multPiPlus(4),_multKPlus(4),_multK0(4),
 25         _multKStar0(4),_multPhi(4),
 26         _multProton(4),_multLambda(4)
 27    {    }
 28
 29
 30    /// @name Analysis methods
 31    /// @{
 32
 33    void analyze(const Event& e) {
 34      // First, veto on leptonic events by requiring at least 4 charged FS particles
 35      const FinalState& fs = apply<FinalState>(e, "FS");
 36      const size_t numParticles = fs.particles().size();
 37
 38      // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
 39      if (numParticles < 2) {
 40        MSG_DEBUG("Failed ncharged cut");
 41        vetoEvent;
 42      }
 43      MSG_DEBUG("Passed ncharged cut");
 44
 45      // Get beams and average beam momentum
 46      const ParticlePair& beams = apply<Beam>(e, "Beams").beams();
 47      const double meanBeamMom = ( beams.first.p3().mod() +
 48                                   beams.second.p3().mod() ) / 2.0;
 49      MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
 50      int flavour = 0;
 51      const InitialQuarks& iqf = apply<InitialQuarks>(e, "IQF");
 52
 53      // If we only have two quarks (qqbar), just take the flavour.
 54      // If we have more than two quarks, look for the highest energetic q-qbar pair.
 55      /// @todo Can we make this based on hadron flavour instead?
 56      Particles quarks;
 57      if (iqf.particles().size() == 2) {
 58        flavour = iqf.particles().front().abspid();
 59        quarks = iqf.particles();
 60      } else {
 61        map<int, Particle > quarkmap;
 62        for (const Particle& p : iqf.particles()) {
 63          if (quarkmap.find(p.pid()) == quarkmap.end()) quarkmap[p.pid()] = p;
 64          else if (quarkmap[p.pid()].E() < p.E()) quarkmap[p.pid()] = p;
 65        }
 66        double maxenergy = 0.;
 67        for (int i = 1; i <= 5; ++i) {
 68          double energy(0.);
 69          if (quarkmap.find( i) != quarkmap.end())
 70            energy += quarkmap[ i].E();
 71          if (quarkmap.find(-i) != quarkmap.end())
 72            energy += quarkmap[-i].E();
 73          if (energy > maxenergy)
 74            flavour = i;
 75        }
 76        if (quarkmap.find(flavour) != quarkmap.end())
 77          quarks.push_back(quarkmap[flavour]);
 78        if (quarkmap.find(-flavour) != quarkmap.end())
 79          quarks.push_back(quarkmap[-flavour]);
 80      }
 81      switch (flavour) {
 82      case PID::DQUARK:
 83      case PID::UQUARK:
 84      case PID::SQUARK:
 85        _SumOfudsWeights->fill();
 86        break;
 87      case PID::CQUARK:
 88        _SumOfcWeights->fill();
 89        break;
 90      case PID::BQUARK:
 91        _SumOfbWeights->fill();
 92        break;
 93      }
 94      // thrust axis for projections
 95      Vector3 axis = apply<Thrust>(e, "Thrust").thrustAxis();
 96      double dot(0.);
 97      if (!quarks.empty()) {
 98        dot = quarks[0].p3().dot(axis);
 99        if (quarks[0].pid() < 0) dot *= -1;
100      }
101
102      for (const Particle& p : fs.particles()) {
103        const double xp = p.p3().mod()/meanBeamMom;
104        // if in quark or antiquark hemisphere
105        bool quark = p.p3().dot(axis)*dot > 0.;
106        _h_XpChargedN->fill(xp);
107        _temp_XpChargedN1->fill(xp);
108        _temp_XpChargedN2->fill(xp);
109        _temp_XpChargedN3->fill(xp);
110        int id = p.abspid();
111        // charged pions
112        if (id == PID::PIPLUS) {
113          _h_XpPiPlusN->fill(xp);
114          _multPiPlus[0]->fill();
115          switch (flavour) {
116          case PID::DQUARK:
117          case PID::UQUARK:
118          case PID::SQUARK:
119            _multPiPlus[1]->fill();
120            _h_XpPiPlusLight->fill(xp);
121            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
122              _h_RPiPlus->fill(xp);
123            else
124              _h_RPiMinus->fill(xp);
125            break;
126          case PID::CQUARK:
127            _multPiPlus[2]->fill();
128            _h_XpPiPlusCharm->fill(xp);
129            break;
130          case PID::BQUARK:
131            _multPiPlus[3]->fill();
132            _h_XpPiPlusBottom->fill(xp);
133            break;
134          }
135        }
136        else if (id == PID::KPLUS) {
137          _h_XpKPlusN->fill(xp);
138          _multKPlus[0]->fill();
139          switch (flavour) {
140          case PID::DQUARK:
141          case PID::UQUARK:
142          case PID::SQUARK:
143            _multKPlus[1]->fill();
144            _temp_XpKPlusLight->fill(xp);
145            _h_XpKPlusLight->fill(xp);
146            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
147              _h_RKPlus->fill(xp);
148            else
149              _h_RKMinus->fill(xp);
150            break;
151         break;
152          case PID::CQUARK:
153            _multKPlus[2]->fill();
154            _h_XpKPlusCharm->fill(xp);
155            _temp_XpKPlusCharm->fill(xp);
156            break;
157          case PID::BQUARK:
158            _multKPlus[3]->fill();
159            _h_XpKPlusBottom->fill(xp);
160            break;
161          }
162        }
163        else if (id == PID::PROTON) {
164          _h_XpProtonN->fill(xp);
165          _multProton[0]->fill();
166          switch (flavour) {
167          case PID::DQUARK:
168          case PID::UQUARK:
169          case PID::SQUARK:
170            _multProton[1]->fill();
171            _temp_XpProtonLight->fill(xp);
172            _h_XpProtonLight->fill(xp);
173            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
174              _h_RProton->fill(xp);
175            else
176              _h_RPBar  ->fill(xp);
177            break;
178         break;
179          case PID::CQUARK:
180            _multProton[2]->fill();
181            _temp_XpProtonCharm->fill(xp);
182            _h_XpProtonCharm->fill(xp);
183            break;
184          case PID::BQUARK:
185            _multProton[3]->fill();
186            _h_XpProtonBottom->fill(xp);
187            break;
188          }
189        }
190      }
191
192      const UnstableParticles& ufs = apply<UnstableParticles>(e, "UFS");
193      for (const Particle& p : ufs.particles()) {
194        const double xp = p.p3().mod()/meanBeamMom;
195        // if in quark or antiquark hemisphere
196        bool quark = p.p3().dot(axis)*dot>0.;
197        int id = p.abspid();
198        if (id == PID::LAMBDA) {
199          _multLambda[0]->fill();
200          _h_XpLambdaN->fill(xp);
201          switch (flavour) {
202          case PID::DQUARK:
203          case PID::UQUARK:
204          case PID::SQUARK:
205            _multLambda[1]->fill();
206            _h_XpLambdaLight->fill(xp);
207            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
208              _h_RLambda->fill(xp);
209            else
210              _h_RLBar  ->fill(xp);
211            break;
212          case PID::CQUARK:
213            _multLambda[2]->fill();
214            _h_XpLambdaCharm->fill(xp);
215            break;
216          case PID::BQUARK:
217            _multLambda[3]->fill();
218            _h_XpLambdaBottom->fill(xp);
219            break;
220          }
221        }
222        else if (id == 313) {
223          _multKStar0[0]->fill();
224          _h_XpKStar0N->fill(xp);
225          switch (flavour) {
226          case PID::DQUARK:
227          case PID::UQUARK:
228          case PID::SQUARK:
229            _multKStar0[1]->fill();
230            _temp_XpKStar0Light->fill(xp);
231            _h_XpKStar0Light->fill(xp);
232            if ( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
233              _h_RKS0   ->fill(xp);
234            else
235              _h_RKSBar0->fill(xp);
236            break;
237            break;
238          case PID::CQUARK:
239            _multKStar0[2]->fill();
240            _temp_XpKStar0Charm->fill(xp);
241            _h_XpKStar0Charm->fill(xp);
242            break;
243          case PID::BQUARK:
244            _multKStar0[3]->fill();
245            _h_XpKStar0Bottom->fill(xp);
246            break;
247          }
248        }
249        else if (id == 333) {
250          _multPhi[0]->fill();
251          _h_XpPhiN->fill(xp);
252          switch (flavour) {
253          case PID::DQUARK:
254          case PID::UQUARK:
255          case PID::SQUARK:
256            _multPhi[1]->fill();
257            _h_XpPhiLight->fill(xp);
258            break;
259          case PID::CQUARK:
260            _multPhi[2]->fill();
261            _h_XpPhiCharm->fill(xp);
262            break;
263          case PID::BQUARK:
264            _multPhi[3]->fill();
265            _h_XpPhiBottom->fill(xp);
266            break;
267          }
268        }
269        else if (id == PID::K0S || id == PID::K0L) {
270          _multK0[0]->fill();
271          _h_XpK0N->fill(xp);
272          switch (flavour) {
273          case PID::DQUARK:
274          case PID::UQUARK:
275          case PID::SQUARK:
276            _multK0[1]->fill();
277            _h_XpK0Light->fill(xp);
278            break;
279          case PID::CQUARK:
280            _multK0[2]->fill();
281            _h_XpK0Charm->fill(xp);
282            break;
283          case PID::BQUARK:
284            _multK0[3]->fill();
285            _h_XpK0Bottom->fill(xp);
286            break;
287          }
288        }
289      }
290    }
291
292
293    void init() {
294      // Projections
295      declare(Beam(), "Beams");
296      declare(ChargedFinalState(), "FS");
297      declare(UnstableParticles(), "UFS");
298      declare(InitialQuarks(), "IQF");
299      declare(Thrust(FinalState()), "Thrust");
300
301      book(_temp_XpChargedN1 ,"TMP/XpChargedN1", refData( 1, 1, 1));
302      book(_temp_XpChargedN2 ,"TMP/XpChargedN2", refData( 2, 1, 1));
303      book(_temp_XpChargedN3 ,"TMP/XpChargedN3", refData( 3, 1, 1));
304
305      book(_h_XpPiPlusN      , 1, 1, 2);
306      book(_h_XpKPlusN       , 2, 1, 2);
307      book(_h_XpProtonN      , 3, 1, 2);
308      book(_h_XpChargedN     , 4, 1, 1);
309      book(_h_XpK0N          , 5, 1, 1);
310      book(_h_XpLambdaN      , 7, 1, 1);
311      book(_h_XpKStar0N      , 8, 1, 1);
312      book(_h_XpPhiN         , 9, 1, 1);
313
314      book(_h_XpPiPlusLight  ,10, 1, 1);
315      book(_h_XpPiPlusCharm  ,10, 1, 2);
316      book(_h_XpPiPlusBottom ,10, 1, 3);
317      book(_h_XpKPlusLight   ,12, 1, 1);
318      book(_h_XpKPlusCharm   ,12, 1, 2);
319      book(_h_XpKPlusBottom  ,12, 1, 3);
320      book(_h_XpKStar0Light  ,14, 1, 1);
321      book(_h_XpKStar0Charm  ,14, 1, 2);
322      book(_h_XpKStar0Bottom ,14, 1, 3);
323      book(_h_XpProtonLight  ,16, 1, 1);
324      book(_h_XpProtonCharm  ,16, 1, 2);
325      book(_h_XpProtonBottom ,16, 1, 3);
326      book(_h_XpLambdaLight  ,18, 1, 1);
327      book(_h_XpLambdaCharm  ,18, 1, 2);
328      book(_h_XpLambdaBottom ,18, 1, 3);
329      book(_h_XpK0Light      ,20, 1, 1);
330      book(_h_XpK0Charm      ,20, 1, 2);
331      book(_h_XpK0Bottom     ,20, 1, 3);
332      book(_h_XpPhiLight     ,22, 1, 1);
333      book(_h_XpPhiCharm     ,22, 1, 2);
334      book(_h_XpPhiBottom    ,22, 1, 3);
335
336      book(_temp_XpKPlusCharm   ,"TMP/XpKPlusCharm", refData(13, 1, 1));
337      book(_temp_XpKPlusLight   ,"TMP/XpKPlusLight", refData(13, 1, 1));
338      book(_temp_XpKStar0Charm  ,"TMP/XpKStar0Charm", refData(15, 1, 1));
339      book(_temp_XpKStar0Light  ,"TMP/XpKStar0Light", refData(15, 1, 1));
340      book(_temp_XpProtonCharm  ,"TMP/XpProtonCharm", refData(17, 1, 1));
341      book(_temp_XpProtonLight  ,"TMP/XpProtonLight", refData(17, 1, 1));
342
343      book(_h_RPiPlus  , 26, 1, 1);
344      book(_h_RPiMinus , 26, 1, 2);
345      book(_h_RKS0     , 28, 1, 1);
346      book(_h_RKSBar0  , 28, 1, 2);
347      book(_h_RKPlus   , 30, 1, 1);
348      book(_h_RKMinus  , 30, 1, 2);
349      book(_h_RProton  , 32, 1, 1);
350      book(_h_RPBar    , 32, 1, 2);
351      book(_h_RLambda  , 34, 1, 1);
352      book(_h_RLBar    , 34, 1, 2);
353
354      book(_s_Xp_PiPl_Ch      , 1, 1, 1);
355      book(_s_Xp_KPl_Ch       , 2, 1, 1);
356      book(_s_Xp_Pr_Ch        , 3, 1, 1);
357      book(_s_Xp_PiPlCh_PiPlLi, 11, 1, 1);
358      book(_s_Xp_PiPlBo_PiPlLi, 11, 1, 2);
359      book(_s_Xp_KPlCh_KPlLi  , 13, 1, 1);
360      book(_s_Xp_KPlBo_KPlLi  , 13, 1, 2);
361      book(_s_Xp_KS0Ch_KS0Li  , 15, 1, 1);
362      book(_s_Xp_KS0Bo_KS0Li  , 15, 1, 2);
363      book(_s_Xp_PrCh_PrLi    , 17, 1, 1);
364      book(_s_Xp_PrBo_PrLi    , 17, 1, 2);
365      book(_s_Xp_LaCh_LaLi    , 19, 1, 1);
366      book(_s_Xp_LaBo_LaLi    , 19, 1, 2);
367      book(_s_Xp_K0Ch_K0Li    , 21, 1, 1);
368      book(_s_Xp_K0Bo_K0Li    , 21, 1, 2);
369      book(_s_Xp_PhiCh_PhiLi  , 23, 1, 1);
370      book(_s_Xp_PhiBo_PhiLi  , 23, 1, 2);
371
372      book(_s_PiM_PiP   , 27, 1, 1);
373      book(_s_KSBar0_KS0, 29, 1, 1);
374      book(_s_KM_KP     , 31, 1, 1);
375      book(_s_Pr_PBar   , 33, 1, 1);
376      book(_s_Lam_LBar  , 35, 1, 1);
377
378      book(_SumOfudsWeights, "_SumOfudsWeights");
379      book(_SumOfcWeights, "_SumOfcWeights");
380      book(_SumOfbWeights, "_SumOfbWeights");
381
382      for ( size_t i=0; i<4; ++i) {
383      	book(_multPiPlus[i], "_multPiPlus_"+to_str(i));
384      	book(_multKPlus[i], "_multKPlus_"+to_str(i));
385      	book(_multK0[i], "_multK0_"+to_str(i));
386      	book(_multKStar0[i], "_multKStar0_"+to_str(i));
387      	book(_multPhi[i], "_multPhi_"+to_str(i));
388      	book(_multProton[i], "_multProton_"+to_str(i));
389      	book(_multLambda[i], "_multLambda_"+to_str(i));
390      }
391
392      book(tmp1, 24, 1, 1);
393      book(tmp2, 24, 1, 2);
394      book(tmp3, 24, 1, 3);
395      book(tmp4, 24, 1, 4);
396      book(tmp5, 25, 1, 1);
397      book(tmp6, 25, 1, 2);
398      book(tmp7, 24, 2, 1);
399      book(tmp8, 24, 2, 2);
400      book(tmp9, 24, 2, 3);
401      book(tmp10, 24, 2, 4);
402      book(tmp11, 25, 2, 1);
403      book(tmp12, 25, 2, 2);
404      book(tmp13, 24, 3, 1);
405      book(tmp14, 24, 3, 2);
406      book(tmp15, 24, 3, 3);
407      book(tmp16, 24, 3, 4);
408      book(tmp17, 25, 3, 1);
409      book(tmp18, 25, 3, 2);
410      book(tmp19, 24, 4, 1);
411      book(tmp20, 24, 4, 2);
412      book(tmp21, 24, 4, 3);
413      book(tmp22, 24, 4, 4);
414      book(tmp23, 25, 4, 1);
415      book(tmp24, 25, 4, 2);
416      book(tmp25, 24, 5, 1);
417      book(tmp26, 24, 5, 2);
418      book(tmp27, 24, 5, 3);
419      book(tmp28, 24, 5, 4);
420      book(tmp29, 25, 5, 1);
421      book(tmp30, 25, 5, 2);
422      book(tmp31, 24, 6, 1);
423      book(tmp32, 24, 6, 2);
424      book(tmp33, 24, 6, 3);
425      book(tmp34, 24, 6, 4);
426      book(tmp35, 25, 6, 1);
427      book(tmp36, 25, 6, 2);
428      book(tmp37, 24, 7, 1);
429      book(tmp38, 24, 7, 2);
430      book(tmp39, 24, 7, 3);
431      book(tmp40, 24, 7, 4);
432      book(tmp41, 25, 7, 1);
433      book(tmp42, 25, 7, 2);
434    }
435
436
437    /// Finalize
438    void finalize() {
439      // Get the ratio plots sorted out first
440      divide(_h_XpPiPlusN, _temp_XpChargedN1, _s_Xp_PiPl_Ch);
441      divide(_h_XpKPlusN, _temp_XpChargedN2, _s_Xp_KPl_Ch);
442      divide(_h_XpProtonN, _temp_XpChargedN3, _s_Xp_Pr_Ch);
443      divide(_h_XpPiPlusCharm, _h_XpPiPlusLight, _s_Xp_PiPlCh_PiPlLi);
444      _s_Xp_PiPlCh_PiPlLi->scale(dbl(*_SumOfudsWeights / *_SumOfcWeights));
445      divide(_h_XpPiPlusBottom, _h_XpPiPlusLight, _s_Xp_PiPlBo_PiPlLi);
446       _s_Xp_PiPlBo_PiPlLi->scale(dbl(*_SumOfudsWeights / *_SumOfbWeights));
447      divide(_temp_XpKPlusCharm , _temp_XpKPlusLight, _s_Xp_KPlCh_KPlLi);
448      _s_Xp_KPlCh_KPlLi->scale(dbl(*_SumOfudsWeights / *_SumOfcWeights));
449      divide(_h_XpKPlusBottom, _h_XpKPlusLight, _s_Xp_KPlBo_KPlLi);
450       _s_Xp_KPlBo_KPlLi->scale(dbl(*_SumOfudsWeights / *_SumOfbWeights));
451      divide(_temp_XpKStar0Charm, _temp_XpKStar0Light, _s_Xp_KS0Ch_KS0Li);
452      _s_Xp_KS0Ch_KS0Li->scale(dbl(*_SumOfudsWeights / *_SumOfcWeights));
453      divide(_h_XpKStar0Bottom, _h_XpKStar0Light, _s_Xp_KS0Bo_KS0Li);
454      _s_Xp_KS0Bo_KS0Li->scale(dbl(*_SumOfudsWeights / *_SumOfbWeights));
455      divide(_temp_XpProtonCharm, _temp_XpProtonLight, _s_Xp_PrCh_PrLi);
456      _s_Xp_PrCh_PrLi->scale(dbl(*_SumOfudsWeights / *_SumOfcWeights));
457      divide(_h_XpProtonBottom, _h_XpProtonLight, _s_Xp_PrBo_PrLi);
458      _s_Xp_PrBo_PrLi->scale(dbl(*_SumOfudsWeights / *_SumOfbWeights));
459      divide(_h_XpLambdaCharm, _h_XpLambdaLight, _s_Xp_LaCh_LaLi);
460      _s_Xp_LaCh_LaLi->scale(dbl(*_SumOfudsWeights / *_SumOfcWeights));
461      divide(_h_XpLambdaBottom, _h_XpLambdaLight, _s_Xp_LaBo_LaLi);
462      _s_Xp_LaBo_LaLi->scale(dbl(*_SumOfudsWeights / *_SumOfbWeights));
463      divide(_h_XpK0Charm, _h_XpK0Light, _s_Xp_K0Ch_K0Li);
464      _s_Xp_K0Ch_K0Li->scale(dbl(*_SumOfudsWeights / *_SumOfcWeights));
465      divide(_h_XpK0Bottom, _h_XpK0Light, _s_Xp_K0Bo_K0Li);
466      _s_Xp_K0Bo_K0Li->scale(dbl(*_SumOfudsWeights / *_SumOfbWeights));
467      divide(_h_XpPhiCharm, _h_XpPhiLight, _s_Xp_PhiCh_PhiLi);
468      _s_Xp_PhiCh_PhiLi->scale(dbl(*_SumOfudsWeights / *_SumOfcWeights));
469      divide(_h_XpPhiBottom, _h_XpPhiLight, _s_Xp_PhiBo_PhiLi);
470      _s_Xp_PhiBo_PhiLi->scale(dbl(*_SumOfudsWeights / *_SumOfbWeights));
471
472      // Then the leading particles
473      divide(*_h_RPiMinus - *_h_RPiPlus, *_h_RPiMinus + *_h_RPiPlus, _s_PiM_PiP);
474      divide(*_h_RKSBar0 - *_h_RKS0, *_h_RKSBar0 + *_h_RKS0, _s_KSBar0_KS0);
475      divide(*_h_RKMinus - *_h_RKPlus, *_h_RKMinus + *_h_RKPlus, _s_KM_KP);
476      divide(*_h_RProton - *_h_RPBar, *_h_RProton + *_h_RPBar, _s_Pr_PBar);
477      divide(*_h_RLambda - *_h_RLBar, *_h_RLambda + *_h_RLBar, _s_Lam_LBar);
478
479      // Then the rest
480      scale(_h_XpPiPlusN,      1/sumOfWeights());
481      scale(_h_XpKPlusN,       1/sumOfWeights());
482      scale(_h_XpProtonN,      1/sumOfWeights());
483      scale(_h_XpChargedN,     1/sumOfWeights());
484      scale(_h_XpK0N,          1/sumOfWeights());
485      scale(_h_XpLambdaN,      1/sumOfWeights());
486      scale(_h_XpKStar0N,      1/sumOfWeights());
487      scale(_h_XpPhiN,         1/sumOfWeights());
488      scale(_h_XpPiPlusLight,  1 / *_SumOfudsWeights);
489      scale(_h_XpPiPlusCharm,  1 / *_SumOfcWeights);
490      scale(_h_XpPiPlusBottom, 1 / *_SumOfbWeights);
491      scale(_h_XpKPlusLight,   1 / *_SumOfudsWeights);
492      scale(_h_XpKPlusCharm,   1 / *_SumOfcWeights);
493      scale(_h_XpKPlusBottom,  1 / *_SumOfbWeights);
494      scale(_h_XpKStar0Light,  1 / *_SumOfudsWeights);
495      scale(_h_XpKStar0Charm,  1 / *_SumOfcWeights);
496      scale(_h_XpKStar0Bottom, 1 / *_SumOfbWeights);
497      scale(_h_XpProtonLight,  1 / *_SumOfudsWeights);
498      scale(_h_XpProtonCharm,  1 / *_SumOfcWeights);
499      scale(_h_XpProtonBottom, 1 / *_SumOfbWeights);
500      scale(_h_XpLambdaLight,  1 / *_SumOfudsWeights);
501      scale(_h_XpLambdaCharm,  1 / *_SumOfcWeights);
502      scale(_h_XpLambdaBottom, 1 / *_SumOfbWeights);
503      scale(_h_XpK0Light,      1 / *_SumOfudsWeights);
504      scale(_h_XpK0Charm,      1 / *_SumOfcWeights);
505      scale(_h_XpK0Bottom,     1 / *_SumOfbWeights);
506      scale(_h_XpPhiLight,     1 / *_SumOfudsWeights);
507      scale(_h_XpPhiCharm ,    1 / *_SumOfcWeights);
508      scale(_h_XpPhiBottom,    1 / *_SumOfbWeights);
509      scale(_h_RPiPlus,        1 / *_SumOfudsWeights);
510      scale(_h_RPiMinus,       1 / *_SumOfudsWeights);
511      scale(_h_RKS0,           1 / *_SumOfudsWeights);
512      scale(_h_RKSBar0,        1 / *_SumOfudsWeights);
513      scale(_h_RKPlus,         1 / *_SumOfudsWeights);
514      scale(_h_RKMinus,        1 / *_SumOfudsWeights);
515      scale(_h_RProton,        1 / *_SumOfudsWeights);
516      scale(_h_RPBar,          1 / *_SumOfudsWeights);
517      scale(_h_RLambda,        1 / *_SumOfudsWeights);
518      scale(_h_RLBar,          1 / *_SumOfudsWeights);
519
520      // Multiplicities
521      double avgNumPartsAll, avgNumPartsLight,avgNumPartsCharm, avgNumPartsBottom;
522      // pi+/-
523      // all
524      avgNumPartsAll = dbl(*_multPiPlus[0])/sumOfWeights();
525      tmp1->bin(1).set(avgNumPartsAll, 0.);
526      // light
527      avgNumPartsLight = dbl(*_multPiPlus[1] / *_SumOfudsWeights);
528      tmp2->bin(1).set(avgNumPartsLight, 0.);
529      // charm
530      avgNumPartsCharm = dbl(*_multPiPlus[2] / *_SumOfcWeights);
531      tmp3->bin(1).set(avgNumPartsCharm, 0.);
532      // bottom
533      avgNumPartsBottom = dbl(*_multPiPlus[3] / *_SumOfbWeights);
534      tmp4->bin(1).set(avgNumPartsBottom, 0.);
535      // charm-light
536      tmp5->bin(1).set(avgNumPartsCharm - avgNumPartsLight, 0.);
537      // bottom-light
538      tmp6->bin(1).set(avgNumPartsBottom - avgNumPartsLight, 0.);
539      // K+/-
540      // all
541      avgNumPartsAll = dbl(*_multKPlus[0])/sumOfWeights();
542      tmp7->bin(1).set(avgNumPartsAll, 0.);
543      // light
544      avgNumPartsLight = dbl(*_multKPlus[1] / *_SumOfudsWeights);
545      tmp8->bin(1).set(avgNumPartsLight, 0.);
546      // charm
547      avgNumPartsCharm = dbl(*_multKPlus[2] / *_SumOfcWeights);
548      tmp9->bin(1).set(avgNumPartsCharm, 0.);
549      // bottom
550      avgNumPartsBottom = dbl(*_multKPlus[3] / *_SumOfbWeights);
551      tmp10->bin(1).set(avgNumPartsBottom, 0.);
552      // charm-light
553      tmp11->bin(1).set(avgNumPartsCharm - avgNumPartsLight, 0.);
554      // bottom-light
555      tmp12->bin(1).set(avgNumPartsBottom - avgNumPartsLight, 0.);
556      // K0
557      // all
558      avgNumPartsAll = dbl(*_multK0[0])/sumOfWeights();
559      tmp13->bin(1).set(avgNumPartsAll, 0.);
560      // light
561      avgNumPartsLight = dbl(*_multK0[1] / *_SumOfudsWeights);
562      tmp14->bin(1).set(avgNumPartsLight, 0.);
563      // charm
564      avgNumPartsCharm = dbl(*_multK0[2] / *_SumOfcWeights);
565      tmp15->bin(1).set(avgNumPartsCharm, 0.);
566      // bottom
567      avgNumPartsBottom = dbl(*_multK0[3] / *_SumOfbWeights);
568      tmp16->bin(1).set(avgNumPartsBottom, 0.);
569      // charm-light
570      tmp17->bin(1).set(avgNumPartsCharm - avgNumPartsLight, 0.);
571      // bottom-light
572      tmp18->bin(1).set(avgNumPartsBottom - avgNumPartsLight, 0.);
573      // K*0
574      // all
575      avgNumPartsAll = dbl(*_multKStar0[0])/sumOfWeights();
576      tmp19->bin(1).set(avgNumPartsAll, 0.);
577      // light
578      avgNumPartsLight = dbl(*_multKStar0[1] / *_SumOfudsWeights);
579      tmp20->bin(1).set(avgNumPartsLight, 0.);
580      // charm
581      avgNumPartsCharm = dbl(*_multKStar0[2] / *_SumOfcWeights);
582      tmp21->bin(1).set(avgNumPartsCharm, 0.);
583      // bottom
584      avgNumPartsBottom = dbl(*_multKStar0[3] / *_SumOfbWeights);
585      tmp22->bin(1).set(avgNumPartsBottom, 0.);
586      // charm-light
587      tmp23->bin(1).set(avgNumPartsCharm - avgNumPartsLight, 0.);
588      // bottom-light
589      tmp24->bin(1).set(avgNumPartsBottom - avgNumPartsLight, 0.);
590      // phi
591      // all
592      avgNumPartsAll = dbl(*_multPhi[0])/sumOfWeights();
593      tmp25->bin(1).set(avgNumPartsAll, 0.);
594      // light
595      avgNumPartsLight = dbl(*_multPhi[1] / *_SumOfudsWeights);
596      tmp26->bin(1).set(avgNumPartsLight, 0.);
597      // charm
598      avgNumPartsCharm = dbl(*_multPhi[2] / *_SumOfcWeights);
599      tmp27->bin(1).set(avgNumPartsCharm, 0.);
600      // bottom
601      avgNumPartsBottom = dbl(*_multPhi[3] / *_SumOfbWeights);
602      tmp28->bin(1).set(avgNumPartsBottom, 0.);
603      // charm-light
604      tmp29->bin(1).set(avgNumPartsCharm - avgNumPartsLight, 0.);
605      // bottom-light
606      tmp30->bin(1).set(avgNumPartsBottom - avgNumPartsLight, 0.);
607      // p
608      // all
609      avgNumPartsAll = dbl(*_multProton[0])/sumOfWeights();
610      tmp31->bin(1).set(avgNumPartsAll, 0.);
611      // light
612      avgNumPartsLight = dbl(*_multProton[1] / *_SumOfudsWeights);
613      tmp32->bin(1).set(avgNumPartsLight, 0.);
614      // charm
615      avgNumPartsCharm = dbl(*_multProton[2] / *_SumOfcWeights);
616      tmp33->bin(1).set(avgNumPartsCharm, 0.);
617      // bottom
618      avgNumPartsBottom = dbl(*_multProton[3] / *_SumOfbWeights);
619      tmp34->bin(1).set(avgNumPartsBottom, 0.);
620      // charm-light
621      tmp35->bin(1).set(avgNumPartsCharm - avgNumPartsLight, 0.);
622      // bottom-light
623      tmp36->bin(1).set(avgNumPartsBottom - avgNumPartsLight, 0.);
624      // Lambda
625      // all
626      avgNumPartsAll = dbl(*_multLambda[0])/sumOfWeights();
627      tmp37->bin(1).set(avgNumPartsAll, 0.);
628      // light
629      avgNumPartsLight = dbl(*_multLambda[1] / *_SumOfudsWeights);
630      tmp38->bin(1).set(avgNumPartsLight, 0.);
631      // charm
632      avgNumPartsCharm = dbl(*_multLambda[2] / *_SumOfcWeights);
633      tmp39->bin(1).set(avgNumPartsCharm, 0.);
634      // bottom
635      avgNumPartsBottom = dbl(*_multLambda[3] / *_SumOfbWeights);
636      tmp40->bin(1).set(avgNumPartsBottom, 0.);
637      // charm-light
638      tmp41->bin(1).set(avgNumPartsCharm - avgNumPartsLight, 0.);
639      // bottom-light
640      tmp42->bin(1).set(avgNumPartsBottom - avgNumPartsLight, 0.);
641    }
642
643    /// @}
644
645
646  private:
647
648    /// Store the weighted sums of numbers of charged / charged+neutral
649    /// particles. Used to calculate average number of particles for the
650    /// inclusive single particle distributions' normalisations.
651    CounterPtr _SumOfudsWeights, _SumOfcWeights, _SumOfbWeights;
652    vector<CounterPtr> _multPiPlus, _multKPlus, _multK0,
653      _multKStar0, _multPhi, _multProton, _multLambda;
654
655    Histo1DPtr _h_XpPiPlusSig, _h_XpPiPlusN;
656    Histo1DPtr _h_XpKPlusSig, _h_XpKPlusN;
657    Histo1DPtr _h_XpProtonSig, _h_XpProtonN;
658    Histo1DPtr _h_XpChargedN;
659    Histo1DPtr _h_XpK0N, _h_XpLambdaN;
660    Histo1DPtr _h_XpKStar0N, _h_XpPhiN;
661    Histo1DPtr _h_XpPiPlusLight, _h_XpPiPlusCharm, _h_XpPiPlusBottom;
662    Histo1DPtr _h_XpKPlusLight, _h_XpKPlusCharm, _h_XpKPlusBottom;
663    Histo1DPtr _h_XpKStar0Light, _h_XpKStar0Charm, _h_XpKStar0Bottom;
664    Histo1DPtr _h_XpProtonLight, _h_XpProtonCharm, _h_XpProtonBottom;
665    Histo1DPtr _h_XpLambdaLight, _h_XpLambdaCharm, _h_XpLambdaBottom;
666    Histo1DPtr _h_XpK0Light, _h_XpK0Charm, _h_XpK0Bottom;
667    Histo1DPtr _h_XpPhiLight, _h_XpPhiCharm, _h_XpPhiBottom;
668
669    Histo1DPtr _temp_XpChargedN1, _temp_XpChargedN2, _temp_XpChargedN3;
670    Histo1DPtr _temp_XpKPlusCharm , _temp_XpKPlusLight;
671    Histo1DPtr _temp_XpKStar0Charm, _temp_XpKStar0Light;
672    Histo1DPtr _temp_XpProtonCharm, _temp_XpProtonLight;
673
674    Histo1DPtr _h_RPiPlus, _h_RPiMinus;
675    Histo1DPtr _h_RKS0, _h_RKSBar0;
676    Histo1DPtr _h_RKPlus, _h_RKMinus;
677    Histo1DPtr _h_RProton, _h_RPBar;
678    Histo1DPtr _h_RLambda, _h_RLBar;
679
680    Estimate1DPtr _s_Xp_PiPl_Ch, _s_Xp_KPl_Ch,  _s_Xp_Pr_Ch;
681    Estimate1DPtr _s_Xp_PiPlCh_PiPlLi, _s_Xp_PiPlBo_PiPlLi;
682    Estimate1DPtr _s_Xp_KPlCh_KPlLi, _s_Xp_KPlBo_KPlLi;
683    Estimate1DPtr _s_Xp_KS0Ch_KS0Li, _s_Xp_KS0Bo_KS0Li;
684    Estimate1DPtr _s_Xp_PrCh_PrLi, _s_Xp_PrBo_PrLi;
685    Estimate1DPtr _s_Xp_LaCh_LaLi, _s_Xp_LaBo_LaLi;
686    Estimate1DPtr _s_Xp_K0Ch_K0Li, _s_Xp_K0Bo_K0Li;
687    Estimate1DPtr _s_Xp_PhiCh_PhiLi, _s_Xp_PhiBo_PhiLi;
688
689    Estimate1DPtr _s_PiM_PiP, _s_KSBar0_KS0, _s_KM_KP, _s_Pr_PBar, _s_Lam_LBar;
690
691    /// @}
692      Estimate1DPtr tmp1;
693      Estimate1DPtr tmp2;
694      Estimate1DPtr tmp3;
695      Estimate1DPtr tmp4;
696      Estimate1DPtr tmp5;
697      Estimate1DPtr tmp6;
698      Estimate1DPtr tmp7;
699      Estimate1DPtr tmp8;
700      Estimate1DPtr tmp9;
701      Estimate1DPtr tmp10;
702      Estimate1DPtr tmp11;
703      Estimate1DPtr tmp12;
704      Estimate1DPtr tmp13;
705      Estimate1DPtr tmp14;
706      Estimate1DPtr tmp15;
707      Estimate1DPtr tmp16;
708      Estimate1DPtr tmp17;
709      Estimate1DPtr tmp18;
710      Estimate1DPtr tmp19;
711      Estimate1DPtr tmp20;
712      Estimate1DPtr tmp21;
713      Estimate1DPtr tmp22;
714      Estimate1DPtr tmp23;
715      Estimate1DPtr tmp24;
716      Estimate1DPtr tmp25;
717      Estimate1DPtr tmp26;
718      Estimate1DPtr tmp27;
719      Estimate1DPtr tmp28;
720      Estimate1DPtr tmp29;
721      Estimate1DPtr tmp30;
722      Estimate1DPtr tmp31;
723      Estimate1DPtr tmp32;
724      Estimate1DPtr tmp33;
725      Estimate1DPtr tmp34;
726      Estimate1DPtr tmp35;
727      Estimate1DPtr tmp36;
728      Estimate1DPtr tmp37;
729      Estimate1DPtr tmp38;
730      Estimate1DPtr tmp39;
731      Estimate1DPtr tmp40;
732      Estimate1DPtr tmp41;
733      Estimate1DPtr tmp42;
734  };
735
736
737
738  RIVET_DECLARE_ALIASED_PLUGIN(SLD_1999_I469925, SLD_1999_S3743934);
739
740}