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/RivetYODA.hh"
00004 #include "Rivet/Tools/ParticleIdUtils.hh"
00005 #include "Rivet/Projections/Beam.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/UnstableFinalState.hh"
00008 #include "Rivet/Projections/ChargedFinalState.hh"
00009 #include "Rivet/Projections/InitialQuarks.hh"
00010 #include "Rivet/Projections/Thrust.hh"
00011 
00012 namespace Rivet {
00013 
00014 
00015   /// @brief SLD flavour-dependent fragmentation paper
00016   /// @author Peter Richardson
00017   class SLD_1999_S3743934 : public Analysis {
00018   public:
00019 
00020     /// Constructor
00021     SLD_1999_S3743934() : Analysis("SLD_1999_S3743934"),
00022                           _SumOfudsWeights(0.), _SumOfcWeights(0.),
00023                           _SumOfbWeights(0.),
00024                           _multPiPlus(4,0.),_multKPlus(4,0.),_multK0(4,0.),
00025                           _multKStar0(4,0.),_multPhi(4,0.),
00026                           _multProton(4,0.),_multLambda(4,0.)
00027     {  }
00028 
00029 
00030     /// @name Analysis methods
00031     //@{
00032 
00033     void analyze(const Event& e) {
00034       // First, veto on leptonic events by requiring at least 4 charged FS particles
00035       const FinalState& fs = applyProjection<FinalState>(e, "FS");
00036       const size_t numParticles = fs.particles().size();
00037 
00038       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
00039       if (numParticles < 2) {
00040         MSG_DEBUG("Failed ncharged cut");
00041         vetoEvent;
00042       }
00043       MSG_DEBUG("Passed ncharged cut");
00044       // Get event weight for histo filling
00045       const double weight = e.weight();
00046 
00047       // Get beams and average beam momentum
00048       const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
00049       const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
00050                                    beams.second.momentum().vector3().mod() ) / 2.0;
00051       MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
00052       int flavour = 0;
00053       const InitialQuarks& iqf = applyProjection<InitialQuarks>(e, "IQF");
00054 
00055       // If we only have two quarks (qqbar), just take the flavour.
00056       // If we have more than two quarks, look for the highest energetic q-qbar pair.
00057       ParticleVector quarks;
00058       if (iqf.particles().size() == 2) {
00059         flavour = abs( iqf.particles().front().pdgId() );
00060         quarks = iqf.particles();
00061       }
00062       else {
00063         map<int, Particle > quarkmap;
00064         foreach (const Particle& p, iqf.particles()) {
00065           if (quarkmap.find(p.pdgId())==quarkmap.end())
00066             quarkmap[p.pdgId()] = p;
00067           else if (quarkmap[p.pdgId()].momentum().E() < p.momentum().E())
00068             quarkmap[p.pdgId()] = p;
00069         }
00070         double maxenergy = 0.;
00071         for (int i = 1; i <= 5; ++i) {
00072           double energy(0.);
00073           if (quarkmap.find( i)!=quarkmap.end())
00074             energy += quarkmap[ i].momentum().E();
00075           if (quarkmap.find(-i)!=quarkmap.end())
00076             energy += quarkmap[-i].momentum().E();
00077           if (energy > maxenergy) flavour = i;
00078         }
00079         if (quarkmap.find( flavour)!=quarkmap.end())
00080           quarks.push_back(quarkmap[ flavour]);
00081         if (quarkmap.find(-flavour)!=quarkmap.end())
00082           quarks.push_back(quarkmap[-flavour]);
00083       }
00084       switch (flavour) {
00085       case 1: case 2: case 3:
00086         _SumOfudsWeights += weight;
00087         break;
00088       case 4:
00089         _SumOfcWeights += weight;
00090         break;
00091       case 5:
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].momentum().vector3().dot(axis);
00100         if(quarks[0].pdgId()<0) dot *= -1.;
00101       }
00102 
00103       foreach (const Particle& p, fs.particles()) {
00104         const double xp = p.momentum().vector3().mod()/meanBeamMom;
00105         // if in quark or antiquark hemisphere
00106         bool quark = p.momentum().vector3().dot(axis)*dot>0.;
00107         _histXpChargedN->fill(xp, weight);
00108         int id = abs(p.pdgId());
00109         // charged pions
00110         if (id == PIPLUS) {
00111           _histXpPiPlusN->fill(xp, weight);
00112           _multPiPlus[0] += weight;
00113           switch (flavour) {
00114           case DQUARK: case UQUARK: case SQUARK:
00115             _multPiPlus[1] += weight;
00116             _histXpPiPlusLight->fill(xp, weight);
00117             if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 ))
00118               _histRPiPlus->fill(xp, weight);
00119             else
00120               _histRPiMinus->fill(xp, weight);
00121             break;
00122           case CQUARK:
00123             _multPiPlus[2] += weight;
00124             _histXpPiPlusCharm->fill(xp, weight);
00125             break;
00126           case BQUARK:
00127             _multPiPlus[3] += weight;
00128             _histXpPiPlusBottom->fill(xp, weight);
00129             break;
00130           }
00131         }
00132         else if (id == KPLUS) {
00133           _histXpKPlusN->fill(xp, weight);
00134           _multKPlus[0] += weight;
00135           switch (flavour) {
00136           case DQUARK: case UQUARK: case SQUARK:
00137             _multKPlus[1] += weight;
00138             _tempXpKPlusLight->fill(xp, weight);
00139             _histXpKPlusLight->fill(xp, weight);
00140             if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 ))
00141               _histRKPlus->fill(xp, weight);
00142             else
00143               _histRKMinus->fill(xp, weight);
00144             break;
00145          break;
00146           case CQUARK:
00147             _multKPlus[2] += weight;
00148             _histXpKPlusCharm->fill(xp, weight);
00149             _tempXpKPlusCharm->fill(xp, weight);
00150             break;
00151           case BQUARK:
00152             _multKPlus[3] += weight;
00153             _histXpKPlusBottom->fill(xp, weight);
00154             break;
00155           }
00156         }
00157         else if (id == PROTON) {
00158           _histXpProtonN->fill(xp, weight);
00159           _multProton[0] += weight;
00160           switch (flavour) {
00161           case DQUARK: case UQUARK: case SQUARK:
00162             _multProton[1] += weight;
00163             _tempXpProtonLight->fill(xp, weight);
00164             _histXpProtonLight->fill(xp, weight);
00165             if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 ))
00166               _histRProton->fill(xp, weight);
00167             else
00168               _histRPBar  ->fill(xp, weight);
00169             break;
00170          break;
00171           case CQUARK:
00172             _multProton[2] += weight;
00173             _tempXpProtonCharm->fill(xp, weight);
00174             _histXpProtonCharm->fill(xp, weight);
00175             break;
00176           case BQUARK:
00177             _multProton[3] += weight;
00178             _histXpProtonBottom->fill(xp, weight);
00179             break;
00180           }
00181         }
00182       }
00183       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00184       foreach (const Particle& p, ufs.particles()) {
00185         const double xp = p.momentum().vector3().mod()/meanBeamMom;
00186         // if in quark or antiquark hemisphere
00187         bool quark = p.momentum().vector3().dot(axis)*dot>0.;
00188         int id = abs(p.pdgId());
00189         if (id == LAMBDA) {
00190           _multLambda[0] += weight;
00191           _histXpLambdaN->fill(xp, weight);
00192           switch (flavour) {
00193           case DQUARK: case UQUARK: case SQUARK:
00194             _multLambda[1] += weight;
00195             _histXpLambdaLight->fill(xp, weight);
00196             if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 ))
00197               _histRLambda->fill(xp, weight);
00198             else
00199               _histRLBar  ->fill(xp, weight);
00200             break;
00201           case CQUARK:
00202             _multLambda[2] += weight;
00203             _histXpLambdaCharm->fill(xp, weight);
00204             break;
00205           case BQUARK:
00206             _multLambda[3] += weight;
00207             _histXpLambdaBottom->fill(xp, weight);
00208             break;
00209           }
00210         }
00211         else if (id == 313) {
00212           _multKStar0[0] += weight;
00213           _histXpKStar0N->fill(xp, weight);
00214           switch (flavour) {
00215           case DQUARK: case UQUARK: case SQUARK:
00216             _multKStar0[1] += weight;
00217             _tempXpKStar0Light->fill(xp, weight);
00218             _histXpKStar0Light->fill(xp, weight);
00219             if ( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 ))
00220               _histRKS0   ->fill(xp, weight);
00221             else
00222               _histRKSBar0->fill(xp, weight);
00223             break;
00224             break;
00225           case CQUARK:
00226             _multKStar0[2] += weight;
00227             _tempXpKStar0Charm->fill(xp, weight);
00228             _histXpKStar0Charm->fill(xp, weight);
00229             break;
00230           case BQUARK:
00231             _multKStar0[3] += weight;
00232             _histXpKStar0Bottom->fill(xp, weight);
00233             break;
00234           }
00235         }
00236         else if (id == 333) {
00237           _multPhi[0] += weight;
00238           _histXpPhiN->fill(xp, weight);
00239           switch (flavour) {
00240           case DQUARK: case UQUARK: case SQUARK:
00241             _multPhi[1] += weight;
00242             _histXpPhiLight->fill(xp, weight);
00243             break;
00244           case CQUARK:
00245             _multPhi[2] += weight;
00246             _histXpPhiCharm->fill(xp, weight);
00247             break;
00248           case BQUARK:
00249             _multPhi[3] += weight;
00250             _histXpPhiBottom->fill(xp, weight);
00251             break;
00252           }
00253         }
00254         else if (id == K0S || id == K0L) {
00255           _multK0[0] += weight;
00256           _histXpK0N->fill(xp, weight);
00257           switch (flavour) {
00258           case DQUARK: case UQUARK: case SQUARK:
00259             _multK0[1] += weight;
00260             _histXpK0Light->fill(xp, weight);
00261             break;
00262           case CQUARK:
00263             _multK0[2] += weight;
00264             _histXpK0Charm->fill(xp, weight);
00265             break;
00266           case BQUARK:
00267             _multK0[3] += weight;
00268             _histXpK0Bottom->fill(xp, weight);
00269             break;
00270           }
00271         }
00272       }
00273     }
00274 
00275     void init() {
00276       // Projections
00277       addProjection(Beam(), "Beams");
00278       addProjection(ChargedFinalState(), "FS");
00279       addProjection(UnstableFinalState(), "UFS");
00280       addProjection(InitialQuarks(), "IQF");
00281       addProjection(Thrust(FinalState()), "Thrust");
00282       _histXpPiPlusN      = bookHisto1D( 1, 1, 2);
00283       _histXpKPlusN       = bookHisto1D( 2, 1, 2);
00284       _histXpProtonN      = bookHisto1D( 3, 1, 2);
00285       _histXpChargedN     = bookHisto1D( 4, 1, 1);
00286       _histXpK0N          = bookHisto1D( 5, 1, 1);
00287       _histXpLambdaN      = bookHisto1D( 7, 1, 1);
00288       _histXpKStar0N      = bookHisto1D( 8, 1, 1);
00289       _histXpPhiN         = bookHisto1D( 9, 1, 1);
00290 
00291       _histXpPiPlusLight  = bookHisto1D(10, 1, 1);
00292       _histXpPiPlusCharm  = bookHisto1D(10, 1, 2);
00293       _histXpPiPlusBottom = bookHisto1D(10, 1, 3);
00294       _histXpKPlusLight   = bookHisto1D(12, 1, 1);
00295       _histXpKPlusCharm   = bookHisto1D(12, 1, 2);
00296       _histXpKPlusBottom  = bookHisto1D(12, 1, 3);
00297       _histXpKStar0Light  = bookHisto1D(14, 1, 1);
00298       _histXpKStar0Charm  = bookHisto1D(14, 1, 2);
00299       _histXpKStar0Bottom = bookHisto1D(14, 1, 3);
00300       _histXpProtonLight  = bookHisto1D(16, 1, 1);
00301       _histXpProtonCharm  = bookHisto1D(16, 1, 2);
00302       _histXpProtonBottom = bookHisto1D(16, 1, 3);
00303       _histXpLambdaLight  = bookHisto1D(18, 1, 1);
00304       _histXpLambdaCharm  = bookHisto1D(18, 1, 2);
00305       _histXpLambdaBottom = bookHisto1D(18, 1, 3);
00306       _histXpK0Light      = bookHisto1D(20, 1, 1);
00307       _histXpK0Charm      = bookHisto1D(20, 1, 2);
00308       _histXpK0Bottom     = bookHisto1D(20, 1, 3);
00309       _histXpPhiLight     = bookHisto1D(22, 1, 1);
00310       _histXpPhiCharm     = bookHisto1D(22, 1, 2);
00311       _histXpPhiBottom    = bookHisto1D(22, 1, 3);
00312 
00313       _tempXpKPlusCharm   = bookHisto1D(13, 1, 1, "tempXpKPlusCharm");
00314       _tempXpKPlusLight   = bookHisto1D(13, 1, 1, "tempXpKPlusLight");
00315       _tempXpKStar0Charm  = bookHisto1D(15, 1, 1, "tempXpKStar0Charm");
00316       _tempXpKStar0Light  = bookHisto1D(15, 1, 1, "tempXpKStar0Light");
00317       _tempXpProtonCharm  = bookHisto1D(17, 1, 1, "tempXpProtonCharm");
00318       _tempXpProtonLight  = bookHisto1D(17, 1, 1, "tempXpProtonLight");
00319 
00320       _histRPiPlus  = bookHisto1D( 26, 1, 1);
00321       _histRPiMinus = bookHisto1D( 26, 1, 2);
00322       _histRKS0     = bookHisto1D( 28, 1, 1);
00323       _histRKSBar0  = bookHisto1D( 28, 1, 2);
00324       _histRKPlus   = bookHisto1D( 30, 1, 1);
00325       _histRKMinus  = bookHisto1D( 30, 1, 2);
00326       _histRProton  = bookHisto1D( 32, 1, 1);
00327       _histRPBar    = bookHisto1D( 32, 1, 2);
00328       _histRLambda  = bookHisto1D( 34, 1, 1);
00329       _histRLBar    = bookHisto1D( 34, 1, 2);
00330 
00331 
00332       _h_Xp_PiPl_Ch     = bookScatter2D(1, 1, 1);
00333       _h_Xp_KPl_Ch      = bookScatter2D(2, 1, 1);
00334       _h_Xp_Pr_Ch       = bookScatter2D(3, 1, 1);
00335       _h_Xp_PiPlCh_PiPlLi   = bookScatter2D(11, 1, 1);
00336       _h_Xp_PiPlBo_PiPlLi   = bookScatter2D(11, 1, 2);
00337       _h_Xp_KPlCh_KPlLi = bookScatter2D(13, 1, 1);
00338       _h_Xp_KPlBo_KPlLi = bookScatter2D(13, 1, 2);
00339       _h_Xp_KS0Ch_KS0Li = bookScatter2D(15, 1, 1);
00340       _h_Xp_KS0Bo_KS0Li = bookScatter2D(15, 1, 2);
00341       _h_Xp_PrCh_PrLi       = bookScatter2D(17, 1, 1);
00342       _h_Xp_PrBo_PrLi       = bookScatter2D(17, 1, 2);
00343       _h_Xp_LaCh_LaLi       = bookScatter2D(19, 1, 1);
00344       _h_Xp_LaBo_LaLi       = bookScatter2D(19, 1, 2);
00345       _h_Xp_K0Ch_K0Li       = bookScatter2D(21, 1, 1);
00346       _h_Xp_K0Bo_K0Li       = bookScatter2D(21, 1, 2);
00347       _h_Xp_PhiCh_PhiLi = bookScatter2D(23, 1, 1);
00348       _h_Xp_PhiBo_PhiLi = bookScatter2D(23, 1, 2);
00349 
00350       _h_PiM_PiP        = bookScatter2D(27, 1, 1);
00351       _h_KSBar0_KS0     = bookScatter2D(29, 1, 1);
00352       _h_KM_KP      = bookScatter2D(31, 1, 1);
00353       _h_Pr_PBar        = bookScatter2D(33, 1, 1);
00354       _h_Lam_LBar       = bookScatter2D(35, 1, 1);
00355 
00356     }
00357 
00358 
00359     /// Finalize
00360     void finalize() {
00361       // get the ratio plots sorted out first
00362       divide(_histXpPiPlusN,_histXpChargedN,
00363          _h_Xp_PiPl_Ch);
00364 
00365       divide(_histXpKPlusN,_histXpChargedN,
00366          _h_Xp_KPl_Ch);
00367 
00368       divide(_histXpProtonN,_histXpChargedN,
00369          _h_Xp_Pr_Ch);
00370 
00371       divide(_histXpPiPlusCharm ,_histXpPiPlusLight,
00372          _h_Xp_PiPlCh_PiPlLi);
00373 
00374       divide(_histXpPiPlusBottom ,_histXpPiPlusLight,
00375          _h_Xp_PiPlBo_PiPlLi);
00376 
00377       divide(_tempXpKPlusCharm  ,_tempXpKPlusLight,
00378          _h_Xp_KPlCh_KPlLi);
00379 
00380       divide(_histXpKPlusBottom ,_histXpKPlusLight,
00381          _h_Xp_KPlBo_KPlLi);
00382 
00383       divide(_tempXpKStar0Charm,_tempXpKStar0Light,
00384          _h_Xp_KS0Ch_KS0Li);
00385 
00386       divide(_histXpKStar0Bottom,_histXpKStar0Light,
00387          _h_Xp_KS0Bo_KS0Li);
00388 
00389       divide(_tempXpProtonCharm,_tempXpProtonLight,
00390          _h_Xp_PrCh_PrLi);
00391 
00392       divide(_histXpProtonBottom,_histXpProtonLight,
00393          _h_Xp_PrBo_PrLi);
00394 
00395       divide(_histXpLambdaCharm ,_histXpLambdaLight,
00396          _h_Xp_LaCh_LaLi);
00397 
00398       divide(_histXpLambdaBottom ,_histXpLambdaLight,
00399          _h_Xp_LaBo_LaLi);
00400 
00401       divide(_histXpK0Charm ,_histXpK0Light,
00402          _h_Xp_K0Ch_K0Li);
00403 
00404       divide(_histXpK0Bottom ,_histXpK0Light,
00405          _h_Xp_K0Bo_K0Li);
00406 
00407       divide(_histXpPhiCharm ,_histXpPhiLight,
00408          _h_Xp_PhiCh_PhiLi);
00409 
00410       divide(_histXpPhiBottom ,_histXpPhiLight,
00411          _h_Xp_PhiBo_PhiLi);
00412 
00413       //// leading particles
00414 
00415       divide(*_histRPiMinus - *_histRPiPlus,
00416          *_histRPiMinus + *_histRPiPlus,
00417          _h_PiM_PiP);
00418 
00419       divide(*_histRKSBar0 - *_histRKS0,
00420          *_histRKSBar0 + *_histRKS0,
00421          _h_KSBar0_KS0);
00422 
00423       divide(*_histRKMinus - *_histRKPlus,
00424          *_histRKMinus + *_histRKPlus,
00425          _h_KM_KP);
00426 
00427       divide(*_histRProton - *_histRPBar,
00428          *_histRProton + *_histRPBar,
00429          _h_Pr_PBar);
00430 
00431       divide(*_histRLambda - *_histRLBar,
00432          *_histRLambda + *_histRLBar,
00433          _h_Lam_LBar);
00434 
00435 
00436       // then the rest
00437       Analysis::scale(_histXpPiPlusN    ,1./sumOfWeights());
00438       Analysis::scale(_histXpKPlusN     ,1./sumOfWeights());
00439       Analysis::scale(_histXpProtonN    ,1./sumOfWeights());
00440       Analysis::scale(_histXpChargedN,1./sumOfWeights());
00441       Analysis::scale(_histXpK0N,1./sumOfWeights());
00442       Analysis::scale(_histXpLambdaN,1./sumOfWeights());
00443       Analysis::scale(_histXpKStar0N,1./sumOfWeights());
00444       Analysis::scale(_histXpPhiN,1./sumOfWeights());
00445       Analysis::scale(_histXpPiPlusLight,1./_SumOfudsWeights);
00446       Analysis::scale(_histXpPiPlusCharm,1./_SumOfcWeights);
00447       Analysis::scale(_histXpPiPlusBottom,1./_SumOfbWeights);
00448       Analysis::scale(_histXpKPlusLight ,1./_SumOfudsWeights);
00449       Analysis::scale(_histXpKPlusCharm ,1./_SumOfcWeights);
00450       Analysis::scale(_histXpKPlusBottom,1./_SumOfbWeights);
00451       Analysis::scale(_histXpKStar0Light ,1./_SumOfudsWeights);
00452       Analysis::scale(_histXpKStar0Charm ,1./_SumOfcWeights);
00453       Analysis::scale(_histXpKStar0Bottom,1./_SumOfbWeights);
00454       Analysis::scale(_histXpProtonLight ,1./_SumOfudsWeights);
00455       Analysis::scale(_histXpProtonCharm ,1./_SumOfcWeights);
00456       Analysis::scale(_histXpProtonBottom,1./_SumOfbWeights);
00457       Analysis::scale(_histXpLambdaLight ,1./_SumOfudsWeights);
00458       Analysis::scale(_histXpLambdaCharm ,1./_SumOfcWeights);
00459       Analysis::scale(_histXpLambdaBottom,1./_SumOfbWeights);
00460       Analysis::scale(_histXpK0Light ,1./_SumOfudsWeights);
00461       Analysis::scale(_histXpK0Charm ,1./_SumOfcWeights);
00462       Analysis::scale(_histXpK0Bottom,1./_SumOfbWeights);
00463       Analysis::scale(_histXpPhiLight ,1./_SumOfudsWeights);
00464       Analysis::scale(_histXpPhiCharm ,1./_SumOfcWeights);
00465       Analysis::scale(_histXpPhiBottom,1./_SumOfbWeights);
00466       Analysis::scale(_histRPiPlus ,1./_SumOfudsWeights);
00467       Analysis::scale(_histRPiMinus,1./_SumOfudsWeights);
00468       Analysis::scale(_histRKS0    ,1./_SumOfudsWeights);
00469       Analysis::scale(_histRKSBar0 ,1./_SumOfudsWeights);
00470       Analysis::scale(_histRKPlus  ,1./_SumOfudsWeights);
00471       Analysis::scale(_histRKMinus ,1./_SumOfudsWeights);
00472       Analysis::scale(_histRProton ,1./_SumOfudsWeights);
00473       Analysis::scale(_histRPBar   ,1./_SumOfudsWeights);
00474       Analysis::scale(_histRLambda ,1./_SumOfudsWeights);
00475       Analysis::scale(_histRLBar   ,1./_SumOfudsWeights);
00476 
00477       // multiplicities
00478       Scatter2DPtr multA;
00479       Scatter2DPtr multL;
00480       Scatter2DPtr multC;
00481       Scatter2DPtr multB;
00482       Scatter2DPtr multD1;
00483       Scatter2DPtr multD2;
00484       double  avgNumPartsAll,avgNumPartsLight,avgNumPartsCharm, avgNumPartsBottom;
00485       // pi+/-
00486       // all
00487       // @todo YODA
00488       //avgNumPartsAll = _multPiPlus[0]/sumOfWeights();
00489       //multA = bookDataPointSet(24, 1, 1);
00490       //multA->point(0)->coordinate(1)->setValue(avgNumPartsAll);
00491       //// light
00492       //avgNumPartsLight = _multPiPlus[1]/_SumOfudsWeights;
00493       //multL = bookDataPointSet(24, 1, 2);
00494       //multL->point(0)->coordinate(1)->setValue(avgNumPartsLight);
00495       //// charm
00496       //avgNumPartsCharm = _multPiPlus[2]/_SumOfcWeights;
00497       //multC = bookDataPointSet(24, 1, 3);
00498       //multC->point(0)->coordinate(1)->setValue(avgNumPartsCharm);
00499       //// bottom
00500       //avgNumPartsBottom = _multPiPlus[3]/_SumOfbWeights;
00501       //multB = bookDataPointSet(24, 1, 4);
00502       //multB->point(0)->coordinate(1)->setValue(avgNumPartsBottom);
00503       //// charm-light
00504       //multD1 = bookDataPointSet(25, 1, 1);
00505       //multD1->point(0)->coordinate(1)->setValue(avgNumPartsCharm -avgNumPartsLight);
00506       //// bottom-light
00507       //multD2 = bookDataPointSet(25, 1, 2);
00508       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
00509       //// K+/-
00510       //// all
00511       //avgNumPartsAll = _multKPlus[0]/sumOfWeights();
00512       //multA = bookDataPointSet(24, 2, 1);
00513       //multA->point(0)->coordinate(1)->setValue(avgNumPartsAll);
00514       //// light
00515       //avgNumPartsLight = _multKPlus[1]/_SumOfudsWeights;
00516       //multL = bookDataPointSet(24, 2, 2);
00517       //multL->point(0)->coordinate(1)->setValue(avgNumPartsLight);
00518       //// charm
00519       //avgNumPartsCharm = _multKPlus[2]/_SumOfcWeights;
00520       //multC = bookDataPointSet(24, 2, 3);
00521       //multC->point(0)->coordinate(1)->setValue(avgNumPartsCharm);
00522       //// bottom
00523       //avgNumPartsBottom = _multKPlus[3]/_SumOfbWeights;
00524       //multB = bookDataPointSet(24, 2, 4);
00525       //multB->point(0)->coordinate(1)->setValue(avgNumPartsBottom);
00526       //// charm-light
00527       //multD1 = bookDataPointSet(25, 2, 1);
00528       //multD1->point(0)->coordinate(1)->setValue(avgNumPartsCharm -avgNumPartsLight);
00529       //// bottom-light
00530       //multD2 = bookDataPointSet(25, 2, 2);
00531       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
00532       //// K0
00533       //// all
00534       //avgNumPartsAll = _multK0[0]/sumOfWeights();
00535       //multA = bookDataPointSet(24, 3, 1);
00536       //multA->point(0)->coordinate(1)->setValue(avgNumPartsAll);
00537       //// light
00538       //avgNumPartsLight = _multK0[1]/_SumOfudsWeights;
00539       //multL = bookDataPointSet(24, 3, 2);
00540       //multL->point(0)->coordinate(1)->setValue(avgNumPartsLight);
00541       //// charm
00542       //avgNumPartsCharm = _multK0[2]/_SumOfcWeights;
00543       //multC = bookDataPointSet(24, 3, 3);
00544       //multC->point(0)->coordinate(1)->setValue(avgNumPartsCharm);
00545       //// bottom
00546       //avgNumPartsBottom = _multK0[3]/_SumOfbWeights;
00547       //multB = bookDataPointSet(24, 3, 4);
00548       //multB->point(0)->coordinate(1)->setValue(avgNumPartsBottom);
00549       //// charm-light
00550       //multD1 = bookDataPointSet(25, 3, 1);
00551       //multD1->point(0)->coordinate(1)->setValue(avgNumPartsCharm -avgNumPartsLight);
00552       //// bottom-light
00553       //multD2 = bookDataPointSet(25, 3, 2);
00554       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
00555       //// K*0
00556       //// all
00557       //avgNumPartsAll = _multKStar0[0]/sumOfWeights();
00558       //multA = bookDataPointSet(24, 4, 1);
00559       //multA->point(0)->coordinate(1)->setValue(avgNumPartsAll);
00560       //// light
00561       //avgNumPartsLight = _multKStar0[1]/_SumOfudsWeights;
00562       //multL = bookDataPointSet(24, 4, 2);
00563       //multL->point(0)->coordinate(1)->setValue(avgNumPartsLight);
00564       //// charm
00565       //avgNumPartsCharm = _multKStar0[2]/_SumOfcWeights;
00566       //multC = bookDataPointSet(24, 4, 3);
00567       //multC->point(0)->coordinate(1)->setValue(avgNumPartsCharm);
00568       //// bottom
00569       //avgNumPartsBottom = _multKStar0[3]/_SumOfbWeights;
00570       //multB = bookDataPointSet(24, 4, 4);
00571       //multB->point(0)->coordinate(1)->setValue(avgNumPartsBottom);
00572       //// charm-light
00573       //multD1 = bookDataPointSet(25, 4, 1);
00574       //multD1->point(0)->coordinate(1)->setValue(avgNumPartsCharm -avgNumPartsLight);
00575       //// bottom-light
00576       //multD2 = bookDataPointSet(25, 4, 2);
00577       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
00578       //// phi
00579       //// all
00580       //avgNumPartsAll = _multPhi[0]/sumOfWeights();
00581       //multA = bookDataPointSet(24, 5, 1);
00582       //multA->point(0)->coordinate(1)->setValue(avgNumPartsAll);
00583       //// light
00584       //avgNumPartsLight = _multPhi[1]/_SumOfudsWeights;
00585       //multL = bookDataPointSet(24, 5, 2);
00586       //multL->point(0)->coordinate(1)->setValue(avgNumPartsLight);
00587       //// charm
00588       //avgNumPartsCharm = _multPhi[2]/_SumOfcWeights;
00589       //multC = bookDataPointSet(24, 5, 3);
00590       //multC->point(0)->coordinate(1)->setValue(avgNumPartsCharm);
00591       //// bottom
00592       //avgNumPartsBottom = _multPhi[3]/_SumOfbWeights;
00593       //multB = bookDataPointSet(24, 5, 4);
00594       //multB->point(0)->coordinate(1)->setValue(avgNumPartsBottom);
00595       //// charm-light
00596       //multD1 = bookDataPointSet(25, 5, 1);
00597       //multD1->point(0)->coordinate(1)->setValue(avgNumPartsCharm -avgNumPartsLight);
00598       //// bottom-light
00599       //multD2 = bookDataPointSet(25, 5, 2);
00600       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
00601       //// p
00602       //// all
00603       //avgNumPartsAll = _multProton[0]/sumOfWeights();
00604       //multA = bookDataPointSet(24, 6, 1);
00605       //multA->point(0)->coordinate(1)->setValue(avgNumPartsAll);
00606       //// light
00607       //avgNumPartsLight = _multProton[1]/_SumOfudsWeights;
00608       //multL = bookDataPointSet(24, 6, 2);
00609       //multL->point(0)->coordinate(1)->setValue(avgNumPartsLight);
00610       //// charm
00611       //avgNumPartsCharm = _multProton[2]/_SumOfcWeights;
00612       //multC = bookDataPointSet(24, 6, 3);
00613       //multC->point(0)->coordinate(1)->setValue(avgNumPartsCharm);
00614       //// bottom
00615       //avgNumPartsBottom = _multProton[3]/_SumOfbWeights;
00616       //multB = bookDataPointSet(24, 6, 4);
00617       //multB->point(0)->coordinate(1)->setValue(avgNumPartsBottom);
00618       //// charm-light
00619       //multD1 = bookDataPointSet(25, 6, 1);
00620       //multD1->point(0)->coordinate(1)->setValue(avgNumPartsCharm -avgNumPartsLight);
00621       //// bottom-light
00622       //multD2 = bookDataPointSet(25, 6, 2);
00623       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
00624       //// Lambda
00625       //// all
00626       //avgNumPartsAll = _multLambda[0]/sumOfWeights();
00627       //multA = bookDataPointSet(24, 7, 1);
00628       //multA->point(0)->coordinate(1)->setValue(avgNumPartsAll);
00629       //// light
00630       //avgNumPartsLight = _multLambda[1]/_SumOfudsWeights;
00631       //multL = bookDataPointSet(24, 7, 2);
00632       //multL->point(0)->coordinate(1)->setValue(avgNumPartsLight);
00633       //// charm
00634       //avgNumPartsCharm = _multLambda[2]/_SumOfcWeights;
00635       //multC = bookDataPointSet(24, 7, 3);
00636       //multC->point(0)->coordinate(1)->setValue(avgNumPartsCharm);
00637       //// bottom
00638       //avgNumPartsBottom = _multLambda[3]/_SumOfbWeights;
00639       //multB = bookDataPointSet(24, 7, 4);
00640       //multB->point(0)->coordinate(1)->setValue(avgNumPartsBottom);
00641       //// charm-light
00642       //multD1 = bookDataPointSet(25, 7, 1);
00643       //multD1->point(0)->coordinate(1)->setValue(avgNumPartsCharm -avgNumPartsLight);
00644       //// bottom-light
00645       //multD2 = bookDataPointSet(25, 7, 2);
00646       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
00647     }
00648 
00649     //@}
00650 
00651     // @todo YODA
00652     //void scale(AIDA::IDataPointSet*& histo, double scale) {
00653     //  if (!histo) {
00654     //    MSG_ERROR("Failed to scale histo=NULL in analysis "
00655     //              << name() << " (scale=" << scale << ")");
00656     //    return;
00657     //  }
00658     //  const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo));
00659     //  MSG_TRACE("Scaling histo " << hpath);
00660 
00661     //  vector<double> x, y, ex, ey;
00662     //  for (size_t i = 0, N = histo->size(); i < N; ++i) {
00663 
00664     //    IDataPoint * point = histo->point(i);
00665     //    assert(point->dimension()==2);
00666     //    x .push_back(point->coordinate(0)->value());
00667     //    ex.push_back(0.5*(point->coordinate(0)->errorPlus()+
00668     //                      point->coordinate(0)->errorMinus()));
00669     //    y .push_back(point->coordinate(1)->value()*scale);
00670     //    ey.push_back(0.5*scale*(point->coordinate(1)->errorPlus()+
00671     //                            point->coordinate(1)->errorMinus()));
00672     //  }
00673     //  string title = histo->title();
00674     //  string xtitle = histo->xtitle();
00675     //  string ytitle = histo->ytitle();
00676 
00677     //  tree().mkdir("/tmpnormalize");
00678     //  tree().mv(hpath, "/tmpnormalize");
00679 
00680     //  if (hpath.find(" ") != string::npos) {
00681     //    throw Error("Histogram path '" + hpath + "' is invalid: spaces are not permitted in paths");
00682     //  }
00683     //  AIDA::IDataPointSet* dps = datapointsetFactory().createXY(hpath, title, x, y, ex, ey);
00684     //  dps->setXTitle(xtitle);
00685     //  dps->setYTitle(ytitle);
00686 
00687     //  tree().rm(tree().findPath(dynamic_cast<AIDA::IManagedObject&>(*histo)));
00688     //  tree().rmdir("/tmpnormalize");
00689 
00690     //  // Set histo pointer to null - it can no longer be used.
00691     //  histo = 0;
00692     //}
00693 
00694   private:
00695 
00696     /// Store the weighted sums of numbers of charged / charged+neutral
00697     /// particles - used to calculate average number of particles for the
00698     /// inclusive single particle distributions' normalisations.
00699     double _SumOfudsWeights,_SumOfcWeights,_SumOfbWeights;
00700     vector<double> _multPiPlus,_multKPlus,_multK0,_multKStar0,
00701       _multPhi,_multProton,_multLambda;
00702 
00703     Histo1DPtr _histXpPiPlusSig;
00704     Histo1DPtr _histXpPiPlusN;
00705     Histo1DPtr _histXpKPlusSig;
00706     Histo1DPtr _histXpKPlusN;
00707     Histo1DPtr _histXpProtonSig;
00708     Histo1DPtr _histXpProtonN;
00709     Histo1DPtr _histXpChargedN;
00710     Histo1DPtr _histXpK0N;
00711     Histo1DPtr _histXpLambdaN;
00712     Histo1DPtr _histXpKStar0N;
00713     Histo1DPtr _histXpPhiN;
00714     Histo1DPtr _histXpPiPlusLight;
00715     Histo1DPtr _histXpPiPlusCharm;
00716     Histo1DPtr _histXpPiPlusBottom;
00717     Histo1DPtr _histXpKPlusLight;
00718     Histo1DPtr _histXpKPlusCharm;
00719     Histo1DPtr _histXpKPlusBottom;
00720     Histo1DPtr _histXpKStar0Light;
00721     Histo1DPtr _histXpKStar0Charm;
00722     Histo1DPtr _histXpKStar0Bottom;
00723     Histo1DPtr _histXpProtonLight;
00724     Histo1DPtr _histXpProtonCharm;
00725     Histo1DPtr _histXpProtonBottom;
00726     Histo1DPtr _histXpLambdaLight;
00727     Histo1DPtr _histXpLambdaCharm;
00728     Histo1DPtr _histXpLambdaBottom;
00729     Histo1DPtr _histXpK0Light;
00730     Histo1DPtr _histXpK0Charm;
00731     Histo1DPtr _histXpK0Bottom;
00732     Histo1DPtr _histXpPhiLight;
00733     Histo1DPtr _histXpPhiCharm;
00734     Histo1DPtr _histXpPhiBottom;
00735     Histo1DPtr _tempXpKPlusCharm ;
00736     Histo1DPtr _tempXpKPlusLight ;
00737     Histo1DPtr _tempXpKStar0Charm;
00738     Histo1DPtr _tempXpKStar0Light;
00739     Histo1DPtr _tempXpProtonCharm;
00740     Histo1DPtr _tempXpProtonLight;
00741     Histo1DPtr _histRPiPlus ;
00742     Histo1DPtr _histRPiMinus;
00743     Histo1DPtr _histRKS0    ;
00744     Histo1DPtr _histRKSBar0 ;
00745     Histo1DPtr _histRKPlus  ;
00746     Histo1DPtr _histRKMinus ;
00747     Histo1DPtr _histRProton ;
00748     Histo1DPtr _histRPBar   ;
00749     Histo1DPtr _histRLambda ;
00750     Histo1DPtr _histRLBar   ;
00751 
00752     Scatter2DPtr _h_Xp_PiPl_Ch;
00753     Scatter2DPtr _h_Xp_KPl_Ch;
00754     Scatter2DPtr _h_Xp_Pr_Ch;
00755     Scatter2DPtr _h_Xp_PiPlCh_PiPlLi;
00756     Scatter2DPtr _h_Xp_PiPlBo_PiPlLi;
00757     Scatter2DPtr _h_Xp_KPlCh_KPlLi;
00758     Scatter2DPtr _h_Xp_KPlBo_KPlLi;
00759     Scatter2DPtr _h_Xp_KS0Ch_KS0Li;
00760     Scatter2DPtr _h_Xp_KS0Bo_KS0Li;
00761     Scatter2DPtr _h_Xp_PrCh_PrLi;
00762     Scatter2DPtr _h_Xp_PrBo_PrLi;
00763     Scatter2DPtr _h_Xp_LaCh_LaLi;
00764     Scatter2DPtr _h_Xp_LaBo_LaLi;
00765     Scatter2DPtr _h_Xp_K0Ch_K0Li;
00766     Scatter2DPtr _h_Xp_K0Bo_K0Li;
00767     Scatter2DPtr _h_Xp_PhiCh_PhiLi;
00768     Scatter2DPtr _h_Xp_PhiBo_PhiLi;
00769 
00770     Scatter2DPtr _h_PiM_PiP;
00771     Scatter2DPtr _h_KSBar0_KS0;
00772     Scatter2DPtr _h_KM_KP;
00773     Scatter2DPtr _h_Pr_PBar;
00774     Scatter2DPtr _h_Lam_LBar;
00775 
00776     //@}
00777 
00778   };
00779 
00780   // The hook for the plugin system
00781   DECLARE_RIVET_PLUGIN(SLD_1999_S3743934);
00782 
00783 }