Rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

SLD_1999_S3743934

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_S3743934.cc
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/Beam.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Projections/UnstableFinalState.hh"
#include "Rivet/Projections/ChargedFinalState.hh"
#include "Rivet/Projections/InitialQuarks.hh"
#include "Rivet/Projections/Thrust.hh"

namespace Rivet {


  /// @brief SLD flavour-dependent fragmentation paper
  /// @author Peter Richardson
  class SLD_1999_S3743934 : public Analysis {
  public:

    /// Constructor
    SLD_1999_S3743934()
      : Analysis("SLD_1999_S3743934"),
        _SumOfudsWeights(0.), _SumOfcWeights(0.),
        _SumOfbWeights(0.),
        _multPiPlus(4,0.),_multKPlus(4,0.),_multK0(4,0.),
        _multKStar0(4,0.),_multPhi(4,0.),
        _multProton(4,0.),_multLambda(4,0.)
    {    }


    /// @name Analysis methods
    //@{

    void analyze(const Event& e) {
      // First, veto on leptonic events by requiring at least 4 charged FS particles
      const FinalState& fs = apply<FinalState>(e, "FS");
      const size_t numParticles = fs.particles().size();

      // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
      if (numParticles < 2) {
        MSG_DEBUG("Failed ncharged cut");
        vetoEvent;
      }
      MSG_DEBUG("Passed ncharged cut");
      // Get event weight for histo filling
      const double weight = e.weight();

      // Get beams and average beam momentum
      const ParticlePair& beams = apply<Beam>(e, "Beams").beams();
      const double meanBeamMom = ( beams.first.p3().mod() +
                                   beams.second.p3().mod() ) / 2.0;
      MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
      int flavour = 0;
      const InitialQuarks& iqf = apply<InitialQuarks>(e, "IQF");

      // If we only have two quarks (qqbar), just take the flavour.
      // If we have more than two quarks, look for the highest energetic q-qbar pair.
      /// @todo Can we make this based on hadron flavour instead?
      Particles quarks;
      if (iqf.particles().size() == 2) {
        flavour = iqf.particles().front().abspid();
        quarks = iqf.particles();
      } else {
        map<int, Particle > quarkmap;
        foreach (const Particle& p, iqf.particles()) {
          if (quarkmap.find(p.pid()) == quarkmap.end()) quarkmap[p.pid()] = p;
          else if (quarkmap[p.pid()].E() < p.E()) quarkmap[p.pid()] = p;
        }
        double maxenergy = 0.;
        for (int i = 1; i <= 5; ++i) {
          double energy(0.);
          if (quarkmap.find( i) != quarkmap.end())
            energy += quarkmap[ i].E();
          if (quarkmap.find(-i) != quarkmap.end())
            energy += quarkmap[-i].E();
          if (energy > maxenergy)
            flavour = i;
        }
        if (quarkmap.find(flavour) != quarkmap.end())
          quarks.push_back(quarkmap[flavour]);
        if (quarkmap.find(-flavour) != quarkmap.end())
          quarks.push_back(quarkmap[-flavour]);
      }
      switch (flavour) {
      case PID::DQUARK:
      case PID::UQUARK:
      case PID::SQUARK:
        _SumOfudsWeights += weight;
        break;
      case PID::CQUARK:
        _SumOfcWeights += weight;
        break;
      case PID::BQUARK:
        _SumOfbWeights += weight;
        break;
      }
      // thrust axis for projections
      Vector3 axis = apply<Thrust>(e, "Thrust").thrustAxis();
      double dot(0.);
      if (!quarks.empty()) {
        dot = quarks[0].p3().dot(axis);
        if (quarks[0].pid() < 0) dot *= -1;
      }

      foreach (const Particle& p, fs.particles()) {
        const double xp = p.p3().mod()/meanBeamMom;
        // if in quark or antiquark hemisphere
        bool quark = p.p3().dot(axis)*dot > 0.;
        _h_XpChargedN->fill(xp, weight);
        _temp_XpChargedN1->fill(xp, weight);
        _temp_XpChargedN2->fill(xp, weight);
        _temp_XpChargedN3->fill(xp, weight);
        int id = p.abspid();
        // charged pions
        if (id == PID::PIPLUS) {
          _h_XpPiPlusN->fill(xp, weight);
          _multPiPlus[0] += weight;
          switch (flavour) {
          case PID::DQUARK:
          case PID::UQUARK:
          case PID::SQUARK:
            _multPiPlus[1] += weight;
            _h_XpPiPlusLight->fill(xp, weight);
            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
              _h_RPiPlus->fill(xp, weight);
            else
              _h_RPiMinus->fill(xp, weight);
            break;
          case PID::CQUARK:
            _multPiPlus[2] += weight;
            _h_XpPiPlusCharm->fill(xp, weight);
            break;
          case PID::BQUARK:
            _multPiPlus[3] += weight;
            _h_XpPiPlusBottom->fill(xp, weight);
            break;
          }
        }
        else if (id == PID::KPLUS) {
          _h_XpKPlusN->fill(xp, weight);
          _multKPlus[0] += weight;
          switch (flavour) {
          case PID::DQUARK:
          case PID::UQUARK:
          case PID::SQUARK:
            _multKPlus[1] += weight;
            _temp_XpKPlusLight->fill(xp, weight);
            _h_XpKPlusLight->fill(xp, weight);
            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
              _h_RKPlus->fill(xp, weight);
            else
              _h_RKMinus->fill(xp, weight);
            break;
         break;
          case PID::CQUARK:
            _multKPlus[2] += weight;
            _h_XpKPlusCharm->fill(xp, weight);
            _temp_XpKPlusCharm->fill(xp, weight);
            break;
          case PID::BQUARK:
            _multKPlus[3] += weight;
            _h_XpKPlusBottom->fill(xp, weight);
            break;
          }
        }
        else if (id == PID::PROTON) {
          _h_XpProtonN->fill(xp, weight);
          _multProton[0] += weight;
          switch (flavour) {
          case PID::DQUARK:
          case PID::UQUARK:
          case PID::SQUARK:
            _multProton[1] += weight;
            _temp_XpProtonLight->fill(xp, weight);
            _h_XpProtonLight->fill(xp, weight);
            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
              _h_RProton->fill(xp, weight);
            else
              _h_RPBar  ->fill(xp, weight);
            break;
         break;
          case PID::CQUARK:
            _multProton[2] += weight;
            _temp_XpProtonCharm->fill(xp, weight);
            _h_XpProtonCharm->fill(xp, weight);
            break;
          case PID::BQUARK:
            _multProton[3] += weight;
            _h_XpProtonBottom->fill(xp, weight);
            break;
          }
        }
      }

      const UnstableFinalState& ufs = apply<UnstableFinalState>(e, "UFS");
      foreach (const Particle& p, ufs.particles()) {
        const double xp = p.p3().mod()/meanBeamMom;
        // if in quark or antiquark hemisphere
        bool quark = p.p3().dot(axis)*dot>0.;
        int id = p.abspid();
        if (id == PID::LAMBDA) {
          _multLambda[0] += weight;
          _h_XpLambdaN->fill(xp, weight);
          switch (flavour) {
          case PID::DQUARK:
          case PID::UQUARK:
          case PID::SQUARK:
            _multLambda[1] += weight;
            _h_XpLambdaLight->fill(xp, weight);
            if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
              _h_RLambda->fill(xp, weight);
            else
              _h_RLBar  ->fill(xp, weight);
            break;
          case PID::CQUARK:
            _multLambda[2] += weight;
            _h_XpLambdaCharm->fill(xp, weight);
            break;
          case PID::BQUARK:
            _multLambda[3] += weight;
            _h_XpLambdaBottom->fill(xp, weight);
            break;
          }
        }
        else if (id == 313) {
          _multKStar0[0] += weight;
          _h_XpKStar0N->fill(xp, weight);
          switch (flavour) {
          case PID::DQUARK:
          case PID::UQUARK:
          case PID::SQUARK:
            _multKStar0[1] += weight;
            _temp_XpKStar0Light->fill(xp, weight);
            _h_XpKStar0Light->fill(xp, weight);
            if ( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
              _h_RKS0   ->fill(xp, weight);
            else
              _h_RKSBar0->fill(xp, weight);
            break;
            break;
          case PID::CQUARK:
            _multKStar0[2] += weight;
            _temp_XpKStar0Charm->fill(xp, weight);
            _h_XpKStar0Charm->fill(xp, weight);
            break;
          case PID::BQUARK:
            _multKStar0[3] += weight;
            _h_XpKStar0Bottom->fill(xp, weight);
            break;
          }
        }
        else if (id == 333) {
          _multPhi[0] += weight;
          _h_XpPhiN->fill(xp, weight);
          switch (flavour) {
          case PID::DQUARK:
          case PID::UQUARK:
          case PID::SQUARK:
            _multPhi[1] += weight;
            _h_XpPhiLight->fill(xp, weight);
            break;
          case PID::CQUARK:
            _multPhi[2] += weight;
            _h_XpPhiCharm->fill(xp, weight);
            break;
          case PID::BQUARK:
            _multPhi[3] += weight;
            _h_XpPhiBottom->fill(xp, weight);
            break;
          }
        }
        else if (id == PID::K0S || id == PID::K0L) {
          _multK0[0] += weight;
          _h_XpK0N->fill(xp, weight);
          switch (flavour) {
          case PID::DQUARK:
          case PID::UQUARK:
          case PID::SQUARK:
            _multK0[1] += weight;
            _h_XpK0Light->fill(xp, weight);
            break;
          case PID::CQUARK:
            _multK0[2] += weight;
            _h_XpK0Charm->fill(xp, weight);
            break;
          case PID::BQUARK:
            _multK0[3] += weight;
            _h_XpK0Bottom->fill(xp, weight);
            break;
          }
        }
      }
    }


    void init() {
      // Projections
      declare(Beam(), "Beams");
      declare(ChargedFinalState(), "FS");
      declare(UnstableFinalState(), "UFS");
      declare(InitialQuarks(), "IQF");
      declare(Thrust(FinalState()), "Thrust");

      _temp_XpChargedN1 = bookHisto1D("TMP/XpChargedN1", refData( 1, 1, 1));
      _temp_XpChargedN2 = bookHisto1D("TMP/XpChargedN2", refData( 2, 1, 1));
      _temp_XpChargedN3 = bookHisto1D("TMP/XpChargedN3", refData( 3, 1, 1));

      _h_XpPiPlusN      = bookHisto1D( 1, 1, 2);
      _h_XpKPlusN       = bookHisto1D( 2, 1, 2);
      _h_XpProtonN      = bookHisto1D( 3, 1, 2);
      _h_XpChargedN     = bookHisto1D( 4, 1, 1);
      _h_XpK0N          = bookHisto1D( 5, 1, 1);
      _h_XpLambdaN      = bookHisto1D( 7, 1, 1);
      _h_XpKStar0N      = bookHisto1D( 8, 1, 1);
      _h_XpPhiN         = bookHisto1D( 9, 1, 1);

      _h_XpPiPlusLight  = bookHisto1D(10, 1, 1);
      _h_XpPiPlusCharm  = bookHisto1D(10, 1, 2);
      _h_XpPiPlusBottom = bookHisto1D(10, 1, 3);
      _h_XpKPlusLight   = bookHisto1D(12, 1, 1);
      _h_XpKPlusCharm   = bookHisto1D(12, 1, 2);
      _h_XpKPlusBottom  = bookHisto1D(12, 1, 3);
      _h_XpKStar0Light  = bookHisto1D(14, 1, 1);
      _h_XpKStar0Charm  = bookHisto1D(14, 1, 2);
      _h_XpKStar0Bottom = bookHisto1D(14, 1, 3);
      _h_XpProtonLight  = bookHisto1D(16, 1, 1);
      _h_XpProtonCharm  = bookHisto1D(16, 1, 2);
      _h_XpProtonBottom = bookHisto1D(16, 1, 3);
      _h_XpLambdaLight  = bookHisto1D(18, 1, 1);
      _h_XpLambdaCharm  = bookHisto1D(18, 1, 2);
      _h_XpLambdaBottom = bookHisto1D(18, 1, 3);
      _h_XpK0Light      = bookHisto1D(20, 1, 1);
      _h_XpK0Charm      = bookHisto1D(20, 1, 2);
      _h_XpK0Bottom     = bookHisto1D(20, 1, 3);
      _h_XpPhiLight     = bookHisto1D(22, 1, 1);
      _h_XpPhiCharm     = bookHisto1D(22, 1, 2);
      _h_XpPhiBottom    = bookHisto1D(22, 1, 3);

      _temp_XpKPlusCharm   = bookHisto1D("TMP/XpKPlusCharm", refData(13, 1, 1));
      _temp_XpKPlusLight   = bookHisto1D("TMP/XpKPlusLight", refData(13, 1, 1));
      _temp_XpKStar0Charm  = bookHisto1D("TMP/XpKStar0Charm", refData(15, 1, 1));
      _temp_XpKStar0Light  = bookHisto1D("TMP/XpKStar0Light", refData(15, 1, 1));
      _temp_XpProtonCharm  = bookHisto1D("TMP/XpProtonCharm", refData(17, 1, 1));
      _temp_XpProtonLight  = bookHisto1D("TMP/XpProtonLight", refData(17, 1, 1));

      _h_RPiPlus  = bookHisto1D( 26, 1, 1);
      _h_RPiMinus = bookHisto1D( 26, 1, 2);
      _h_RKS0     = bookHisto1D( 28, 1, 1);
      _h_RKSBar0  = bookHisto1D( 28, 1, 2);
      _h_RKPlus   = bookHisto1D( 30, 1, 1);
      _h_RKMinus  = bookHisto1D( 30, 1, 2);
      _h_RProton  = bookHisto1D( 32, 1, 1);
      _h_RPBar    = bookHisto1D( 32, 1, 2);
      _h_RLambda  = bookHisto1D( 34, 1, 1);
      _h_RLBar    = bookHisto1D( 34, 1, 2);

      _s_Xp_PiPl_Ch        = bookScatter2D(1, 1, 1);
      _s_Xp_KPl_Ch         = bookScatter2D(2, 1, 1);
      _s_Xp_Pr_Ch          = bookScatter2D(3, 1, 1);
      _s_Xp_PiPlCh_PiPlLi  = bookScatter2D(11, 1, 1);
      _s_Xp_PiPlBo_PiPlLi  = bookScatter2D(11, 1, 2);
      _s_Xp_KPlCh_KPlLi    = bookScatter2D(13, 1, 1);
      _s_Xp_KPlBo_KPlLi    = bookScatter2D(13, 1, 2);
      _s_Xp_KS0Ch_KS0Li    = bookScatter2D(15, 1, 1);
      _s_Xp_KS0Bo_KS0Li    = bookScatter2D(15, 1, 2);
      _s_Xp_PrCh_PrLi      = bookScatter2D(17, 1, 1);
      _s_Xp_PrBo_PrLi      = bookScatter2D(17, 1, 2);
      _s_Xp_LaCh_LaLi      = bookScatter2D(19, 1, 1);
      _s_Xp_LaBo_LaLi      = bookScatter2D(19, 1, 2);
      _s_Xp_K0Ch_K0Li      = bookScatter2D(21, 1, 1);
      _s_Xp_K0Bo_K0Li      = bookScatter2D(21, 1, 2);
      _s_Xp_PhiCh_PhiLi    = bookScatter2D(23, 1, 1);
      _s_Xp_PhiBo_PhiLi    = bookScatter2D(23, 1, 2);

      _s_PiM_PiP    = bookScatter2D(27, 1, 1);
      _s_KSBar0_KS0 = bookScatter2D(29, 1, 1);
      _s_KM_KP      = bookScatter2D(31, 1, 1);
      _s_Pr_PBar    = bookScatter2D(33, 1, 1);
      _s_Lam_LBar   = bookScatter2D(35, 1, 1);
    }


    /// Finalize
    void finalize() {
      // Get the ratio plots sorted out first
      divide(_h_XpPiPlusN, _temp_XpChargedN1, _s_Xp_PiPl_Ch);
      divide(_h_XpKPlusN, _temp_XpChargedN2, _s_Xp_KPl_Ch);
      divide(_h_XpProtonN, _temp_XpChargedN3, _s_Xp_Pr_Ch);
      divide(_h_XpPiPlusCharm, _h_XpPiPlusLight, _s_Xp_PiPlCh_PiPlLi);
      _s_Xp_PiPlCh_PiPlLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
      divide(_h_XpPiPlusBottom, _h_XpPiPlusLight, _s_Xp_PiPlBo_PiPlLi);
       _s_Xp_PiPlBo_PiPlLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
      divide(_temp_XpKPlusCharm , _temp_XpKPlusLight, _s_Xp_KPlCh_KPlLi);
      _s_Xp_KPlCh_KPlLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
      divide(_h_XpKPlusBottom, _h_XpKPlusLight, _s_Xp_KPlBo_KPlLi);
       _s_Xp_KPlBo_KPlLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
      divide(_temp_XpKStar0Charm, _temp_XpKStar0Light, _s_Xp_KS0Ch_KS0Li);
      _s_Xp_KS0Ch_KS0Li->scale(1.,_SumOfudsWeights/_SumOfcWeights);
      divide(_h_XpKStar0Bottom, _h_XpKStar0Light, _s_Xp_KS0Bo_KS0Li);
      _s_Xp_KS0Bo_KS0Li->scale(1.,_SumOfudsWeights/_SumOfbWeights);
      divide(_temp_XpProtonCharm, _temp_XpProtonLight, _s_Xp_PrCh_PrLi);
      _s_Xp_PrCh_PrLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
      divide(_h_XpProtonBottom, _h_XpProtonLight, _s_Xp_PrBo_PrLi);
      _s_Xp_PrBo_PrLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
      divide(_h_XpLambdaCharm, _h_XpLambdaLight, _s_Xp_LaCh_LaLi);
      _s_Xp_LaCh_LaLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
      divide(_h_XpLambdaBottom, _h_XpLambdaLight, _s_Xp_LaBo_LaLi);
      _s_Xp_LaBo_LaLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
      divide(_h_XpK0Charm, _h_XpK0Light, _s_Xp_K0Ch_K0Li);
      _s_Xp_K0Ch_K0Li->scale(1.,_SumOfudsWeights/_SumOfcWeights);
      divide(_h_XpK0Bottom, _h_XpK0Light, _s_Xp_K0Bo_K0Li);
      _s_Xp_K0Bo_K0Li->scale(1.,_SumOfudsWeights/_SumOfbWeights);
      divide(_h_XpPhiCharm, _h_XpPhiLight, _s_Xp_PhiCh_PhiLi);
      _s_Xp_PhiCh_PhiLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
      divide(_h_XpPhiBottom, _h_XpPhiLight, _s_Xp_PhiBo_PhiLi);
      _s_Xp_PhiBo_PhiLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);

      // Then the leading particles
      divide(*_h_RPiMinus - *_h_RPiPlus, *_h_RPiMinus + *_h_RPiPlus, _s_PiM_PiP);
      divide(*_h_RKSBar0 - *_h_RKS0, *_h_RKSBar0 + *_h_RKS0, _s_KSBar0_KS0);
      divide(*_h_RKMinus - *_h_RKPlus, *_h_RKMinus + *_h_RKPlus, _s_KM_KP);
      divide(*_h_RProton - *_h_RPBar, *_h_RProton + *_h_RPBar, _s_Pr_PBar);
      divide(*_h_RLambda - *_h_RLBar, *_h_RLambda + *_h_RLBar, _s_Lam_LBar);

      // Then the rest
      scale(_h_XpPiPlusN,      1/sumOfWeights());
      scale(_h_XpKPlusN,       1/sumOfWeights());
      scale(_h_XpProtonN,      1/sumOfWeights());
      scale(_h_XpChargedN,     1/sumOfWeights());
      scale(_h_XpK0N,          1/sumOfWeights());
      scale(_h_XpLambdaN,      1/sumOfWeights());
      scale(_h_XpKStar0N,      1/sumOfWeights());
      scale(_h_XpPhiN,         1/sumOfWeights());
      scale(_h_XpPiPlusLight,  1/_SumOfudsWeights);
      scale(_h_XpPiPlusCharm,  1/_SumOfcWeights);
      scale(_h_XpPiPlusBottom, 1/_SumOfbWeights);
      scale(_h_XpKPlusLight,   1/_SumOfudsWeights);
      scale(_h_XpKPlusCharm,   1/_SumOfcWeights);
      scale(_h_XpKPlusBottom,  1/_SumOfbWeights);
      scale(_h_XpKStar0Light,  1/_SumOfudsWeights);
      scale(_h_XpKStar0Charm,  1/_SumOfcWeights);
      scale(_h_XpKStar0Bottom, 1/_SumOfbWeights);
      scale(_h_XpProtonLight,  1/_SumOfudsWeights);
      scale(_h_XpProtonCharm,  1/_SumOfcWeights);
      scale(_h_XpProtonBottom, 1/_SumOfbWeights);
      scale(_h_XpLambdaLight,  1/_SumOfudsWeights);
      scale(_h_XpLambdaCharm,  1/_SumOfcWeights);
      scale(_h_XpLambdaBottom, 1/_SumOfbWeights);
      scale(_h_XpK0Light,      1/_SumOfudsWeights);
      scale(_h_XpK0Charm,      1/_SumOfcWeights);
      scale(_h_XpK0Bottom,     1/_SumOfbWeights);
      scale(_h_XpPhiLight,     1/_SumOfudsWeights);
      scale(_h_XpPhiCharm ,    1/_SumOfcWeights);
      scale(_h_XpPhiBottom,    1/_SumOfbWeights);
      scale(_h_RPiPlus,        1/_SumOfudsWeights);
      scale(_h_RPiMinus,       1/_SumOfudsWeights);
      scale(_h_RKS0,           1/_SumOfudsWeights);
      scale(_h_RKSBar0,        1/_SumOfudsWeights);
      scale(_h_RKPlus,         1/_SumOfudsWeights);
      scale(_h_RKMinus,        1/_SumOfudsWeights);
      scale(_h_RProton,        1/_SumOfudsWeights);
      scale(_h_RPBar,          1/_SumOfudsWeights);
      scale(_h_RLambda,        1/_SumOfudsWeights);
      scale(_h_RLBar,          1/_SumOfudsWeights);

      // Multiplicities
      double avgNumPartsAll, avgNumPartsLight,avgNumPartsCharm, avgNumPartsBottom;
      // pi+/-
      // all
      avgNumPartsAll = _multPiPlus[0]/sumOfWeights();
      bookScatter2D(24, 1, 1, true)->point(0).setY(avgNumPartsAll);
      // light
      avgNumPartsLight = _multPiPlus[1]/_SumOfudsWeights;
      bookScatter2D(24, 1, 2, true)->point(0).setY(avgNumPartsLight);
      // charm
      avgNumPartsCharm = _multPiPlus[2]/_SumOfcWeights;
      bookScatter2D(24, 1, 3, true)->point(0).setY(avgNumPartsCharm);
      // bottom
      avgNumPartsBottom = _multPiPlus[3]/_SumOfbWeights;
      bookScatter2D(24, 1, 4, true)->point(0).setY(avgNumPartsBottom);
      // charm-light
      bookScatter2D(25, 1, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
      // bottom-light
      bookScatter2D(25, 1, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
      // K+/-
      // all
      avgNumPartsAll = _multKPlus[0]/sumOfWeights();
      bookScatter2D(24, 2, 1, true)->point(0).setY(avgNumPartsAll);
      // light
      avgNumPartsLight = _multKPlus[1]/_SumOfudsWeights;
      bookScatter2D(24, 2, 2, true)->point(0).setY(avgNumPartsLight);
      // charm
      avgNumPartsCharm = _multKPlus[2]/_SumOfcWeights;
      bookScatter2D(24, 2, 3, true)->point(0).setY(avgNumPartsCharm);
      // bottom
      avgNumPartsBottom = _multKPlus[3]/_SumOfbWeights;
      bookScatter2D(24, 2, 4, true)->point(0).setY(avgNumPartsBottom);
      // charm-light
      bookScatter2D(25, 2, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
      // bottom-light
      bookScatter2D(25, 2, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
      // K0
      // all
      avgNumPartsAll = _multK0[0]/sumOfWeights();
      bookScatter2D(24, 3, 1, true)->point(0).setY(avgNumPartsAll);
      // light
      avgNumPartsLight = _multK0[1]/_SumOfudsWeights;
      bookScatter2D(24, 3, 2, true)->point(0).setY(avgNumPartsLight);
      // charm
      avgNumPartsCharm = _multK0[2]/_SumOfcWeights;
      bookScatter2D(24, 3, 3, true)->point(0).setY(avgNumPartsCharm);
      // bottom
      avgNumPartsBottom = _multK0[3]/_SumOfbWeights;
      bookScatter2D(24, 3, 4, true)->point(0).setY(avgNumPartsBottom);
      // charm-light
      bookScatter2D(25, 3, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
      // bottom-light
      bookScatter2D(25, 3, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
      // K*0
      // all
      avgNumPartsAll = _multKStar0[0]/sumOfWeights();
      bookScatter2D(24, 4, 1, true)->point(0).setY(avgNumPartsAll);
      // light
      avgNumPartsLight = _multKStar0[1]/_SumOfudsWeights;
      bookScatter2D(24, 4, 2, true)->point(0).setY(avgNumPartsLight);
      // charm
      avgNumPartsCharm = _multKStar0[2]/_SumOfcWeights;
      bookScatter2D(24, 4, 3, true)->point(0).setY(avgNumPartsCharm);
      // bottom
      avgNumPartsBottom = _multKStar0[3]/_SumOfbWeights;
      bookScatter2D(24, 4, 4, true)->point(0).setY(avgNumPartsBottom);
      // charm-light
      bookScatter2D(25, 4, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
      // bottom-light
      bookScatter2D(25, 4, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
      // phi
      // all
      avgNumPartsAll = _multPhi[0]/sumOfWeights();
      bookScatter2D(24, 5, 1, true)->point(0).setY(avgNumPartsAll);
      // light
      avgNumPartsLight = _multPhi[1]/_SumOfudsWeights;
      bookScatter2D(24, 5, 2, true)->point(0).setY(avgNumPartsLight);
      // charm
      avgNumPartsCharm = _multPhi[2]/_SumOfcWeights;
      bookScatter2D(24, 5, 3, true)->point(0).setY(avgNumPartsCharm);
      // bottom
      avgNumPartsBottom = _multPhi[3]/_SumOfbWeights;
      bookScatter2D(24, 5, 4, true)->point(0).setY(avgNumPartsBottom);
      // charm-light
      bookScatter2D(25, 5, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
      // bottom-light
      bookScatter2D(25, 5, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
      // p
      // all
      avgNumPartsAll = _multProton[0]/sumOfWeights();
      bookScatter2D(24, 6, 1, true)->point(0).setY(avgNumPartsAll);
      // light
      avgNumPartsLight = _multProton[1]/_SumOfudsWeights;
      bookScatter2D(24, 6, 2, true)->point(0).setY(avgNumPartsLight);
      // charm
      avgNumPartsCharm = _multProton[2]/_SumOfcWeights;
      bookScatter2D(24, 6, 3, true)->point(0).setY(avgNumPartsCharm);
      // bottom
      avgNumPartsBottom = _multProton[3]/_SumOfbWeights;
      bookScatter2D(24, 6, 4, true)->point(0).setY(avgNumPartsBottom);
      // charm-light
      bookScatter2D(25, 6, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
      // bottom-light
      bookScatter2D(25, 6, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
      // Lambda
      // all
      avgNumPartsAll = _multLambda[0]/sumOfWeights();
      bookScatter2D(24, 7, 1, true)->point(0).setY(avgNumPartsAll);
      // light
      avgNumPartsLight = _multLambda[1]/_SumOfudsWeights;
      bookScatter2D(24, 7, 2, true)->point(0).setY(avgNumPartsLight);
      // charm
      avgNumPartsCharm = _multLambda[2]/_SumOfcWeights;
      bookScatter2D(24, 7, 3, true)->point(0).setY(avgNumPartsCharm);
      // bottom
      avgNumPartsBottom = _multLambda[3]/_SumOfbWeights;
      bookScatter2D(24, 7, 4, true)->point(0).setY(avgNumPartsBottom);
      // charm-light
      bookScatter2D(25, 7, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
      // bottom-light
      bookScatter2D(25, 7, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
    }

    //@}


  private:

    /// Store the weighted sums of numbers of charged / charged+neutral
    /// particles. Used to calculate average number of particles for the
    /// inclusive single particle distributions' normalisations.
    double _SumOfudsWeights, _SumOfcWeights, _SumOfbWeights;
    vector<double> _multPiPlus, _multKPlus, _multK0,
      _multKStar0, _multPhi, _multProton, _multLambda;

    Histo1DPtr _h_XpPiPlusSig, _h_XpPiPlusN;
    Histo1DPtr _h_XpKPlusSig, _h_XpKPlusN;
    Histo1DPtr _h_XpProtonSig, _h_XpProtonN;
    Histo1DPtr _h_XpChargedN;
    Histo1DPtr _h_XpK0N, _h_XpLambdaN;
    Histo1DPtr _h_XpKStar0N, _h_XpPhiN;
    Histo1DPtr _h_XpPiPlusLight, _h_XpPiPlusCharm, _h_XpPiPlusBottom;
    Histo1DPtr _h_XpKPlusLight, _h_XpKPlusCharm, _h_XpKPlusBottom;
    Histo1DPtr _h_XpKStar0Light, _h_XpKStar0Charm, _h_XpKStar0Bottom;
    Histo1DPtr _h_XpProtonLight, _h_XpProtonCharm, _h_XpProtonBottom;
    Histo1DPtr _h_XpLambdaLight, _h_XpLambdaCharm, _h_XpLambdaBottom;
    Histo1DPtr _h_XpK0Light, _h_XpK0Charm, _h_XpK0Bottom;
    Histo1DPtr _h_XpPhiLight, _h_XpPhiCharm, _h_XpPhiBottom;

    Histo1DPtr _temp_XpChargedN1, _temp_XpChargedN2, _temp_XpChargedN3;
    Histo1DPtr _temp_XpKPlusCharm , _temp_XpKPlusLight;
    Histo1DPtr _temp_XpKStar0Charm, _temp_XpKStar0Light;
    Histo1DPtr _temp_XpProtonCharm, _temp_XpProtonLight;

    Histo1DPtr _h_RPiPlus, _h_RPiMinus;
    Histo1DPtr _h_RKS0, _h_RKSBar0;
    Histo1DPtr _h_RKPlus, _h_RKMinus;
    Histo1DPtr _h_RProton, _h_RPBar;
    Histo1DPtr _h_RLambda, _h_RLBar;

    Scatter2DPtr _s_Xp_PiPl_Ch, _s_Xp_KPl_Ch,  _s_Xp_Pr_Ch;
    Scatter2DPtr _s_Xp_PiPlCh_PiPlLi, _s_Xp_PiPlBo_PiPlLi;
    Scatter2DPtr _s_Xp_KPlCh_KPlLi, _s_Xp_KPlBo_KPlLi;
    Scatter2DPtr _s_Xp_KS0Ch_KS0Li, _s_Xp_KS0Bo_KS0Li;
    Scatter2DPtr _s_Xp_PrCh_PrLi, _s_Xp_PrBo_PrLi;
    Scatter2DPtr _s_Xp_LaCh_LaLi, _s_Xp_LaBo_LaLi;
    Scatter2DPtr _s_Xp_K0Ch_K0Li, _s_Xp_K0Bo_K0Li;
    Scatter2DPtr _s_Xp_PhiCh_PhiLi, _s_Xp_PhiBo_PhiLi;

    Scatter2DPtr _s_PiM_PiP, _s_KSBar0_KS0, _s_KM_KP, _s_Pr_PBar, _s_Lam_LBar;

    //@}

  };

  // The hook for the plugin system
  DECLARE_RIVET_PLUGIN(SLD_1999_S3743934);

}