2
#include "Rivet/Analysis.hh"
3
#include "Rivet/RivetAIDA.hh"
4
#include "Rivet/Tools/ParticleIdUtils.hh"
5
#include "Rivet/Projections/Beam.hh"
6
#include "Rivet/Projections/FinalState.hh"
7
#include "Rivet/Projections/ChargedFinalState.hh"
8
#include "Rivet/Projections/UnstableFinalState.hh"
13
/// @brief OPAL f0,f2 and phi fragmentation function paper
14
/// @author Peter Richardson
15
class OPAL_1998_S3702294 : public Analysis {
20
: Analysis("OPAL_1998_S3702294")
24
/// @name Analysis methods
28
addProjection(Beam(), "Beams");
29
addProjection(ChargedFinalState(), "FS");
30
addProjection(UnstableFinalState(), "UFS");
31
_histXpf0 = bookHistogram1D( 2, 1, 1);
32
_histXpf2 = bookHistogram1D( 2, 1, 2);
33
_histXpPhi = bookHistogram1D( 2, 1, 3);
37
void analyze(const Event& e) {
38
// First, veto on leptonic events by requiring at least 4 charged FS particles
39
const FinalState& fs = applyProjection<FinalState>(e, "FS");
40
const size_t numParticles = fs.particles().size();
42
// Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
43
if (numParticles < 2) {
44
MSG_DEBUG("Failed leptonic event cut");
47
MSG_DEBUG("Passed leptonic event cut");
49
// Get event weight for histo filling
50
const double weight = e.weight();
52
// Get beams and average beam momentum
53
const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
54
const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
55
beams.second.momentum().vector3().mod() ) / 2.0;
56
MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
58
// Final state of unstable particles to get particle spectra
59
const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
61
foreach (const Particle& p, ufs.particles()) {
62
const int id = abs(p.pdgId());
63
double xp = p.momentum().vector3().mod()/meanBeamMom;
66
_histXpf0->fill(xp, weight);
69
_histXpf2->fill(xp, weight);
72
_histXpPhi->fill(xp, weight);
81
scale(_histXpf0 , 1./sumOfWeights());
82
scale(_histXpf2 , 1./sumOfWeights());
83
scale(_histXpPhi, 1./sumOfWeights());
91
AIDA::IHistogram1D *_histXpf0;
92
AIDA::IHistogram1D *_histXpf2;
93
AIDA::IHistogram1D *_histXpPhi;
98
// The hook for the plugin system
99
DECLARE_RIVET_PLUGIN(OPAL_1998_S3702294);