Rivet analyses referenceTPC_1986_I217416$D^{*\pm}$ spectrum at 29 GeVExperiment: TPC (PEP) Inspire ID: 217416 Status: VALIDATED Authors:
Beam energies: (14.5, 14.5) GeV Run details:
Measurement of the $D^{*\pm}$ spectrum at 29 GeV by the TPC experiment. Source code: TPC_1986_I217416.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/Beam.hh"
4#include "Rivet/Projections/FinalState.hh"
5#include "Rivet/Projections/ChargedFinalState.hh"
6#include "Rivet/Projections/UnstableParticles.hh"
7
8namespace Rivet {
9
10
11 /// @brief Add a short analysis description here
12 class TPC_1986_I217416 : public Analysis {
13 public:
14
15 /// Constructor
16 RIVET_DEFAULT_ANALYSIS_CTOR(TPC_1986_I217416);
17
18
19 /// @name Analysis methods
20 /// @{
21
22 /// Book histograms and initialise projections before the run
23 void init() {
24 declare(Beam(), "Beams");
25 declare(ChargedFinalState(), "FS");
26 declare(UnstableParticles(), "UFS");
27 book(_histSigma, 1, 1, 1);
28 book(_histNorm , 1, 1, 2);
29 }
30
31
32 /// Perform the per-event analysis
33 void analyze(const Event& event) {
34
35 // First, veto on leptonic events by requiring at least 4 charged FS particles
36 const FinalState& fs = apply<FinalState>(event, "FS");
37 const size_t numParticles = fs.particles().size();
38
39 // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
40 if (numParticles < 2) {
41 MSG_DEBUG("Failed leptonic event cut");
42 vetoEvent;
43 }
44 MSG_DEBUG("Passed leptonic event cut");
45
46 // Get beams and average beam momentum
47 const ParticlePair& beams = apply<Beam>(event, "Beams").beams();
48 const double meanBeamMom = ( beams.first.p3().mod() +
49 beams.second.p3().mod() ) / 2.0;
50 MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
51
52 // Final state of unstable particles to get particle spectra
53 const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
54
55 for( const Particle& p : ufs.particles(Cuts::abspid==413)) {
56 double xE = p.E()/meanBeamMom;
57 _histSigma->fill(xE);
58 _histNorm ->fill(xE);
59 }
60
61 }
62
63
64 /// Normalise histograms etc., after the run
65 void finalize() {
66 scale(_histSigma, crossSection()*sqr(sqrtS())/microbarn/sumOfWeights());
67 normalize(_histNorm);
68 }
69
70 /// @}
71
72
73 /// @name Histograms
74 /// @{
75 Histo1DPtr _histSigma;
76 Histo1DPtr _histNorm ;
77 /// @}
78
79
80 };
81
82
83 RIVET_DECLARE_PLUGIN(TPC_1986_I217416);
84
85
86}
|