rivet is hosted by Hepforge, IPPP Durham
SLD_1999_S3743934.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/Beam.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/UnstableFinalState.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 #include "Rivet/Projections/InitialQuarks.hh"
00008 #include "Rivet/Projections/Thrust.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// @brief SLD flavour-dependent fragmentation paper
00014   /// @author Peter Richardson
00015   class SLD_1999_S3743934 : public Analysis {
00016   public:
00017 
00018     /// Constructor
00019     SLD_1999_S3743934()
00020       : Analysis("SLD_1999_S3743934"),
00021         _SumOfudsWeights(0.), _SumOfcWeights(0.),
00022         _SumOfbWeights(0.),
00023         _multPiPlus(4,0.),_multKPlus(4,0.),_multK0(4,0.),
00024         _multKStar0(4,0.),_multPhi(4,0.),
00025         _multProton(4,0.),_multLambda(4,0.)
00026     {    }
00027 
00028 
00029     /// @name Analysis methods
00030     //@{
00031 
00032     void analyze(const Event& e) {
00033       // First, veto on leptonic events by requiring at least 4 charged FS particles
00034       const FinalState& fs = applyProjection<FinalState>(e, "FS");
00035       const size_t numParticles = fs.particles().size();
00036 
00037       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
00038       if (numParticles < 2) {
00039         MSG_DEBUG("Failed ncharged cut");
00040         vetoEvent;
00041       }
00042       MSG_DEBUG("Passed ncharged cut");
00043       // Get event weight for histo filling
00044       const double weight = e.weight();
00045 
00046       // Get beams and average beam momentum
00047       const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
00048       const double meanBeamMom = ( beams.first.p3().mod() +
00049                                    beams.second.p3().mod() ) / 2.0;
00050       MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
00051       int flavour = 0;
00052       const InitialQuarks& iqf = applyProjection<InitialQuarks>(e, "IQF");
00053 
00054       // If we only have two quarks (qqbar), just take the flavour.
00055       // If we have more than two quarks, look for the highest energetic q-qbar pair.
00056       /// @todo Can we make this based on hadron flavour instead?
00057       Particles quarks;
00058       if (iqf.particles().size() == 2) {
00059         flavour = iqf.particles().front().abspid();
00060         quarks = iqf.particles();
00061       } else {
00062         map<int, Particle > quarkmap;
00063         foreach (const Particle& p, iqf.particles()) {
00064           if (quarkmap.find(p.pid()) == quarkmap.end()) quarkmap[p.pid()] = p;
00065           else if (quarkmap[p.pid()].E() < p.E()) quarkmap[p.pid()] = p;
00066         }
00067         double maxenergy = 0.;
00068         for (int i = 1; i <= 5; ++i) {
00069           double energy(0.);
00070           if (quarkmap.find( i) != quarkmap.end())
00071             energy += quarkmap[ i].E();
00072           if (quarkmap.find(-i) != quarkmap.end())
00073             energy += quarkmap[-i].E();
00074           if (energy > maxenergy)
00075             flavour = i;
00076         }
00077         if (quarkmap.find(flavour) != quarkmap.end())
00078           quarks.push_back(quarkmap[flavour]);
00079         if (quarkmap.find(-flavour) != quarkmap.end())
00080           quarks.push_back(quarkmap[-flavour]);
00081       }
00082       switch (flavour) {
00083       case PID::DQUARK:
00084       case PID::UQUARK:
00085       case PID::SQUARK:
00086         _SumOfudsWeights += weight;
00087         break;
00088       case PID::CQUARK:
00089         _SumOfcWeights += weight;
00090         break;
00091       case PID::BQUARK:
00092         _SumOfbWeights += weight;
00093         break;
00094       }
00095       // thrust axis for projections
00096       Vector3 axis = applyProjection<Thrust>(e, "Thrust").thrustAxis();
00097       double dot(0.);
00098       if (!quarks.empty()) {
00099         dot = quarks[0].p3().dot(axis);
00100         if (quarks[0].pid() < 0) dot *= -1;
00101       }
00102 
00103       foreach (const Particle& p, fs.particles()) {
00104         const double xp = p.p3().mod()/meanBeamMom;
00105         // if in quark or antiquark hemisphere
00106         bool quark = p.p3().dot(axis)*dot > 0.;
00107         _h_XpChargedN->fill(xp, weight);
00108         _temp_XpChargedN1->fill(xp, weight);
00109         _temp_XpChargedN2->fill(xp, weight);
00110         _temp_XpChargedN3->fill(xp, weight);
00111         int id = p.abspid();
00112         // charged pions
00113         if (id == PID::PIPLUS) {
00114           _h_XpPiPlusN->fill(xp, weight);
00115           _multPiPlus[0] += weight;
00116           switch (flavour) {
00117           case PID::DQUARK:
00118           case PID::UQUARK:
00119           case PID::SQUARK:
00120             _multPiPlus[1] += weight;
00121             _h_XpPiPlusLight->fill(xp, weight);
00122             if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
00123               _h_RPiPlus->fill(xp, weight);
00124             else
00125               _h_RPiMinus->fill(xp, weight);
00126             break;
00127           case PID::CQUARK:
00128             _multPiPlus[2] += weight;
00129             _h_XpPiPlusCharm->fill(xp, weight);
00130             break;
00131           case PID::BQUARK:
00132             _multPiPlus[3] += weight;
00133             _h_XpPiPlusBottom->fill(xp, weight);
00134             break;
00135           }
00136         }
00137         else if (id == PID::KPLUS) {
00138           _h_XpKPlusN->fill(xp, weight);
00139           _multKPlus[0] += weight;
00140           switch (flavour) {
00141           case PID::DQUARK:
00142           case PID::UQUARK:
00143           case PID::SQUARK:
00144             _multKPlus[1] += weight;
00145             _temp_XpKPlusLight->fill(xp, weight);
00146             _h_XpKPlusLight->fill(xp, weight);
00147             if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
00148               _h_RKPlus->fill(xp, weight);
00149             else
00150               _h_RKMinus->fill(xp, weight);
00151             break;
00152          break;
00153           case PID::CQUARK:
00154             _multKPlus[2] += weight;
00155             _h_XpKPlusCharm->fill(xp, weight);
00156             _temp_XpKPlusCharm->fill(xp, weight);
00157             break;
00158           case PID::BQUARK:
00159             _multKPlus[3] += weight;
00160             _h_XpKPlusBottom->fill(xp, weight);
00161             break;
00162           }
00163         }
00164         else if (id == PID::PROTON) {
00165           _h_XpProtonN->fill(xp, weight);
00166           _multProton[0] += weight;
00167           switch (flavour) {
00168           case PID::DQUARK:
00169           case PID::UQUARK:
00170           case PID::SQUARK:
00171             _multProton[1] += weight;
00172             _temp_XpProtonLight->fill(xp, weight);
00173             _h_XpProtonLight->fill(xp, weight);
00174             if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
00175               _h_RProton->fill(xp, weight);
00176             else
00177               _h_RPBar  ->fill(xp, weight);
00178             break;
00179          break;
00180           case PID::CQUARK:
00181             _multProton[2] += weight;
00182             _temp_XpProtonCharm->fill(xp, weight);
00183             _h_XpProtonCharm->fill(xp, weight);
00184             break;
00185           case PID::BQUARK:
00186             _multProton[3] += weight;
00187             _h_XpProtonBottom->fill(xp, weight);
00188             break;
00189           }
00190         }
00191       }
00192 
00193       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00194       foreach (const Particle& p, ufs.particles()) {
00195         const double xp = p.p3().mod()/meanBeamMom;
00196         // if in quark or antiquark hemisphere
00197         bool quark = p.p3().dot(axis)*dot>0.;
00198         int id = p.abspid();
00199         if (id == PID::LAMBDA) {
00200           _multLambda[0] += weight;
00201           _h_XpLambdaN->fill(xp, weight);
00202           switch (flavour) {
00203           case PID::DQUARK:
00204           case PID::UQUARK:
00205           case PID::SQUARK:
00206             _multLambda[1] += weight;
00207             _h_XpLambdaLight->fill(xp, weight);
00208             if( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
00209               _h_RLambda->fill(xp, weight);
00210             else
00211               _h_RLBar  ->fill(xp, weight);
00212             break;
00213           case PID::CQUARK:
00214             _multLambda[2] += weight;
00215             _h_XpLambdaCharm->fill(xp, weight);
00216             break;
00217           case PID::BQUARK:
00218             _multLambda[3] += weight;
00219             _h_XpLambdaBottom->fill(xp, weight);
00220             break;
00221           }
00222         }
00223         else if (id == 313) {
00224           _multKStar0[0] += weight;
00225           _h_XpKStar0N->fill(xp, weight);
00226           switch (flavour) {
00227           case PID::DQUARK:
00228           case PID::UQUARK:
00229           case PID::SQUARK:
00230             _multKStar0[1] += weight;
00231             _temp_XpKStar0Light->fill(xp, weight);
00232             _h_XpKStar0Light->fill(xp, weight);
00233             if ( ( quark && p.pid()>0 ) || ( !quark && p.pid()<0 ))
00234               _h_RKS0   ->fill(xp, weight);
00235             else
00236               _h_RKSBar0->fill(xp, weight);
00237             break;
00238             break;
00239           case PID::CQUARK:
00240             _multKStar0[2] += weight;
00241             _temp_XpKStar0Charm->fill(xp, weight);
00242             _h_XpKStar0Charm->fill(xp, weight);
00243             break;
00244           case PID::BQUARK:
00245             _multKStar0[3] += weight;
00246             _h_XpKStar0Bottom->fill(xp, weight);
00247             break;
00248           }
00249         }
00250         else if (id == 333) {
00251           _multPhi[0] += weight;
00252           _h_XpPhiN->fill(xp, weight);
00253           switch (flavour) {
00254           case PID::DQUARK:
00255           case PID::UQUARK:
00256           case PID::SQUARK:
00257             _multPhi[1] += weight;
00258             _h_XpPhiLight->fill(xp, weight);
00259             break;
00260           case PID::CQUARK:
00261             _multPhi[2] += weight;
00262             _h_XpPhiCharm->fill(xp, weight);
00263             break;
00264           case PID::BQUARK:
00265             _multPhi[3] += weight;
00266             _h_XpPhiBottom->fill(xp, weight);
00267             break;
00268           }
00269         }
00270         else if (id == PID::K0S || id == PID::K0L) {
00271           _multK0[0] += weight;
00272           _h_XpK0N->fill(xp, weight);
00273           switch (flavour) {
00274           case PID::DQUARK:
00275           case PID::UQUARK:
00276           case PID::SQUARK:
00277             _multK0[1] += weight;
00278             _h_XpK0Light->fill(xp, weight);
00279             break;
00280           case PID::CQUARK:
00281             _multK0[2] += weight;
00282             _h_XpK0Charm->fill(xp, weight);
00283             break;
00284           case PID::BQUARK:
00285             _multK0[3] += weight;
00286             _h_XpK0Bottom->fill(xp, weight);
00287             break;
00288           }
00289         }
00290       }
00291     }
00292 
00293 
00294     void init() {
00295       // Projections
00296       addProjection(Beam(), "Beams");
00297       addProjection(ChargedFinalState(), "FS");
00298       addProjection(UnstableFinalState(), "UFS");
00299       addProjection(InitialQuarks(), "IQF");
00300       addProjection(Thrust(FinalState()), "Thrust");
00301 
00302       _temp_XpChargedN1 = bookHisto1D("TMP/XpChargedN1", refData( 1, 1, 1));
00303       _temp_XpChargedN2 = bookHisto1D("TMP/XpChargedN2", refData( 2, 1, 1));
00304       _temp_XpChargedN3 = bookHisto1D("TMP/XpChargedN3", refData( 3, 1, 1));
00305 
00306       _h_XpPiPlusN      = bookHisto1D( 1, 1, 2);
00307       _h_XpKPlusN       = bookHisto1D( 2, 1, 2);
00308       _h_XpProtonN      = bookHisto1D( 3, 1, 2);
00309       _h_XpChargedN     = bookHisto1D( 4, 1, 1);
00310       _h_XpK0N          = bookHisto1D( 5, 1, 1);
00311       _h_XpLambdaN      = bookHisto1D( 7, 1, 1);
00312       _h_XpKStar0N      = bookHisto1D( 8, 1, 1);
00313       _h_XpPhiN         = bookHisto1D( 9, 1, 1);
00314 
00315       _h_XpPiPlusLight  = bookHisto1D(10, 1, 1);
00316       _h_XpPiPlusCharm  = bookHisto1D(10, 1, 2);
00317       _h_XpPiPlusBottom = bookHisto1D(10, 1, 3);
00318       _h_XpKPlusLight   = bookHisto1D(12, 1, 1);
00319       _h_XpKPlusCharm   = bookHisto1D(12, 1, 2);
00320       _h_XpKPlusBottom  = bookHisto1D(12, 1, 3);
00321       _h_XpKStar0Light  = bookHisto1D(14, 1, 1);
00322       _h_XpKStar0Charm  = bookHisto1D(14, 1, 2);
00323       _h_XpKStar0Bottom = bookHisto1D(14, 1, 3);
00324       _h_XpProtonLight  = bookHisto1D(16, 1, 1);
00325       _h_XpProtonCharm  = bookHisto1D(16, 1, 2);
00326       _h_XpProtonBottom = bookHisto1D(16, 1, 3);
00327       _h_XpLambdaLight  = bookHisto1D(18, 1, 1);
00328       _h_XpLambdaCharm  = bookHisto1D(18, 1, 2);
00329       _h_XpLambdaBottom = bookHisto1D(18, 1, 3);
00330       _h_XpK0Light      = bookHisto1D(20, 1, 1);
00331       _h_XpK0Charm      = bookHisto1D(20, 1, 2);
00332       _h_XpK0Bottom     = bookHisto1D(20, 1, 3);
00333       _h_XpPhiLight     = bookHisto1D(22, 1, 1);
00334       _h_XpPhiCharm     = bookHisto1D(22, 1, 2);
00335       _h_XpPhiBottom    = bookHisto1D(22, 1, 3);
00336 
00337       _temp_XpKPlusCharm   = bookHisto1D("TMP/XpKPlusCharm", refData(13, 1, 1));
00338       _temp_XpKPlusLight   = bookHisto1D("TMP/XpKPlusLight", refData(13, 1, 1));
00339       _temp_XpKStar0Charm  = bookHisto1D("TMP/XpKStar0Charm", refData(15, 1, 1));
00340       _temp_XpKStar0Light  = bookHisto1D("TMP/XpKStar0Light", refData(15, 1, 1));
00341       _temp_XpProtonCharm  = bookHisto1D("TMP/XpProtonCharm", refData(17, 1, 1));
00342       _temp_XpProtonLight  = bookHisto1D("TMP/XpProtonLight", refData(17, 1, 1));
00343 
00344       _h_RPiPlus  = bookHisto1D( 26, 1, 1);
00345       _h_RPiMinus = bookHisto1D( 26, 1, 2);
00346       _h_RKS0     = bookHisto1D( 28, 1, 1);
00347       _h_RKSBar0  = bookHisto1D( 28, 1, 2);
00348       _h_RKPlus   = bookHisto1D( 30, 1, 1);
00349       _h_RKMinus  = bookHisto1D( 30, 1, 2);
00350       _h_RProton  = bookHisto1D( 32, 1, 1);
00351       _h_RPBar    = bookHisto1D( 32, 1, 2);
00352       _h_RLambda  = bookHisto1D( 34, 1, 1);
00353       _h_RLBar    = bookHisto1D( 34, 1, 2);
00354 
00355       _s_Xp_PiPl_Ch        = bookScatter2D(1, 1, 1);
00356       _s_Xp_KPl_Ch         = bookScatter2D(2, 1, 1);
00357       _s_Xp_Pr_Ch          = bookScatter2D(3, 1, 1);
00358       _s_Xp_PiPlCh_PiPlLi  = bookScatter2D(11, 1, 1);
00359       _s_Xp_PiPlBo_PiPlLi  = bookScatter2D(11, 1, 2);
00360       _s_Xp_KPlCh_KPlLi    = bookScatter2D(13, 1, 1);
00361       _s_Xp_KPlBo_KPlLi    = bookScatter2D(13, 1, 2);
00362       _s_Xp_KS0Ch_KS0Li    = bookScatter2D(15, 1, 1);
00363       _s_Xp_KS0Bo_KS0Li    = bookScatter2D(15, 1, 2);
00364       _s_Xp_PrCh_PrLi      = bookScatter2D(17, 1, 1);
00365       _s_Xp_PrBo_PrLi      = bookScatter2D(17, 1, 2);
00366       _s_Xp_LaCh_LaLi      = bookScatter2D(19, 1, 1);
00367       _s_Xp_LaBo_LaLi      = bookScatter2D(19, 1, 2);
00368       _s_Xp_K0Ch_K0Li      = bookScatter2D(21, 1, 1);
00369       _s_Xp_K0Bo_K0Li      = bookScatter2D(21, 1, 2);
00370       _s_Xp_PhiCh_PhiLi    = bookScatter2D(23, 1, 1);
00371       _s_Xp_PhiBo_PhiLi    = bookScatter2D(23, 1, 2);
00372 
00373       _s_PiM_PiP    = bookScatter2D(27, 1, 1);
00374       _s_KSBar0_KS0 = bookScatter2D(29, 1, 1);
00375       _s_KM_KP      = bookScatter2D(31, 1, 1);
00376       _s_Pr_PBar    = bookScatter2D(33, 1, 1);
00377       _s_Lam_LBar   = bookScatter2D(35, 1, 1);
00378     }
00379 
00380 
00381     /// Finalize
00382     void finalize() {
00383       // Get the ratio plots sorted out first
00384       divide(_h_XpPiPlusN, _temp_XpChargedN1, _s_Xp_PiPl_Ch);
00385       divide(_h_XpKPlusN, _temp_XpChargedN2, _s_Xp_KPl_Ch);
00386       divide(_h_XpProtonN, _temp_XpChargedN3, _s_Xp_Pr_Ch);
00387       divide(_h_XpPiPlusCharm, _h_XpPiPlusLight, _s_Xp_PiPlCh_PiPlLi);
00388       _s_Xp_PiPlCh_PiPlLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
00389       divide(_h_XpPiPlusBottom, _h_XpPiPlusLight, _s_Xp_PiPlBo_PiPlLi);
00390        _s_Xp_PiPlBo_PiPlLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
00391       divide(_temp_XpKPlusCharm , _temp_XpKPlusLight, _s_Xp_KPlCh_KPlLi);
00392       _s_Xp_KPlCh_KPlLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
00393       divide(_h_XpKPlusBottom, _h_XpKPlusLight, _s_Xp_KPlBo_KPlLi);
00394        _s_Xp_KPlBo_KPlLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
00395       divide(_temp_XpKStar0Charm, _temp_XpKStar0Light, _s_Xp_KS0Ch_KS0Li);
00396       _s_Xp_KS0Ch_KS0Li->scale(1.,_SumOfudsWeights/_SumOfcWeights);
00397       divide(_h_XpKStar0Bottom, _h_XpKStar0Light, _s_Xp_KS0Bo_KS0Li);
00398       _s_Xp_KS0Bo_KS0Li->scale(1.,_SumOfudsWeights/_SumOfbWeights);
00399       divide(_temp_XpProtonCharm, _temp_XpProtonLight, _s_Xp_PrCh_PrLi);
00400       _s_Xp_PrCh_PrLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
00401       divide(_h_XpProtonBottom, _h_XpProtonLight, _s_Xp_PrBo_PrLi);
00402       _s_Xp_PrBo_PrLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
00403       divide(_h_XpLambdaCharm, _h_XpLambdaLight, _s_Xp_LaCh_LaLi);
00404       _s_Xp_LaCh_LaLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
00405       divide(_h_XpLambdaBottom, _h_XpLambdaLight, _s_Xp_LaBo_LaLi);
00406       _s_Xp_LaBo_LaLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
00407       divide(_h_XpK0Charm, _h_XpK0Light, _s_Xp_K0Ch_K0Li);
00408       _s_Xp_K0Ch_K0Li->scale(1.,_SumOfudsWeights/_SumOfcWeights);
00409       divide(_h_XpK0Bottom, _h_XpK0Light, _s_Xp_K0Bo_K0Li);
00410       _s_Xp_K0Bo_K0Li->scale(1.,_SumOfudsWeights/_SumOfbWeights);
00411       divide(_h_XpPhiCharm, _h_XpPhiLight, _s_Xp_PhiCh_PhiLi);
00412       _s_Xp_PhiCh_PhiLi->scale(1.,_SumOfudsWeights/_SumOfcWeights);
00413       divide(_h_XpPhiBottom, _h_XpPhiLight, _s_Xp_PhiBo_PhiLi);
00414       _s_Xp_PhiBo_PhiLi->scale(1.,_SumOfudsWeights/_SumOfbWeights);
00415 
00416       // Then the leading particles
00417       divide(*_h_RPiMinus - *_h_RPiPlus, *_h_RPiMinus + *_h_RPiPlus, _s_PiM_PiP);
00418       divide(*_h_RKSBar0 - *_h_RKS0, *_h_RKSBar0 + *_h_RKS0, _s_KSBar0_KS0);
00419       divide(*_h_RKMinus - *_h_RKPlus, *_h_RKMinus + *_h_RKPlus, _s_KM_KP);
00420       divide(*_h_RProton - *_h_RPBar, *_h_RProton + *_h_RPBar, _s_Pr_PBar);
00421       divide(*_h_RLambda - *_h_RLBar, *_h_RLambda + *_h_RLBar, _s_Lam_LBar);
00422 
00423       // Then the rest
00424       scale(_h_XpPiPlusN,      1/sumOfWeights());
00425       scale(_h_XpKPlusN,       1/sumOfWeights());
00426       scale(_h_XpProtonN,      1/sumOfWeights());
00427       scale(_h_XpChargedN,     1/sumOfWeights());
00428       scale(_h_XpK0N,          1/sumOfWeights());
00429       scale(_h_XpLambdaN,      1/sumOfWeights());
00430       scale(_h_XpKStar0N,      1/sumOfWeights());
00431       scale(_h_XpPhiN,         1/sumOfWeights());
00432       scale(_h_XpPiPlusLight,  1/_SumOfudsWeights);
00433       scale(_h_XpPiPlusCharm,  1/_SumOfcWeights);
00434       scale(_h_XpPiPlusBottom, 1/_SumOfbWeights);
00435       scale(_h_XpKPlusLight,   1/_SumOfudsWeights);
00436       scale(_h_XpKPlusCharm,   1/_SumOfcWeights);
00437       scale(_h_XpKPlusBottom,  1/_SumOfbWeights);
00438       scale(_h_XpKStar0Light,  1/_SumOfudsWeights);
00439       scale(_h_XpKStar0Charm,  1/_SumOfcWeights);
00440       scale(_h_XpKStar0Bottom, 1/_SumOfbWeights);
00441       scale(_h_XpProtonLight,  1/_SumOfudsWeights);
00442       scale(_h_XpProtonCharm,  1/_SumOfcWeights);
00443       scale(_h_XpProtonBottom, 1/_SumOfbWeights);
00444       scale(_h_XpLambdaLight,  1/_SumOfudsWeights);
00445       scale(_h_XpLambdaCharm,  1/_SumOfcWeights);
00446       scale(_h_XpLambdaBottom, 1/_SumOfbWeights);
00447       scale(_h_XpK0Light,      1/_SumOfudsWeights);
00448       scale(_h_XpK0Charm,      1/_SumOfcWeights);
00449       scale(_h_XpK0Bottom,     1/_SumOfbWeights);
00450       scale(_h_XpPhiLight,     1/_SumOfudsWeights);
00451       scale(_h_XpPhiCharm ,    1/_SumOfcWeights);
00452       scale(_h_XpPhiBottom,    1/_SumOfbWeights);
00453       scale(_h_RPiPlus,        1/_SumOfudsWeights);
00454       scale(_h_RPiMinus,       1/_SumOfudsWeights);
00455       scale(_h_RKS0,           1/_SumOfudsWeights);
00456       scale(_h_RKSBar0,        1/_SumOfudsWeights);
00457       scale(_h_RKPlus,         1/_SumOfudsWeights);
00458       scale(_h_RKMinus,        1/_SumOfudsWeights);
00459       scale(_h_RProton,        1/_SumOfudsWeights);
00460       scale(_h_RPBar,          1/_SumOfudsWeights);
00461       scale(_h_RLambda,        1/_SumOfudsWeights);
00462       scale(_h_RLBar,          1/_SumOfudsWeights);
00463 
00464       // Multiplicities
00465       double avgNumPartsAll, avgNumPartsLight,avgNumPartsCharm, avgNumPartsBottom;
00466       // pi+/-
00467       // all
00468       avgNumPartsAll = _multPiPlus[0]/sumOfWeights();
00469       bookScatter2D(24, 1, 1, true)->point(0).setY(avgNumPartsAll);
00470       // light
00471       avgNumPartsLight = _multPiPlus[1]/_SumOfudsWeights;
00472       bookScatter2D(24, 1, 2, true)->point(0).setY(avgNumPartsLight);
00473       // charm
00474       avgNumPartsCharm = _multPiPlus[2]/_SumOfcWeights;
00475       bookScatter2D(24, 1, 3, true)->point(0).setY(avgNumPartsCharm);
00476       // bottom
00477       avgNumPartsBottom = _multPiPlus[3]/_SumOfbWeights;
00478       bookScatter2D(24, 1, 4, true)->point(0).setY(avgNumPartsBottom);
00479       // charm-light
00480       bookScatter2D(25, 1, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
00481       // bottom-light
00482       bookScatter2D(25, 1, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
00483       // K+/-
00484       // all
00485       avgNumPartsAll = _multKPlus[0]/sumOfWeights();
00486       bookScatter2D(24, 2, 1, true)->point(0).setY(avgNumPartsAll);
00487       // light
00488       avgNumPartsLight = _multKPlus[1]/_SumOfudsWeights;
00489       bookScatter2D(24, 2, 2, true)->point(0).setY(avgNumPartsLight);
00490       // charm
00491       avgNumPartsCharm = _multKPlus[2]/_SumOfcWeights;
00492       bookScatter2D(24, 2, 3, true)->point(0).setY(avgNumPartsCharm);
00493       // bottom
00494       avgNumPartsBottom = _multKPlus[3]/_SumOfbWeights;
00495       bookScatter2D(24, 2, 4, true)->point(0).setY(avgNumPartsBottom);
00496       // charm-light
00497       bookScatter2D(25, 2, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
00498       // bottom-light
00499       bookScatter2D(25, 2, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
00500       // K0
00501       // all
00502       avgNumPartsAll = _multK0[0]/sumOfWeights();
00503       bookScatter2D(24, 3, 1, true)->point(0).setY(avgNumPartsAll);
00504       // light
00505       avgNumPartsLight = _multK0[1]/_SumOfudsWeights;
00506       bookScatter2D(24, 3, 2, true)->point(0).setY(avgNumPartsLight);
00507       // charm
00508       avgNumPartsCharm = _multK0[2]/_SumOfcWeights;
00509       bookScatter2D(24, 3, 3, true)->point(0).setY(avgNumPartsCharm);
00510       // bottom
00511       avgNumPartsBottom = _multK0[3]/_SumOfbWeights;
00512       bookScatter2D(24, 3, 4, true)->point(0).setY(avgNumPartsBottom);
00513       // charm-light
00514       bookScatter2D(25, 3, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
00515       // bottom-light
00516       bookScatter2D(25, 3, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
00517       // K*0
00518       // all
00519       avgNumPartsAll = _multKStar0[0]/sumOfWeights();
00520       bookScatter2D(24, 4, 1, true)->point(0).setY(avgNumPartsAll);
00521       // light
00522       avgNumPartsLight = _multKStar0[1]/_SumOfudsWeights;
00523       bookScatter2D(24, 4, 2, true)->point(0).setY(avgNumPartsLight);
00524       // charm
00525       avgNumPartsCharm = _multKStar0[2]/_SumOfcWeights;
00526       bookScatter2D(24, 4, 3, true)->point(0).setY(avgNumPartsCharm);
00527       // bottom
00528       avgNumPartsBottom = _multKStar0[3]/_SumOfbWeights;
00529       bookScatter2D(24, 4, 4, true)->point(0).setY(avgNumPartsBottom);
00530       // charm-light
00531       bookScatter2D(25, 4, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
00532       // bottom-light
00533       bookScatter2D(25, 4, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
00534       // phi
00535       // all
00536       avgNumPartsAll = _multPhi[0]/sumOfWeights();
00537       bookScatter2D(24, 5, 1, true)->point(0).setY(avgNumPartsAll);
00538       // light
00539       avgNumPartsLight = _multPhi[1]/_SumOfudsWeights;
00540       bookScatter2D(24, 5, 2, true)->point(0).setY(avgNumPartsLight);
00541       // charm
00542       avgNumPartsCharm = _multPhi[2]/_SumOfcWeights;
00543       bookScatter2D(24, 5, 3, true)->point(0).setY(avgNumPartsCharm);
00544       // bottom
00545       avgNumPartsBottom = _multPhi[3]/_SumOfbWeights;
00546       bookScatter2D(24, 5, 4, true)->point(0).setY(avgNumPartsBottom);
00547       // charm-light
00548       bookScatter2D(25, 5, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
00549       // bottom-light
00550       bookScatter2D(25, 5, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
00551       // p
00552       // all
00553       avgNumPartsAll = _multProton[0]/sumOfWeights();
00554       bookScatter2D(24, 6, 1, true)->point(0).setY(avgNumPartsAll);
00555       // light
00556       avgNumPartsLight = _multProton[1]/_SumOfudsWeights;
00557       bookScatter2D(24, 6, 2, true)->point(0).setY(avgNumPartsLight);
00558       // charm
00559       avgNumPartsCharm = _multProton[2]/_SumOfcWeights;
00560       bookScatter2D(24, 6, 3, true)->point(0).setY(avgNumPartsCharm);
00561       // bottom
00562       avgNumPartsBottom = _multProton[3]/_SumOfbWeights;
00563       bookScatter2D(24, 6, 4, true)->point(0).setY(avgNumPartsBottom);
00564       // charm-light
00565       bookScatter2D(25, 6, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
00566       // bottom-light
00567       bookScatter2D(25, 6, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
00568       // Lambda
00569       // all
00570       avgNumPartsAll = _multLambda[0]/sumOfWeights();
00571       bookScatter2D(24, 7, 1, true)->point(0).setY(avgNumPartsAll);
00572       // light
00573       avgNumPartsLight = _multLambda[1]/_SumOfudsWeights;
00574       bookScatter2D(24, 7, 2, true)->point(0).setY(avgNumPartsLight);
00575       // charm
00576       avgNumPartsCharm = _multLambda[2]/_SumOfcWeights;
00577       bookScatter2D(24, 7, 3, true)->point(0).setY(avgNumPartsCharm);
00578       // bottom
00579       avgNumPartsBottom = _multLambda[3]/_SumOfbWeights;
00580       bookScatter2D(24, 7, 4, true)->point(0).setY(avgNumPartsBottom);
00581       // charm-light
00582       bookScatter2D(25, 7, 1, true)->point(0).setY(avgNumPartsCharm - avgNumPartsLight);
00583       // bottom-light
00584       bookScatter2D(25, 7, 2, true)->point(0).setY(avgNumPartsBottom - avgNumPartsLight);
00585     }
00586 
00587     //@}
00588 
00589 
00590   private:
00591 
00592     /// Store the weighted sums of numbers of charged / charged+neutral
00593     /// particles. Used to calculate average number of particles for the
00594     /// inclusive single particle distributions' normalisations.
00595     double _SumOfudsWeights, _SumOfcWeights, _SumOfbWeights;
00596     vector<double> _multPiPlus, _multKPlus, _multK0,
00597       _multKStar0, _multPhi, _multProton, _multLambda;
00598 
00599     Histo1DPtr _h_XpPiPlusSig, _h_XpPiPlusN;
00600     Histo1DPtr _h_XpKPlusSig, _h_XpKPlusN;
00601     Histo1DPtr _h_XpProtonSig, _h_XpProtonN;
00602     Histo1DPtr _h_XpChargedN;
00603     Histo1DPtr _h_XpK0N, _h_XpLambdaN;
00604     Histo1DPtr _h_XpKStar0N, _h_XpPhiN;
00605     Histo1DPtr _h_XpPiPlusLight, _h_XpPiPlusCharm, _h_XpPiPlusBottom;
00606     Histo1DPtr _h_XpKPlusLight, _h_XpKPlusCharm, _h_XpKPlusBottom;
00607     Histo1DPtr _h_XpKStar0Light, _h_XpKStar0Charm, _h_XpKStar0Bottom;
00608     Histo1DPtr _h_XpProtonLight, _h_XpProtonCharm, _h_XpProtonBottom;
00609     Histo1DPtr _h_XpLambdaLight, _h_XpLambdaCharm, _h_XpLambdaBottom;
00610     Histo1DPtr _h_XpK0Light, _h_XpK0Charm, _h_XpK0Bottom;
00611     Histo1DPtr _h_XpPhiLight, _h_XpPhiCharm, _h_XpPhiBottom;
00612 
00613     Histo1DPtr _temp_XpChargedN1, _temp_XpChargedN2, _temp_XpChargedN3;
00614     Histo1DPtr _temp_XpKPlusCharm , _temp_XpKPlusLight;
00615     Histo1DPtr _temp_XpKStar0Charm, _temp_XpKStar0Light;
00616     Histo1DPtr _temp_XpProtonCharm, _temp_XpProtonLight;
00617 
00618     Histo1DPtr _h_RPiPlus, _h_RPiMinus;
00619     Histo1DPtr _h_RKS0, _h_RKSBar0;
00620     Histo1DPtr _h_RKPlus, _h_RKMinus;
00621     Histo1DPtr _h_RProton, _h_RPBar;
00622     Histo1DPtr _h_RLambda, _h_RLBar;
00623 
00624     Scatter2DPtr _s_Xp_PiPl_Ch, _s_Xp_KPl_Ch,  _s_Xp_Pr_Ch;
00625     Scatter2DPtr _s_Xp_PiPlCh_PiPlLi, _s_Xp_PiPlBo_PiPlLi;
00626     Scatter2DPtr _s_Xp_KPlCh_KPlLi, _s_Xp_KPlBo_KPlLi;
00627     Scatter2DPtr _s_Xp_KS0Ch_KS0Li, _s_Xp_KS0Bo_KS0Li;
00628     Scatter2DPtr _s_Xp_PrCh_PrLi, _s_Xp_PrBo_PrLi;
00629     Scatter2DPtr _s_Xp_LaCh_LaLi, _s_Xp_LaBo_LaLi;
00630     Scatter2DPtr _s_Xp_K0Ch_K0Li, _s_Xp_K0Bo_K0Li;
00631     Scatter2DPtr _s_Xp_PhiCh_PhiLi, _s_Xp_PhiBo_PhiLi;
00632 
00633     Scatter2DPtr _s_PiM_PiP, _s_KSBar0_KS0, _s_KM_KP, _s_Pr_PBar, _s_Lam_LBar;
00634 
00635     //@}
00636 
00637   };
00638 
00639   // The hook for the plugin system
00640   DECLARE_RIVET_PLUGIN(SLD_1999_S3743934);
00641 
00642 }