Rivet analyses referenceMARKI_1979_I133123Cross section and spectra for $D^0$ and $D^+$ spectra at $\sqrt{s}=7$ GeVExperiment: MARKI (PEP) Inspire ID: 133123 Status: VALIDATED Authors:
Beam energies: (3.5, 3.5) GeV Run details:
Cross section and spectra for $D^0$ and $D^+$ spectra at $\sqrt{s}=7$ GeV Source code: MARKI_1979_I133123.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief D0 D+ and 7 GeV
9 class MARKI_1979_I133123 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(MARKI_1979_I133123);
14
15 /// @name Analysis methods
16 /// @{
17
18 /// Book histograms and initialise projections before the run
19 void init() {
20 // Initialise and register projections
21 declare(UnstableParticles(Cuts::abspid==411 || Cuts::abspid==421), "UFS");
22 //Histograms
23 for (unsigned int ix=0; ix<2; ++ix) {
24 book(_h_sigma[ix], 1, 1, 1+ix);
25 for (unsigned int iy=0; iy<2; ++iy)
26 book(_h_spect[ix][iy], 3+iy, 1, 1+ix);
27 }
28 }
29
30
31 /// Perform the per-event analysis
32 void analyze(const Event& event) {
33 const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
34 for (const Particle& p : ufs.particles()) {
35 const double xE = 2.*p.E()/sqrtS();
36 unsigned int iloc = p.abspid()==421 ? 0 : 1;
37 _h_sigma[iloc]->fill(sqrtS());
38 for (unsigned int iy=0; iy<2; ++iy) {
39 _h_spect[iloc][iy]->fill(xE);
40 }
41 }
42 }
43
44
45 /// Normalise histograms etc., after the run
46 void finalize() {
47 for (unsigned int ix=0; ix<2; ++ix) {
48 scale(_h_sigma[ix], 1.8*crossSection()/nanobarn/sumOfWeights());
49 for (unsigned int iy=0; iy<2; ++iy)
50 scale(_h_spect[ix][iy],sqr(sqrtS())*crossSection()/microbarn/sumOfWeights());
51 }
52 }
53
54 /// @}
55
56
57 /// @name Histograms
58 /// @{
59 Histo1DPtr _h_sigma[2],_h_spect[2][2];
60 /// @}
61
62
63 };
64
65
66 RIVET_DECLARE_PLUGIN(MARKI_1979_I133123);
67
68}
|