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