rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

CLEOC_2008_I777917

Measurement of charm final-states, the total hadronic cross section and $R$ for energies between 3.92 and 4.26 GeV
Experiment: CLEOC (CESR)
Inspire ID: 777917
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Phys.Rev. D80 (2009) 072001, 2009
Beams: e- e+
Beam energies: ANY
Run details:
  • e+ e- to hadrons and e+ e- to mu+ mu- (for normalization)

Measurement of charm final-states, the total hadronic cross section and $R$ for energies between 3.92 and 4.26 GeV The muonic cross section is also outputted to the yoda file so that ratio $R$ can be recalcuated if runs are combined.

Source code: CLEOC_2008_I777917.cc
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Projections/UnstableParticles.hh"

namespace Rivet {


  /// @brief Add a short analysis description here
  class CLEOC_2008_I777917 : public Analysis {
  public:

    /// Constructor
    DEFAULT_RIVET_ANALYSIS_CTOR(CLEOC_2008_I777917);


    /// @name Analysis methods
    //@{

    /// Book histograms and initialise projections before the run
    void init() {

      // Initialise and register projections
      declare(FinalState(), "FS");
      declare(UnstableParticles(), "UFS");
      book(_c_hadrons, "/TMP/sigma_hadrons");
      book(_c_muons, "/TMP/sigma_muons");
      book(_c_D0D0, "/TMP/sigma_D0D0");
      book(_c_DpDm, "/TMP/sigma_DpDm");
      book(_c_DsDs, "/TMP/sigma_DsDs");
      book(_c_D0D0S, "/TMP/sigma_D0D0S");
      book(_c_DpDmS, "/TMP/sigma_DpDmS");
      book(_c_DsDsS, "/TMP/sigma_DsDsS");
      book(_c_D0SD0S, "/TMP/sigma_D0SD0S");
      book(_c_DpSDmS, "/TMP/sigma_DpSDmS");
      book(_c_DsSDsS, "/TMP/sigma_DsSDsS");
      book(_c_DD, "/TMP/sigma_DD");
      book(_c_DDX, "/TMP/sigma_DDX");
      book(_c_DSDpi, "/TMP/sigma_DSDpi");
      book(_c_DSDSpi, "/TMP/sigma_DSDSpi");
    }

    void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
      for (const Particle &child : p.children()) {
	if(child.children().empty()) {
	  nRes[child.pid()]-=1;
	  --ncount;
	}
	else
	  findChildren(child,nRes,ncount);
      }
    }


    /// Perform the per-event analysis
    void analyze(const Event& event) {
      const FinalState& fs = apply<FinalState>(event, "FS");
      // total hadronic and muonic cross sections
      map<long,int> nCount;
      int ntotal(0);
      for (const Particle& p : fs.particles()) {
	nCount[p.pid()] += 1;
	++ntotal;
      }
      // mu+mu- + photons
      if(nCount[-13]==1 and nCount[13]==1 &&
	 ntotal==2+nCount[22])
	_c_muons->fill();
      // everything else
      else
	_c_hadrons->fill();
      // identified final state with D mesons
      const FinalState& ufs = apply<UnstableParticles>(event, "UFS");
      for(unsigned int ix=0;ix<ufs.particles().size();++ix) {
	const Particle& p1 = ufs.particles()[ix];
	int id1 = abs(p1.pid());
	if(id1 != 411 && id1 != 413 && id1 != 421 && id1 != 423 &&
	   id1 != 431 && id1 != 433)
	  continue;
	// check fs
	bool fs = true;
	for (const Particle & child : p1.children()) {
	  if(child.pid()==p1.pid()) {
	    fs = false;
	    break;
	  }
	}
	if(!fs) continue;
	// find the children
	map<long,int> nRes = nCount;
	int ncount = ntotal;
	findChildren(p1,nRes,ncount);
	bool matched=false;
	int sign = p1.pid()/id1;
	// loop over the other fs particles
	for(unsigned int iy=ix+1;iy<ufs.particles().size();++iy) {
	  const Particle& p2 = ufs.particles()[iy];
	  fs = true;
	  for (const Particle & child : p2.children()) {
	    if(child.pid()==p2.pid()) {
	      fs = false;
	      break;
	    }
	  }
	  if(!fs) continue;
	  if(p2.pid()/abs(p2.pid())==sign) continue;
	  int id2 = abs(p2.pid());
	  if(id2 != 411 && id2 != 413 && id2 != 421 && id2 != 423 &&
	     id2 != 431 && id2 != 433)
	    continue;
	  if(!p2.parents().empty() && p2.parents()[0].pid()==p1.pid())
	    continue;
	  if((id1==411 || id1==421 || id1==431) && (id2==411 || id2==421 || id2==431 ))
	    _c_DDX->fill();
	  map<long,int> nRes2 = nRes;
	  int ncount2 = ncount;
	  findChildren(p2,nRes2,ncount2);
	  if(ncount2==0) {
	    matched=true;
	    for(auto const & val : nRes2) {
	      if(val.second!=0) {
		matched = false;
		break;
	      }
	    }
	    if(matched) {
	      if(id1==411 && id2==411) {
		_c_DpDm->fill();
		_c_DD  ->fill();
	      }
	      else if(id1==421&& id2==421) {
		_c_D0D0->fill();
		_c_DD  ->fill();
	      }
	      else if(id1==431&& id2==431) {
		_c_DsDs->fill();
	      }
	      else if(id1==413 && id2==413) {
		_c_DpSDmS->fill();
	      }
	      else if(id1==423&& id2==423) {
		_c_D0SD0S->fill();
	      }
	      else if(id1==433&& id2==433) {
		_c_DsSDsS->fill();
	      }
	      else if((id1==421 && id2==423) ||
		      (id1==423 && id2==421)) {
		_c_D0D0S->fill();
	      }
	      else if((id1==411 && id2==413) ||
		      (id1==413 && id2==411)) {
		_c_DpDmS->fill();
	      }
	      else if((id1==431 && id2==433) ||
		      (id1==433 && id2==431)) {
		_c_DsDsS->fill();
	      }
	    }
	  }
	  else if(ncount2==1) {
	    int ipi=0;
	    if(nRes2[111]==1 && nRes2[211]==0 && nRes[-211]==0 )
	      ipi = 111;
	    else if(nRes2[111]==0 && nRes2[211]==1 && nRes[-211]==0 )
	      ipi = 211;
	    else if(nRes2[111]==0 && nRes2[211]==0 && nRes[-211]==1 )
	      ipi =-211;
	    if(ipi==0) continue;
	    matched=true;
	    for(auto const & val : nRes2) {
	      if(val.first==ipi)
		continue;
	      else if(val.second!=0) {
		matched = false;
		break;
	      }
	    }
	    if(matched) {
	      bool Ddecay = false;
	      Particle mother = p1;
	      while (!mother.parents().empty()) {
		mother = mother.parents()[0];
		if(PID::isCharmMeson(mother.pid()) && mother.pid()!=p1.pid()) {
		  Ddecay = true;
		  break;
		}
	      }
	      mother = p2;
	      while (!mother.parents().empty()) {
		mother = mother.parents()[0];
		if(PID::isCharmMeson(mother.pid()) && mother.pid()!=p1.pid()) {
		  Ddecay = true;
		  break;
		}
	      }
	      if(Ddecay) continue;
	      if((id1==413 || id1==423 ) &&
		 (id2==413 || id2==423 )) {
		_c_DSDSpi->fill();
	      }
	      else if((id1==411 || id1==421 ) &&
		      (id2==413 || id2==423 )) {
		_c_DSDpi->fill();
	      }
	      else if((id1==413 || id1==423 ) &&
		      (id2==411 || id2==421 )) {
		_c_DSDpi->fill();
	      }
	    }
	  }
	}
      }
    }

    /// Normalise histograms etc., after the run
    void finalize() {
      // R
      Scatter1D R = *_c_hadrons/ *_c_muons;
      double              rval = R.point(0).x();
      pair<double,double> rerr = R.point(0).xErrs();
      double fact = crossSection()/ sumOfWeights() /nanobarn;
      double sig_h = _c_hadrons->val()*fact;
      double err_h = _c_hadrons->err()*fact;
      double sig_c = _c_DDX->val()*fact;
      double err_c = _c_DDX->err()*fact;
      double sig_m = _c_muons  ->val()*fact;
      double err_m = _c_muons  ->err()*fact;
      Scatter2D temphisto(refData(6, 1, 2));
      Scatter2DPtr charm;
      book(charm, 6,1,1);
      Scatter2DPtr hadrons;
      book(hadrons, "sigma_hadrons");
      Scatter2DPtr muons;
      book(muons, "sigma_muons"  );
      Scatter2DPtr mult;
      book(mult, 6,1,2);
      for (size_t b = 0; b < temphisto.numPoints(); b++) {
	const double x  = temphisto.point(b).x();
	pair<double,double> ex = temphisto.point(b).xErrs();
	pair<double,double> ex2 = ex;
	if(ex2.first ==0.) ex2. first=0.0001;
	if(ex2.second==0.) ex2.second=0.0001;
	if (inRange(sqrtS()/MeV, x-ex2.first, x+ex2.second)) {
	  mult   ->addPoint(x, rval, ex, rerr);
	  hadrons->addPoint(x, sig_h, ex, make_pair(err_h,err_h));
	  charm  ->addPoint(x, sig_c, ex, make_pair(err_c,err_c));
	  muons  ->addPoint(x, sig_m, ex, make_pair(err_m,err_m));
	}
	else {
	  mult   ->addPoint(x, 0., ex, make_pair(0.,.0));
	  hadrons->addPoint(x, 0., ex, make_pair(0.,.0));
	  charm  ->addPoint(x, 0., ex, make_pair(0.,.0));
	  muons  ->addPoint(x, 0., ex, make_pair(0.,.0));
	}
      }
      for(unsigned int ix=1;ix<6;++ix) {
	unsigned int imax(0);
	if     (ix<=3) imax = 4;
	else           imax = 3;
	for(unsigned int iy=1;iy<imax;++iy) {
	  double sigma(0),error(0);
	  if(ix==1) {
	    if(iy==1) {
	      sigma = _c_D0D0->val()/picobarn;
	      error = _c_D0D0->err()/picobarn;
	    }
	    else if(iy==2) {
	      sigma = _c_D0D0S->val()/picobarn;
	      error = _c_D0D0S->err()/picobarn;
	    }
	    else if(iy==3) {
	      sigma = _c_D0SD0S->val()/picobarn;
	      error = _c_D0SD0S->err()/picobarn;
	    }
	  }
	  else if(ix==2) {
	    if(iy==1) {
	      sigma = _c_DpDm->val()/picobarn;
	      error = _c_DpDm->err()/picobarn;
	    }
	    else if(iy==2) {
	      sigma = _c_DpDmS->val()/picobarn;
	      error = _c_DpDmS->err()/picobarn;
	    }
	    else if(iy==3) {
	      sigma = _c_DpSDmS->val()/picobarn;
	      error = _c_DpSDmS->err()/picobarn;
	    }
	  }
	  else if(ix==3) {
	    if(iy==1) {
	      sigma = _c_DsDs->val()/picobarn;
	      error = _c_DsDs->err()/picobarn;
	    }
	    else if(iy==2) {
	      sigma = _c_DsDsS->val()/picobarn;
	      error = _c_DsDsS->err()/picobarn;
	    }
	    else if(iy==3) {
	      sigma = _c_DsSDsS->val()/picobarn;
	      error = _c_DsSDsS->err()/picobarn;
	    }
	  }
	  else if(ix==4) {
	    if(iy==1) {
	      sigma = _c_DSDpi->val()/picobarn;
	      error = _c_DSDpi->err()/picobarn;
	    }
	    else if(iy==2) {
	      sigma = _c_DSDSpi->val()/picobarn;
	      error = _c_DSDSpi->err()/picobarn;
	    }
	  }
	  else if(ix==5) {
	    if(iy==1) {
	      sigma = _c_DD->val()/nanobarn;
	      error = _c_DD->err()/nanobarn;
	    }
	    else if(iy==2) {
	      sigma = _c_DDX->val()/nanobarn;
	      error = _c_DDX->err()/nanobarn;
	    }
	  }
	  sigma *= crossSection()/ sumOfWeights();
	  error *= crossSection()/ sumOfWeights();
	  Scatter2D temphisto(refData(ix, 1, iy));
	  Scatter2DPtr mult;
	  book(mult, ix,1,iy);
	  for (size_t b = 0; b < temphisto.numPoints(); b++) {
	    const double x  = temphisto.point(b).x();
	    pair<double,double> ex = temphisto.point(b).xErrs();
	    pair<double,double> ex2 = ex;
	    if(ex2.first ==0.) ex2. first=0.0001;
	    if(ex2.second==0.) ex2.second=0.0001;
	    if (inRange(sqrtS()/MeV, x-ex2.first, x+ex2.second)) {
	      mult   ->addPoint(x, sigma, ex, make_pair(error,error));
	    }
	    else {
	      mult   ->addPoint(x, 0., ex, make_pair(0.,.0));
	    }
	  }
	}
      }
    }

    //@}


    /// @name Histograms
    //@{
    CounterPtr _c_D0D0, _c_DpDm,_c_DsDs;
    CounterPtr _c_D0D0S, _c_DpDmS,_c_DsDsS;
    CounterPtr _c_D0SD0S, _c_DpSDmS,_c_DsSDsS;
    CounterPtr _c_DD, _c_DDX;
    CounterPtr _c_DSDpi, _c_DSDSpi;
    CounterPtr _c_hadrons, _c_muons;
    //@}


  };


  // The hook for the plugin system
  DECLARE_RIVET_PLUGIN(CLEOC_2008_I777917);


}