rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BABAR_2009_I815035

Cross section for $e^+e^-\to D^{*0}\bar{D}^{0}$, $D^{*+}\bar{D}^{-}$ and $D^{*}\bar{D}^{*}$
Experiment: BABAR (PEP-II)
Inspire ID: 815035
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Phys.Rev. D79 (2009) 092001
Beams: e+ e-
Beam energies: ANY
Run details:
  • e+e- to hadrons

Measurement of the cross section for $e^+e^-\to D^{*0}\bar{D}^{0}$, $D^{*+}\bar{D}^{-}$ and $D^{*}\bar{D}^{*}$ by the BaBar collaboration.

Source code: BABAR_2009_I815035.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 D D* and D* D* cross section
 10  class BABAR_2009_I815035 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2009_I815035);
 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(), "UFS");
 25
 26      // Book histograms
 27      book(_c_D0_Dstar   ,"/TMP/c_D0_Dstar"   );
 28      book(_c_Dplus_Dstar,"/TMP/c_Dplus_Dstar");
 29      book(_c_D_Dstar    ,"/TMP/c_D_Dstar"    );
 30      book(_c_Dstar_Dstar,"/TMP/c_Dstar_Dstar");
 31    }
 32
 33
 34    void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
 35      for(const Particle &child : p.children()) {
 36	if(child.children().empty()) {
 37	  nRes[child.pid()]-=1;
 38	  --ncount;
 39	}
 40	else
 41	  findChildren(child,nRes,ncount);
 42      }
 43    }
 44
 45    /// Perform the per-event analysis
 46    void analyze(const Event& event) {
 47      const FinalState& fs = apply<FinalState>(event, "FS");
 48      // total hadronic and muonic cross sections
 49      map<long,int> nCount;
 50      int ntotal(0);
 51      for (const Particle& p : fs.particles()) {
 52      	nCount[p.pid()] += 1;
 53      	++ntotal;
 54      }
 55      // unstable charm analysis
 56      Particles ds = apply<UnstableParticles>(event, "UFS").particles(Cuts::abspid==411 or Cuts::abspid==413 or
 57								      Cuts::abspid==421 or Cuts::abspid==423);
 58      for(unsigned int ix=0;ix<ds.size();++ix) {
 59	const Particle& p1 = ds[ix];
 60       	int id1 = abs(p1.pid());
 61	// check fs
 62	bool fs = true;
 63	for (const Particle & child : p1.children()) {
 64	  if(child.pid()==p1.pid()) {
 65	    fs = false;
 66	    break;
 67	  }
 68	}
 69      	if(!fs) continue;
 70      	// find the children
 71      	map<long,int> nRes = nCount;
 72      	int ncount = ntotal;
 73      	findChildren(p1,nRes,ncount);
 74      	bool matched=false;
 75       	int sign = p1.pid()/id1;
 76      	// loop over the other fs particles
 77       	for(unsigned int iy=ix+1;iy<ds.size();++iy) {
 78      	  const Particle& p2 = ds[iy];
 79      	  fs = true;
 80      	  for (const Particle & child : p2.children()) {
 81      	    if(child.pid()==p2.pid()) {
 82      	      fs = false;
 83      	      break;
 84      	    }
 85      	  }
 86      	  if(!fs) continue;
 87      	  if(p2.pid()/abs(p2.pid())==sign) continue;
 88	  int id2 = abs(p2.pid());
 89	  if(!p2.parents().empty() && p2.parents()[0].pid()==p1.pid())
 90	    continue;
 91	  map<long,int> nRes2 = nRes;
 92	  int ncount2 = ncount;
 93	  findChildren(p2,nRes2,ncount2);
 94	  if(ncount2!=0) continue;
 95	  matched=true;
 96	  for(auto const & val : nRes2) {
 97	    if(val.second!=0) {
 98	      matched = false;
 99	      break;
100	    }
101	  }
102	  if(matched) {
103       	    if((id1==421 && id2==423) || (id1==423 && id2==421)) {
104	      _c_D0_Dstar->fill();
105	      _c_D_Dstar ->fill();
106	    }
107	    else if((id1==411 && id2==413) || (id1==413 && id2==411)) {
108	      _c_Dplus_Dstar->fill();
109	      _c_D_Dstar ->fill();
110	    }
111	    else if((id1==413 && id2==413) || (id1==423 && id2==423)) {
112	      _c_Dstar_Dstar->fill();
113	    }
114	    break;
115       	  }
116       	}
117       	if(matched) break;
118      }
119    }
120
121
122    /// Normalise histograms etc., after the run
123    void finalize() {
124      double fact = crossSection()/ sumOfWeights()/nanobarn;
125      for(unsigned int ih=1;ih<5;++ih) {
126	double sigma = 0.0, error = 0.0;
127	unsigned int ix=1,iy=ih;
128	if(ih==1) {
129	  sigma = _c_D0_Dstar->val()*fact;
130	  error = _c_D0_Dstar->err()*fact;
131	}
132	else if(ih==2) {
133	  sigma = _c_Dplus_Dstar->val()*fact;
134	  error = _c_Dplus_Dstar->err()*fact;
135	}
136	else if(ih==3) {
137	  sigma = _c_D_Dstar->val()*fact;
138	  error = _c_D_Dstar->err()*fact;
139	}
140	else if(ih==4) {
141	  sigma = _c_Dstar_Dstar->val()*fact;
142	  error = _c_Dstar_Dstar->err()*fact;
143	  ix=2;
144	  iy=1;
145	}
146	Scatter2D temphisto(refData(ix, 1, iy));
147        Scatter2DPtr     mult;
148        book(mult, ix, 1, iy);
149        for (size_t b = 0; b < temphisto.numPoints(); b++) {
150          const double x  = temphisto.point(b).x();
151          pair<double,double> ex = temphisto.point(b).xErrs();
152          pair<double,double> ex2 = ex;
153          if(ex2.first ==0.) ex2. first=0.0001;
154          if(ex2.second==0.) ex2.second=0.0001;
155          if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
156            mult   ->addPoint(x, sigma, ex, make_pair(error,error));
157          }
158          else {
159            mult   ->addPoint(x, 0., ex, make_pair(0.,.0));
160          }
161        }
162      }
163    }
164
165    ///@}
166
167
168    /// @name Histograms
169    ///@{
170    CounterPtr _c_D0_Dstar,_c_Dplus_Dstar,_c_D_Dstar, _c_Dstar_Dstar;
171    ///@}
172
173
174  };
175
176
177  RIVET_DECLARE_PLUGIN(BABAR_2009_I815035);
178
179}