Rivet analyses referenceTPC_1985_I205868Photon and $\pi^0$ spectra at 29 GeVExperiment: TPC (PEP) Inspire ID: 205868 Status: VALIDATED Authors:
Beam energies: (14.5, 14.5) GeV Run details:
Measurement of the photon and $\pi^0$ spectra at 29 GeV by the TPC experiment. Source code: TPC_1985_I205868.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 pi0 and gamma spectra at 29 GeV
12 class TPC_1985_I205868 : public Analysis {
13 public:
14
15 /// Constructor
16 RIVET_DEFAULT_ANALYSIS_CTOR(TPC_1985_I205868);
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(_histPhoton, 1, 1, 1);
28 book(_histPi , 2, 1, 1);
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()) {
56 const int id = p.abspid();
57 double xE = p.E()/meanBeamMom;
58 switch (id) {
59 case 22: // Photons
60 _histPhoton->fill(xE);
61 break;
62 case 111: // Neutral pions
63 _histPi->fill(xE);
64 break;
65 }
66 }
67
68 }
69
70
71 /// Normalise histograms etc., after the run
72 void finalize() {
73 scale(_histPhoton, 1./sumOfWeights());
74 scale(_histPi , 1./sumOfWeights());
75 }
76
77 /// @}
78
79
80 /// @name Histograms
81 /// @{
82 Histo1DPtr _histPhoton;
83 Histo1DPtr _histPi ;
84 /// @}
85
86
87 };
88
89
90 RIVET_DECLARE_PLUGIN(TPC_1985_I205868);
91
92
93}
|