Rivet analyses referenceMARKII_1982_I177606$D^{*\pm}$ production at 29 GeVExperiment: MARKII (PEP) Inspire ID: 177606 Status: VALIDATED Authors:
Beam energies: (14.5, 14.5) GeV Run details:
Rate and spectrum for $D^{*\pm}$ meson production at 29 GeV measured by the MARKII collaboration. Source code: MARKII_1982_I177606.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief D* +/- production at 29 GeV
9 class MARKII_1982_I177606 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(MARKII_1982_I177606);
14
15
16 /// @name Analysis methods
17 ///@{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 // Initialise and register projections
22 declare(UnstableParticles(), "UFS");
23 //Histograms
24 book(_h_spect[0],2,1,1);
25 book(_h_spect[1],3,1,1);
26 _axis = YODA::Axis<double>(4, 0.2, 1.0);
27 }
28
29
30 /// Perform the per-event analysis
31 void analyze(const Event& event) {
32 if (_edges.empty()) _edges = _h_spect[0]->xEdges();
33 const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
34 for (const Particle& p : ufs.particles(Cuts::abspid==413)) {
35 const double xp = 2.*p.E()/sqrtS();
36 const double beta = p.p3().mod() / p.E();
37 _h_spect[0]->fill(map2string(xp), 1./beta);
38 _h_spect[1]->fill(map2string(xp), 1./beta);
39 }
40 }
41
42
43 /// Normalise histograms etc., after the run
44 void finalize() {
45 for(unsigned int ix=0;ix<2;++ix) {
46 scale(_h_spect[ix], sqr(sqrtS())*crossSection()/microbarn/sumOfWeights());
47 for(auto & b : _h_spect[ix]->bins())
48 b.scaleW(1./_axis.width(b.index()));
49 }
50 }
51
52 ///@}
53
54 string map2string(const double value) const {
55 const size_t idx = _axis.index(value);
56 if (idx && idx <= _edges.size()) return _edges[idx-1];
57 return "OTHER";
58 }
59
60
61 /// @name Histograms
62 ///@{
63 BinnedHistoPtr<string> _h_spect[2];
64 vector<string> _edges;
65 YODA::Axis<double> _axis;
66 ///@}
67
68
69 };
70
71
72 RIVET_DECLARE_PLUGIN(MARKII_1982_I177606);
73
74}
|