rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

CLEOC_2007_I761696

Cross section for $D\bar{D}$ production near the $\psi(3770)$ resonance
Experiment: CLEOC (CESR)
Inspire ID: 761696
Status: VALIDATED NOHEPDATA
Authors:
  • Peter Richardson
References:
  • Phys.Rev.D 76 (2007) 112001
Beams: e+ e-
Beam energies: (1.9, 1.9) GeV
Run details:
  • e+e- > hadrons

Measurement of the cross section for $D\bar{D}$ production near the $\psi(3770)$ resonance by CLEO-c.

Source code: CLEOC_2007_I761696.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/FinalState.hh"
  4#include "Rivet/Projections/UnstableParticles.hh"
  5
  6namespace Rivet {
  7
  8
  9  /// @brief e+ e- > D Dbar
 10  class CLEOC_2007_I761696 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(CLEOC_2007_I761696);
 15
 16
 17    /// @name Analysis methods
 18    /// @{
 19
 20    /// Book histograms and initialise projections before the run
 21    void init() {
 22      // Initialise and register projections
 23      declare(FinalState(), "FS");
 24      declare(UnstableParticles(Cuts::abspid==411 || Cuts::abspid==421), "UFS");
 25      // histograms
 26      for (unsigned int ix=0;ix<3;++ix) {
 27        book(_h[ix],1,1,1+ix);
 28      }
 29    }
 30
 31    void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
 32      for (const Particle &child : p.children()) {
 33        if(child.children().empty()) {
 34          nRes[child.pid()]-=1;
 35          --ncount;
 36        }
 37        else {
 38          findChildren(child,nRes,ncount);
 39        }
 40      }
 41    }
 42
 43    /// Perform the per-event analysis
 44    void analyze(const Event& event) {
 45      const FinalState& fs = apply<FinalState>(event, "FS");
 46
 47      map<long,int> nCount;
 48      int ntotal(0);
 49      for (const Particle& p : fs.particles()) {
 50      	nCount[p.pid()] += 1;
 51      	++ntotal;
 52      }
 53      const FinalState& ufs = apply<FinalState>(event, "UFS");
 54      for (const Particle & p1 : ufs.particles()) {
 55        if (p1.pid()<0) continue;
 56        map<long,int> nRes = nCount;
 57        int ncount = ntotal;
 58        findChildren(p1,nRes,ncount);
 59        bool matched=false;
 60        for (const Particle & p2 : ufs.particles()) {
 61          if(p2.pid()!=-p1.pid()) continue;
 62          map<long,int> nRes2 = nRes;
 63          int ncount2 = ncount;
 64          findChildren(p2,nRes2,ncount2);
 65          if(ncount2!=0) continue;
 66          matched=true;
 67          for (auto const & val : nRes2) {
 68            if (val.second!=0) {
 69              matched = false;
 70              break;
 71            }
 72          }
 73          if (matched) break;
 74        }
 75        if (matched) {
 76          _h[2]->fill(round(sqrtS()/MeV));
 77          if(p1.abspid()==421)      _h[0]->fill(round(sqrtS()/MeV));
 78          else if(p1.abspid()==411) _h[1]->fill(round(sqrtS()/MeV));
 79          break;
 80        }
 81      }
 82    }
 83
 84
 85    /// Normalise histograms etc., after the run
 86    void finalize() {
 87      scale(_h, crossSection()/sumOfWeights()/nanobarn);
 88      BinnedEstimatePtr<int> ratio;
 89      book(ratio, 1, 1, 4);
 90      divide(_h[1], _h[0], ratio);
 91    }
 92
 93    /// @}
 94
 95
 96    /// @name Histograms
 97    /// @{
 98    BinnedHistoPtr<int> _h[3];
 99    /// @}
100
101
102  };
103
104
105  RIVET_DECLARE_PLUGIN(CLEOC_2007_I761696);
106
107}