rivet is hosted by Hepforge, IPPP Durham
ARGUS_1993_S2669951.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_S2669951 : public Analysis {
00016   public:
00017 
00018     ARGUS_1993_S2669951()
00019       : Analysis("ARGUS_1993_S2669951"), _count_etaPrime_highZ(2,0.),
00020         _count_etaPrime_allZ(3,0.), _count_f0(3,0.),
00021         _weightSum_cont(0.),_weightSum_Ups1(0.),_weightSum_Ups2(0.)
00022     { }
00023 
00024 
00025     void analyze(const Event& e) {
00026       const double weight = e.weight();
00027 
00028       const Beam beamproj = applyProjection<Beam>(e, "Beams");
00029       const double s = sqr(beamproj.sqrtS());
00030       const double roots = sqrt(s);
00031       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00032 
00033       // find the upsilons
00034       ParticleVector upsilons;
00035       // first in unstable final state
00036       foreach (const Particle& p, ufs.particles())
00037         if(p.pdgId()==553 || p.pdgId()==100553 ) upsilons.push_back(p);
00038       // then in whole event if fails
00039       if(upsilons.empty()) {
00040         foreach (GenParticle* p, Rivet::particles(e.genEvent())) {
00041           if( p->pdg_id() != 553 && p->pdg_id() != 100553 ) continue;
00042           const GenVertex* pv = p->production_vertex();
00043           bool passed = true;
00044           if (pv) {
00045             for (GenVertex::particles_in_const_iterator
00046                    pp = pv->particles_in_const_begin() ;
00047                  pp != pv->particles_in_const_end() ; ++pp) {
00048               if ( p->pdg_id() == (*pp)->pdg_id() ) {
00049                 passed = false;
00050                 break;
00051               }
00052             }
00053           }
00054           if(passed) upsilons.push_back(Particle(*p));
00055         }
00056       }
00057       // continuum
00058       if(upsilons.empty()) {
00059         _weightSum_cont += weight;
00060         unsigned int nEtaA(0),nEtaB(0),nf0(0);
00061         foreach (const Particle& p, ufs.particles()) {
00062           int id = abs(p.pdgId());
00063           double xp = 2.*p.momentum().t()/roots;
00064           double beta = p.momentum().vector3().mod()/p.momentum().t();
00065           if(id==9010221) {
00066             _hist_cont_f0->fill(xp,weight/beta);
00067             ++nf0;
00068           }
00069           else if(id==331) {
00070             if(xp>0.35) ++nEtaA;
00071             ++nEtaB;
00072           }
00073         }
00074         _count_f0[2]             += nf0*weight;
00075         _count_etaPrime_highZ[1] += nEtaA*weight;
00076         _count_etaPrime_allZ[2]  += nEtaB*weight;
00077       }
00078       else {
00079         // find an upsilons
00080         foreach (const Particle& ups, upsilons) {
00081           int parentId = ups.pdgId();
00082           if(parentId==553)
00083             _weightSum_Ups1 += weight;
00084           else
00085             _weightSum_Ups2 += weight;
00086           ParticleVector unstable;
00087           // find the decay products we want
00088           findDecayProducts(ups.genParticle(),unstable);
00089           LorentzTransform cms_boost;
00090           if(ups.momentum().vector3().mod()>0.001)
00091             cms_boost = LorentzTransform(-ups.momentum().boostVector());
00092           double mass = ups.momentum().mass();
00093           unsigned int nEtaA(0),nEtaB(0),nf0(0);
00094           foreach(const Particle & p , unstable) {
00095             int id = abs(p.pdgId());
00096             FourMomentum p2 = cms_boost.transform(p.momentum());
00097             double xp = 2.*p2.t()/mass;
00098             double beta = p2.vector3().mod()/p2.t();
00099             if(id==9010221) {
00100               if(parentId==553) _hist_Ups1_f0->fill(xp,weight/beta);
00101               else              _hist_Ups2_f0->fill(xp,weight/beta);
00102               ++nf0;
00103             }
00104             else if(id==331) {
00105               if(xp>0.35) ++nEtaA;
00106               ++nEtaB;
00107             }
00108           }
00109           if(parentId==553) {
00110             _count_f0[0]             +=   nf0*weight;
00111             _count_etaPrime_highZ[0] += nEtaA*weight;
00112             _count_etaPrime_allZ[0]  += nEtaB*weight;
00113           }
00114           else {
00115             _count_f0[1] += nf0*weight;
00116             _count_etaPrime_allZ[1] += nEtaB*weight;
00117           }
00118         }
00119       }
00120     } // analyze
00121 
00122     void finalize() {
00123 
00124       // @todo YODA
00125       //AIDA::IDataPointSet * mult_etaPrime_highZ = bookDataPointSet( 1,1,1);
00126       //for (int i = 0; i < mult_etaPrime_highZ->size(); ++i) {
00127       //  if ( fuzzyEquals( 9.905, mult_etaPrime_highZ->point(i)->coordinate(0)->value(), 0.001) &&
00128       //       _weightSum_cont>0.)
00129       //    mult_etaPrime_highZ->point(i)->coordinate(1)->setValue( _count_etaPrime_highZ[1]/_weightSum_cont);
00130       //  else if ( fuzzyEquals( 9.46, mult_etaPrime_highZ->point(i)->coordinate(0)->value(), 0.001) &&
00131       //            _weightSum_Ups1>0.)
00132       //    mult_etaPrime_highZ->point(i)->coordinate(1)->setValue(_count_etaPrime_highZ[0]/_weightSum_Ups1);
00133       //}
00134       //AIDA::IDataPointSet * mult_etaPrime_allZ = bookDataPointSet( 1,1,2);
00135       //for (int i = 0; i < mult_etaPrime_allZ->size(); ++i) {
00136       //  if ( fuzzyEquals( 9.905, mult_etaPrime_allZ->point(i)->coordinate(0)->value(), 0.001) &&
00137       //       _weightSum_cont>0.) {
00138       //    mult_etaPrime_allZ->point(i)->coordinate(1)->setValue( _count_etaPrime_allZ[2]/_weightSum_cont);
00139       //  }
00140       //  else if ( fuzzyEquals( 9.46, mult_etaPrime_allZ->point(i)->coordinate(0)->value(), 0.001) &&
00141       //            _weightSum_Ups1>0.) {
00142       //    mult_etaPrime_allZ->point(i)->coordinate(1)->setValue(_count_etaPrime_allZ[0]/_weightSum_Ups1);
00143       //  }
00144       //  else if ( fuzzyEquals( 10.02, mult_etaPrime_allZ->point(i)->coordinate(0)->value(), 0.001) &&
00145       //            _weightSum_Ups2>0.) {
00146       //    mult_etaPrime_allZ->point(i)->coordinate(1)->setValue(_count_etaPrime_allZ[1]/_weightSum_Ups2);
00147       //  }
00148       //}
00149       //AIDA::IDataPointSet * mult_f0 = bookDataPointSet( 5,1,1);
00150       //for (int i = 0; i < mult_f0->size(); ++i) {
00151       //  if ( fuzzyEquals( 10.45, mult_f0->point(i)->coordinate(0)->value(), 0.001) &&
00152       //       _weightSum_cont>0.) {
00153       //    mult_f0->point(i)->coordinate(1)->setValue( _count_f0[2]/_weightSum_cont);
00154       //  }
00155       //  else if ( fuzzyEquals( 9.46, mult_f0->point(i)->coordinate(0)->value(), 0.001) &&
00156       //            _weightSum_Ups1>0.) {
00157       //    mult_f0->point(i)->coordinate(1)->setValue(_count_f0[0]/_weightSum_Ups1);
00158       //  }
00159       //  else if ( fuzzyEquals( 10.02, mult_f0->point(i)->coordinate(0)->value(), 0.001) &&
00160       //            _weightSum_Ups2>0.) {
00161       //    mult_f0->point(i)->coordinate(1)->setValue(_count_f0[1]/_weightSum_Ups2);
00162       //  }
00163       //}
00164 
00165       if(_weightSum_cont>0.) scale(_hist_cont_f0, 1./_weightSum_cont);
00166       if(_weightSum_Ups1>0.) scale(_hist_Ups1_f0, 1./_weightSum_Ups1);
00167       if(_weightSum_Ups2>0.) scale(_hist_Ups2_f0, 1./_weightSum_Ups2);
00168 
00169     } // finalize
00170 
00171 
00172     void init() {
00173       addProjection(Beam(), "Beams");
00174       addProjection(UnstableFinalState(), "UFS");
00175 
00176       _hist_cont_f0 = bookHisto1D( 2,1,1);
00177       _hist_Ups1_f0 = bookHisto1D( 3,1,1);
00178       _hist_Ups2_f0 = bookHisto1D( 4,1,1);
00179     } // init
00180 
00181     private:
00182 
00183     //@{
00184     vector<double> _count_etaPrime_highZ;
00185     vector<double> _count_etaPrime_allZ;
00186     vector<double> _count_f0;
00187 
00188     Histo1DPtr _hist_cont_f0;
00189     Histo1DPtr _hist_Ups1_f0;
00190     Histo1DPtr _hist_Ups2_f0;
00191 
00192     // count of weights
00193     double _weightSum_cont,_weightSum_Ups1,_weightSum_Ups2;
00194     //@}
00195 
00196     void findDecayProducts(const GenParticle & p,
00197                            ParticleVector & unstable) {
00198       const GenVertex* dv = p.end_vertex();
00199       for (GenVertex::particles_out_const_iterator
00200              pp = dv->particles_out_const_begin();
00201            pp != dv->particles_out_const_end(); ++pp) {
00202         int id = abs((*pp)->pdg_id());
00203         if(id == 331 || id == 9010221 ) {
00204           unstable.push_back(Particle(**pp));
00205         }
00206         else if((*pp)->end_vertex())
00207           findDecayProducts(**pp,unstable);
00208       }
00209     }
00210   };
00211 
00212   // The hook for the plugin system
00213   DECLARE_RIVET_PLUGIN(ARGUS_1993_S2669951);
00214 
00215 }
00216