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 switch (id) {
58 case 22: // Photons
59 _histPhoton->fill(p.E());
60 break;
61 case 111: // Neutral pions
62 _histPi->fill(p.E());
63 break;
64 }
65 }
66
67 }
68
69
70 /// Normalise histograms etc., after the run
71 void finalize() {
72 scale(_histPhoton, sqrtS()/2./sumOfWeights());
73 scale(_histPi , sqrtS()/2./sumOfWeights());
74 }
75
76 /// @}
77
78
79 /// @name Histograms
80 /// @{
81 Histo1DPtr _histPhoton;
82 Histo1DPtr _histPi ;
83 /// @}
84
85
86 };
87
88
89 RIVET_DECLARE_PLUGIN(TPC_1985_I205868);
90
91
92}
|