Rivet analyses referenceALEPH_2014_I1267648Normalised spectral functions of hadronic tau decaysExperiment: ALEPH (LEP) Inspire ID: 1267648 Status: VALIDATED Authors:
Beams: * * Beam energies: ANY Run details:
Spectral functions of pionic tau decays measured with ALEPH. The data is taken from http://aleph.web.lal.in2p3.fr/tau/specfun.html Source code: ALEPH_2014_I1267648.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief Add a short analysis description here
9 class ALEPH_2014_I1267648 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(ALEPH_2014_I1267648);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21
22 // Initialise and register projections
23 declare(UnstableParticles(), "UFS");
24
25 // Book histograms
26 for(unsigned int ix=0;ix<5;++ix)
27 book(_h[ix], "TMP/h_"+toString(ix+1),refData(1+ix,1,1));
28 book(_c,"TMP/ntau");
29 }
30
31
32 void findDecayProducts(const Particle &mother, const int isign, unsigned int &nstable, unsigned int &npip,
33 unsigned int &npim, unsigned int &npi0, FourMomentum &ptot) {
34 for (const Particle &p : mother.children()) {
35 int id = p.pid();
36 if (id == PID::KPLUS || id == PID::KMINUS) {
37 ++nstable;
38 ptot += p.momentum();
39 }
40 else if (id*isign == PID::PIPLUS) {
41 ++npip;
42 ++nstable;
43 ptot += p.momentum();
44 }
45 else if (id*isign == PID::PIMINUS) {
46 ++npim;
47 ++nstable;
48 ptot += p.momentum();
49 }
50 else if (id == PID::PI0) {
51 ++nstable;
52 ++npi0;
53 ptot += p.momentum();
54 }
55 else if (id == PID::PHOTON) continue;
56 else if (!p.children().empty()) findDecayProducts(p, isign, nstable, npip, npim, npi0, ptot);
57 else ++nstable;
58 }
59 }
60
61
62 /// Perform the per-event analysis
63 void analyze(const Event& event) {
64
65 // Loop over taus
66 for (const Particle& tau : apply<UnstableParticles>(event, "UFS").particles(Cuts::abspid==PID::TAU)) {
67 _c->fill();
68 FourMomentum ptot;
69 unsigned int nstable(0), npip(0), npim(0), npi0(0);
70 findDecayProducts(tau,tau.pid()/tau.abspid(),nstable,npip,npim,npi0,ptot);
71 // tau -> pi pi0 nu_tau (both charges)
72 if (npim==1 && npi0==1 && nstable==3) _h[0]->fill(ptot.mass2());
73 // tau -> pi pi0 pi0 nu_tau (both charges)
74 else if (npim==1 && npi0==2 && nstable==4) _h[1]->fill(ptot.mass2());
75 // tau -> pi pi0 pi0 pi0 (3,1,1)
76 else if (npim==1 && npi0==3 && nstable==5) _h[2]->fill(ptot.mass2());
77 // tau -> 3 charged pions (4,1,1)
78 else if (npim==2 && npip==1 && nstable==4) _h[3]->fill(ptot.mass2());
79 // tau -> 3 charged pions + pi0 (5,1,1)
80 else if (npim==2 && npip==1 && npi0==1 && nstable==5) _h[4]->fill(ptot.mass2());
81 }
82 }
83
84
85 /// Normalise histograms etc., after the run
86 void finalize() {
87 for(unsigned int ix=0;ix<5;++ix) {
88 scale(_h[ix] ,100./ *_c);
89 Estimate1DPtr tmp;
90 book(tmp,1+ix,1,1);
91 barchart(_h[ix],tmp);
92 }
93 }
94
95 /// @}
96
97
98 private:
99
100
101 /// @name Histograms
102 /// @{
103 Histo1DPtr _h[5];
104 CounterPtr _c;
105 /// @}
106 };
107
108
109 RIVET_DECLARE_PLUGIN(ALEPH_2014_I1267648);
110
111}
|