rivet is hosted by Hepforge, IPPP Durham
ARGUS_1993_S2789213.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include <iostream>
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/Projections/Beam.hh"
00005 #include "Rivet/Projections/UnstableFinalState.hh"
00006 #include "Rivet/ParticleName.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief ARGUS vector meson production
00012   /// @author Peter Richardson
00013   class ARGUS_1993_S2789213 : public Analysis {
00014   public:
00015 
00016     ARGUS_1993_S2789213()
00017       : Analysis("ARGUS_1993_S2789213"),
00018         _weightSum_cont(0.),_weightSum_Ups1(0.),_weightSum_Ups4(0.)
00019     { }
00020 
00021 
00022     void init() {
00023       addProjection(Beam(), "Beams");
00024       addProjection(UnstableFinalState(), "UFS");
00025 
00026       _mult_cont_Omega     = bookHisto1D( 1, 1, 1);
00027       _mult_cont_Rho0      = bookHisto1D( 1, 1, 2);
00028       _mult_cont_KStar0    = bookHisto1D( 1, 1, 3);
00029       _mult_cont_KStarPlus = bookHisto1D( 1, 1, 4);
00030       _mult_cont_Phi       = bookHisto1D( 1, 1, 5);
00031 
00032       _mult_Ups1_Omega     = bookHisto1D( 2, 1, 1);
00033       _mult_Ups1_Rho0      = bookHisto1D( 2, 1, 2);
00034       _mult_Ups1_KStar0    = bookHisto1D( 2, 1, 3);
00035       _mult_Ups1_KStarPlus = bookHisto1D( 2, 1, 4);
00036       _mult_Ups1_Phi       = bookHisto1D( 2, 1, 5);
00037 
00038       _mult_Ups4_Omega     = bookHisto1D( 3, 1, 1);
00039       _mult_Ups4_Rho0      = bookHisto1D( 3, 1, 2);
00040       _mult_Ups4_KStar0    = bookHisto1D( 3, 1, 3);
00041       _mult_Ups4_KStarPlus = bookHisto1D( 3, 1, 4);
00042       _mult_Ups4_Phi       = bookHisto1D( 3, 1, 5);
00043 
00044       _hist_cont_KStarPlus = bookHisto1D( 4, 1, 1);
00045       _hist_Ups1_KStarPlus = bookHisto1D( 5, 1, 1);
00046       _hist_Ups4_KStarPlus = bookHisto1D( 6, 1, 1);
00047 
00048       _hist_cont_KStar0    = bookHisto1D( 7, 1, 1);
00049       _hist_Ups1_KStar0    = bookHisto1D( 8, 1, 1);
00050       _hist_Ups4_KStar0    = bookHisto1D( 9, 1, 1);
00051 
00052       _hist_cont_Rho0      = bookHisto1D(10, 1, 1);
00053       _hist_Ups1_Rho0      = bookHisto1D(11, 1, 1);
00054       _hist_Ups4_Rho0      = bookHisto1D(12, 1, 1);
00055 
00056       _hist_cont_Omega     = bookHisto1D(13, 1, 1);
00057       _hist_Ups1_Omega     = bookHisto1D(14, 1, 1);
00058     } // init
00059 
00060 
00061     void analyze(const Event& e) {
00062       const double weight = e.weight();
00063 
00064       const Beam beamproj = applyProjection<Beam>(e, "Beams");
00065       const double s = sqr(beamproj.sqrtS());
00066       const double roots = sqrt(s);
00067 
00068       // Find the upsilons
00069       Particles upsilons;
00070       // First in unstable final state
00071       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00072       foreach (const Particle& p, ufs.particles())
00073         if (p.pid() == 300553 || p.pid() == 553) upsilons.push_back(p);
00074       // Then in whole event if that failed
00075       if (upsilons.empty()) {
00076         foreach (const GenParticle* p, Rivet::particles(e.genEvent())) {
00077           if (p->pdg_id() != 300553 && p->pdg_id() != 553) continue;
00078           const GenVertex* pv = p->production_vertex();
00079           bool passed = true;
00080           if (pv) {
00081             foreach (const GenParticle* pp, particles_in(pv)) {
00082               if ( p->pdg_id() == pp->pdg_id() ) {
00083                 passed = false;
00084                 break;
00085               }
00086             }
00087           }
00088           if (passed) upsilons.push_back(Particle(*p));
00089         }
00090       }
00091 
00092       // continuum
00093       if (upsilons.empty()) {
00094         _weightSum_cont += weight;
00095         unsigned int nOmega(0),nRho0(0),nKStar0(0),nKStarPlus(0),nPhi(0);
00096         foreach (const Particle& p, ufs.particles()) {
00097           int id = p.abspid();
00098           double xp = 2.*p.E()/roots;
00099           double beta = p.p3().mod()/p.E();
00100           if (id == 113) {
00101             _hist_cont_Rho0->fill(xp,weight/beta);
00102             ++nRho0;
00103           }
00104           else if (id == 313) {
00105             _hist_cont_KStar0->fill(xp,weight/beta);
00106             ++nKStar0;
00107           }
00108           else if (id == 223) {
00109             _hist_cont_Omega->fill(xp,weight/beta);
00110             ++nOmega;
00111           }
00112           else if (id == 323) {
00113             _hist_cont_KStarPlus->fill(xp,weight/beta);
00114             ++nKStarPlus;
00115           }
00116           else if (id == 333) {
00117             ++nPhi;
00118           }
00119         }
00120         /// @todo Replace with Counters and fill one-point Scatters at the end
00121         _mult_cont_Omega    ->fill(10.45,weight*nOmega    );
00122         _mult_cont_Rho0     ->fill(10.45,weight*nRho0     );
00123         _mult_cont_KStar0   ->fill(10.45,weight*nKStar0   );
00124         _mult_cont_KStarPlus->fill(10.45,weight*nKStarPlus);
00125         _mult_cont_Phi      ->fill(10.45,weight*nPhi      );
00126       }
00127       else {
00128         // find an upsilon
00129         foreach (const Particle& ups, upsilons) {
00130           int parentId = ups.pid();
00131           if (parentId == 553)
00132             _weightSum_Ups1 += weight;
00133           else
00134             _weightSum_Ups4 += weight;
00135           Particles unstable;
00136           // find the decay products we want
00137           findDecayProducts(ups.genParticle(),unstable);
00138           LorentzTransform cms_boost;
00139           if (ups.p3().mod() > 0.001)
00140             cms_boost = LorentzTransform(-ups.momentum().boostVector());
00141           double mass = ups.mass();
00142           unsigned int nOmega(0),nRho0(0),nKStar0(0),nKStarPlus(0),nPhi(0);
00143           foreach(const Particle & p , unstable) {
00144             int id = p.abspid();
00145             FourMomentum p2 = cms_boost.transform(p.momentum());
00146             double xp = 2.*p2.E()/mass;
00147             double beta = p2.p3().mod()/p2.E();
00148             if (id == 113) {
00149               if (parentId == 553) _hist_Ups1_Rho0->fill(xp,weight/beta);
00150               else                 _hist_Ups4_Rho0->fill(xp,weight/beta);
00151               ++nRho0;
00152             }
00153             else if (id == 313) {
00154               if (parentId == 553) _hist_Ups1_KStar0->fill(xp,weight/beta);
00155               else                 _hist_Ups4_KStar0->fill(xp,weight/beta);
00156               ++nKStar0;
00157             }
00158             else if (id == 223) {
00159               if (parentId == 553) _hist_Ups1_Omega->fill(xp,weight/beta);
00160               ++nOmega;
00161             }
00162             else if (id == 323) {
00163               if (parentId == 553) _hist_Ups1_KStarPlus->fill(xp,weight/beta);
00164               else                 _hist_Ups4_KStarPlus->fill(xp,weight/beta);
00165               ++nKStarPlus;
00166             }
00167             else if (id == 333) {
00168               ++nPhi;
00169             }
00170           }
00171           if (parentId == 553) {
00172             _mult_Ups1_Omega    ->fill(9.46,weight*nOmega    );
00173             _mult_Ups1_Rho0     ->fill(9.46,weight*nRho0     );
00174             _mult_Ups1_KStar0   ->fill(9.46,weight*nKStar0   );
00175             _mult_Ups1_KStarPlus->fill(9.46,weight*nKStarPlus);
00176             _mult_Ups1_Phi      ->fill(9.46,weight*nPhi      );
00177           }
00178           else {
00179             _mult_Ups4_Omega    ->fill(10.58,weight*nOmega    );
00180             _mult_Ups4_Rho0     ->fill(10.58,weight*nRho0     );
00181             _mult_Ups4_KStar0   ->fill(10.58,weight*nKStar0   );
00182             _mult_Ups4_KStarPlus->fill(10.58,weight*nKStarPlus);
00183             _mult_Ups4_Phi      ->fill(10.58,weight*nPhi      );
00184           }
00185         }
00186       }
00187     } // analyze
00188 
00189 
00190     void finalize() {
00191       if (_weightSum_cont > 0.) {
00192         /// @todo Replace with Counters and fill one-point Scatters at the end
00193         scale(_mult_cont_Omega    , 1./_weightSum_cont);
00194         scale(_mult_cont_Rho0     , 1./_weightSum_cont);
00195         scale(_mult_cont_KStar0   , 1./_weightSum_cont);
00196         scale(_mult_cont_KStarPlus, 1./_weightSum_cont);
00197         scale(_mult_cont_Phi      , 1./_weightSum_cont);
00198         scale(_hist_cont_KStarPlus, 1./_weightSum_cont);
00199         scale(_hist_cont_KStar0   , 1./_weightSum_cont);
00200         scale(_hist_cont_Rho0     , 1./_weightSum_cont);
00201         scale(_hist_cont_Omega    , 1./_weightSum_cont);
00202       }
00203       if (_weightSum_Ups1 > 0.) {
00204         /// @todo Replace with Counters and fill one-point Scatters at the end
00205         scale(_mult_Ups1_Omega    , 1./_weightSum_Ups1);
00206         scale(_mult_Ups1_Rho0     , 1./_weightSum_Ups1);
00207         scale(_mult_Ups1_KStar0   , 1./_weightSum_Ups1);
00208         scale(_mult_Ups1_KStarPlus, 1./_weightSum_Ups1);
00209         scale(_mult_Ups1_Phi      , 1./_weightSum_Ups1);
00210         scale(_hist_Ups1_KStarPlus, 1./_weightSum_Ups1);
00211         scale(_hist_Ups1_KStar0   , 1./_weightSum_Ups1);
00212         scale(_hist_Ups1_Rho0     , 1./_weightSum_Ups1);
00213         scale(_hist_Ups1_Omega    , 1./_weightSum_Ups1);
00214       }
00215       if (_weightSum_Ups4 > 0.) {
00216         /// @todo Replace with Counters and fill one-point Scatters at the end
00217         scale(_mult_Ups4_Omega    , 1./_weightSum_Ups4);
00218         scale(_mult_Ups4_Rho0     , 1./_weightSum_Ups4);
00219         scale(_mult_Ups4_KStar0   , 1./_weightSum_Ups4);
00220         scale(_mult_Ups4_KStarPlus, 1./_weightSum_Ups4);
00221         scale(_mult_Ups4_Phi      , 1./_weightSum_Ups4);
00222         scale(_hist_Ups4_KStarPlus, 1./_weightSum_Ups4);
00223         scale(_hist_Ups4_KStar0   , 1./_weightSum_Ups4);
00224         scale(_hist_Ups4_Rho0     , 1./_weightSum_Ups4);
00225       }
00226     } // finalize
00227 
00228 
00229   private:
00230 
00231     //@{
00232     Histo1DPtr _mult_cont_Omega    ;
00233     Histo1DPtr _mult_cont_Rho0     ;
00234     Histo1DPtr _mult_cont_KStar0   ;
00235     Histo1DPtr _mult_cont_KStarPlus;
00236     Histo1DPtr _mult_cont_Phi      ;
00237 
00238     Histo1DPtr _mult_Ups1_Omega    ;
00239     Histo1DPtr _mult_Ups1_Rho0     ;
00240     Histo1DPtr _mult_Ups1_KStar0   ;
00241     Histo1DPtr _mult_Ups1_KStarPlus;
00242     Histo1DPtr _mult_Ups1_Phi      ;
00243 
00244     Histo1DPtr _mult_Ups4_Omega    ;
00245     Histo1DPtr _mult_Ups4_Rho0     ;
00246     Histo1DPtr _mult_Ups4_KStar0   ;
00247     Histo1DPtr _mult_Ups4_KStarPlus;
00248     Histo1DPtr _mult_Ups4_Phi      ;
00249 
00250     Histo1DPtr _hist_cont_KStarPlus;
00251     Histo1DPtr _hist_Ups1_KStarPlus;
00252     Histo1DPtr _hist_Ups4_KStarPlus;
00253 
00254     Histo1DPtr _hist_cont_KStar0   ;
00255     Histo1DPtr _hist_Ups1_KStar0   ;
00256     Histo1DPtr _hist_Ups4_KStar0   ;
00257 
00258     Histo1DPtr _hist_cont_Rho0     ;
00259     Histo1DPtr _hist_Ups1_Rho0     ;
00260     Histo1DPtr _hist_Ups4_Rho0     ;
00261 
00262     Histo1DPtr _hist_cont_Omega    ;
00263     Histo1DPtr _hist_Ups1_Omega    ;
00264 
00265     double _weightSum_cont,_weightSum_Ups1,_weightSum_Ups4;
00266     //@}
00267 
00268 
00269     void findDecayProducts(const GenParticle* p, Particles& unstable) {
00270       const GenVertex* dv = p->end_vertex();
00271       /// @todo Use better looping
00272       for (GenVertex::particles_out_const_iterator pp = dv->particles_out_const_begin(); pp != dv->particles_out_const_end(); ++pp) {
00273         int id = abs((*pp)->pdg_id());
00274         if (id == 113 || id == 313 || id == 323 ||
00275             id == 333 || id == 223 ) {
00276           unstable.push_back(Particle(*pp));
00277         }
00278         else if ((*pp)->end_vertex())
00279           findDecayProducts(*pp, unstable);
00280       }
00281     }
00282 
00283   };
00284 
00285 
00286   // The hook for the plugin system
00287   DECLARE_RIVET_PLUGIN(ARGUS_1993_S2789213);
00288 
00289 }