rivet is hosted by Hepforge, IPPP Durham
ARGUS_1993_S2653028.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include <iostream>
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/RivetYODA.hh"
00005 #include "Rivet/Tools/ParticleIdUtils.hh"
00006 #include "Rivet/Projections/Beam.hh"
00007 #include "Rivet/Projections/UnstableFinalState.hh"
00008 #include "Rivet/ParticleName.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// @brief BELLE pi+/-, K+/- and proton/antiproton spectrum at Upsilon(4S)
00014   /// @author Peter Richardson
00015   class ARGUS_1993_S2653028 : public Analysis {
00016   public:
00017 
00018     ARGUS_1993_S2653028()
00019       : Analysis("ARGUS_1993_S2653028"), _weightSum(0.)
00020     { }
00021 
00022 
00023     void analyze(const Event& e) {
00024       const double weight = e.weight();
00025 
00026       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00027 
00028       // find the upsilons
00029       ParticleVector upsilons;
00030       // first in unstable final state
00031       foreach (const Particle& p, ufs.particles())
00032         if(p.pdgId()==300553) upsilons.push_back(p);
00033       // then in whole event if fails
00034       if(upsilons.empty()) {
00035         foreach (GenParticle* p, Rivet::particles(e.genEvent())) {
00036           if(p->pdg_id()!=300553) continue;
00037           const GenVertex* pv = p->production_vertex();
00038           bool passed = true;
00039           if (pv) {
00040             for (GenVertex::particles_in_const_iterator pp = pv->particles_in_const_begin() ;
00041                  pp != pv->particles_in_const_end() ; ++pp) {
00042               if ( p->pdg_id() == (*pp)->pdg_id() ) {
00043                 passed = false;
00044                 break;
00045               }
00046             }
00047           }
00048           if(passed) upsilons.push_back(Particle(*p));
00049         }
00050       }
00051 
00052       // find an upsilons
00053       foreach (const Particle& p, upsilons) {
00054         _weightSum += weight;
00055         vector<GenParticle *> pionsA,pionsB,protonsA,protonsB,kaons;
00056         // find the decay products we want
00057         findDecayProducts(p.genParticle(),pionsA,pionsB,
00058                           protonsA,protonsB,kaons);
00059         LorentzTransform cms_boost;
00060         if(p.momentum().vector3().mod()>0.001)
00061           cms_boost = LorentzTransform(-p.momentum().boostVector());
00062         for(unsigned int ix=0;ix<pionsA.size();++ix) {
00063           FourMomentum ptemp(pionsA[ix]->momentum());
00064           FourMomentum p2 = cms_boost.transform(ptemp);
00065           double pcm =
00066             cms_boost.transform(ptemp).vector3().mod();
00067           _histPiA->fill(pcm,weight);
00068         }
00069         _multPiA->fill(10.58,double(pionsA.size())*weight);
00070         for(unsigned int ix=0;ix<pionsB.size();++ix) {
00071           double pcm =
00072             cms_boost.transform(FourMomentum(pionsB[ix]->momentum())).vector3().mod();
00073           _histPiB->fill(pcm,weight);
00074         }
00075         _multPiB->fill(10.58,double(pionsB.size())*weight);
00076         for(unsigned int ix=0;ix<protonsA.size();++ix) {
00077           double pcm =
00078             cms_boost.transform(FourMomentum(protonsA[ix]->momentum())).vector3().mod();
00079           _histpA->fill(pcm,weight);
00080         }
00081         _multpA->fill(10.58,double(protonsA.size())*weight);
00082         for(unsigned int ix=0;ix<protonsB.size();++ix) {
00083           double pcm =
00084             cms_boost.transform(FourMomentum(protonsB[ix]->momentum())).vector3().mod();
00085           _histpB->fill(pcm,weight);
00086         }
00087         _multpB->fill(10.58,double(protonsB.size())*weight);
00088         for(unsigned int ix=0;ix<kaons.size();++ix) {
00089           double pcm =
00090             cms_boost.transform(FourMomentum(kaons[ix]->momentum())).vector3().mod();
00091           _histKA->fill(pcm,weight);
00092           _histKB->fill(pcm,weight);
00093         }
00094         _multK->fill(10.58,double(kaons.size())*weight);
00095       }
00096     } // analyze
00097 
00098     void finalize() {
00099       if(_weightSum>0.) {
00100         scale(_histPiA, 1./_weightSum);
00101         scale(_histPiB, 1./_weightSum);
00102         scale(_histKA , 1./_weightSum);
00103         scale(_histKB , 1./_weightSum);
00104         scale(_histpA , 1./_weightSum);
00105         scale(_histpB , 1./_weightSum);
00106         scale(_multPiA, 1./_weightSum);
00107         scale(_multPiB, 1./_weightSum);
00108         scale(_multK  , 1./_weightSum);
00109         scale(_multpA , 1./_weightSum);
00110         scale(_multpB , 1./_weightSum);
00111       }
00112     } // finalize
00113 
00114 
00115     void init() {
00116       addProjection(UnstableFinalState(), "UFS");
00117 
00118       // spectra
00119       _histPiA = bookHisto1D(1, 1, 1);
00120       _histPiB = bookHisto1D(2, 1, 1);
00121       _histKA  = bookHisto1D(3, 1, 1);
00122       _histKB  = bookHisto1D(6, 1, 1);
00123       _histpA  = bookHisto1D(4, 1, 1);
00124       _histpB  = bookHisto1D(5, 1, 1);
00125       // multiplicities
00126       _multPiA = bookHisto1D( 7, 1, 1);
00127       _multPiB = bookHisto1D( 8, 1, 1);
00128       _multK   = bookHisto1D( 9, 1, 1);
00129       _multpA  = bookHisto1D(10, 1, 1);
00130       _multpB  = bookHisto1D(11, 1, 1);
00131     } // init
00132 
00133   private:
00134 
00135     //@{
00136     // count of weights
00137     double _weightSum;
00138     // Histograms
00139     // spectra
00140     Histo1DPtr _histPiA;
00141     Histo1DPtr _histPiB;
00142     Histo1DPtr _histKA;
00143     Histo1DPtr _histKB;
00144     Histo1DPtr _histpA;
00145     Histo1DPtr _histpB;
00146     // multiplicities
00147     Histo1DPtr _multPiA;
00148     Histo1DPtr _multPiB;
00149     Histo1DPtr _multK;
00150     Histo1DPtr _multpA;
00151     Histo1DPtr _multpB;
00152     //@}
00153 
00154     void findDecayProducts(const GenParticle & p,
00155                            vector<GenParticle *> & pionsA,
00156                            vector<GenParticle *> & pionsB,
00157                            vector<GenParticle *> & protonsA,
00158                            vector<GenParticle *> & protonsB,
00159                            vector<GenParticle *> & kaons) {
00160       int parentId = p.pdg_id();
00161       const GenVertex* dv = p.end_vertex();
00162       for (GenVertex::particles_out_const_iterator
00163              pp = dv->particles_out_const_begin();
00164            pp != dv->particles_out_const_end(); ++pp) {
00165         int id = abs((*pp)->pdg_id());
00166         if(id==PIPLUS) {
00167           if(parentId != LAMBDA && parentId != K0S) {
00168             pionsA.push_back(*pp);
00169             pionsB.push_back(*pp);
00170           }
00171           else
00172             pionsB.push_back(*pp);
00173         }
00174         else if(id==PROTON) {
00175           if(parentId != LAMBDA && parentId != K0S) {
00176             protonsA.push_back(*pp);
00177             protonsB.push_back(*pp);
00178           }
00179           else
00180             protonsB.push_back(*pp);
00181         }
00182         else if(id==KPLUS) {
00183           kaons.push_back(*pp);
00184         }
00185         else if((*pp)->end_vertex())
00186           findDecayProducts(**pp,pionsA,pionsB,
00187                             protonsA,protonsB,kaons);
00188       }
00189     }
00190   };
00191 
00192   // The hook for the plugin system
00193   DECLARE_RIVET_PLUGIN(ARGUS_1993_S2653028);
00194 
00195 }